changeset 40369:9fe6781cbe39

Merge
author iveresov
date Fri, 05 Aug 2016 13:37:53 -0700
parents 4290f5dfad35 3a42ea2be1e5
children 2f564c75bcde
files hotspot/src/share/vm/prims/whitebox.cpp jaxp/test/javax/xml/jaxp/functional/TEST.properties jaxp/test/javax/xml/jaxp/internaltest/TEST.properties jaxp/test/javax/xml/jaxp/internaltest/javax/xml/parsers/bug8003147/Bug8003147Test.java jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/bug6551616/Bug6551616.java jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/CLITest.java jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/ProcessXSLT.java jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest-in.xml jaxp/test/javax/xml/jaxp/internaltest/javax/xml/transform/cli/tigertest.xsl jaxp/test/javax/xml/jaxp/isolatedjdk/TEST.properties jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPBaseTest.java jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPFileBaseTest.java jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPFileReadOnlyBaseTest.java jaxp/test/javax/xml/jaxp/libs/jaxp/library/TestPolicy.java jaxp/test/javax/xml/jaxp/module/TEST.properties jaxp/test/javax/xml/jaxp/unittest/policy/PolicyUtil.java jaxp/test/javax/xml/jaxp/unittest/policy/common.policy jaxp/test/javax/xml/jaxp/unittest/transform/CR6551600.policy jaxp/test/javax/xml/jaxp/unittest/validation/6773084.policy jdk/src/java.desktop/share/native/libawt/java2d/ShaderList.c jdk/src/java.desktop/share/native/libawt/java2d/ShaderList.h jdk/test/sun/misc/Safe.java
diffstat 1368 files changed, 16325 insertions(+), 7216 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Aug 05 16:23:44 2016 +0300
+++ b/.hgtags	Fri Aug 05 13:37:53 2016 -0700
@@ -372,3 +372,4 @@
 8e45018bde9de4ad15b972ae62874bba52dba2d5 jdk-9+127
 5bf88dce615f6804f9e101a96ffa7c9dfb4fbbbe jdk-9+128
 e8373543a3f0f60589b7d72b1f9b172721124caf jdk-9+129
+e613affb88d178dc7c589f1679db113d589bddb4 jdk-9+130
--- a/.hgtags-top-repo	Fri Aug 05 16:23:44 2016 +0300
+++ b/.hgtags-top-repo	Fri Aug 05 13:37:53 2016 -0700
@@ -372,3 +372,4 @@
 8fa686245bd2a072ece3392743460030f0854520 jdk-9+127
 b30ae794d974d7dd3eb4e84203f70021823fa6c6 jdk-9+128
 f5902d3841b82cac6e7716a20c24e8e916fb14a8 jdk-9+129
+d94d54a3192fea79234c3ac55cd0b4052d45e954 jdk-9+130
--- a/common/autoconf/flags.m4	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/autoconf/flags.m4	Fri Aug 05 13:37:53 2016 -0700
@@ -684,7 +684,7 @@
   AC_SUBST(CXXFLAGS_TESTEXE)
 
   LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
-  LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
+  LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
 
   AC_SUBST(LDFLAGS_TESTLIB)
   AC_SUBST(LDFLAGS_TESTEXE)
@@ -713,20 +713,17 @@
     FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror],
     						 IF_FALSE: [$2CXXSTD_CXXFLAG=""])
     $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}"
+    $2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}"
     AC_SUBST([$2CXXSTD_CXXFLAG])
   fi
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     $2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
     $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__"
-    $2CFLAGS_JDKLIB_EXTRA='-xstrconst'
-    CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
-    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     $2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
     $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__"
-    $2CFLAGS_JDKLIB_EXTRA='-xstrconst'
   fi
 
   $2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}"
@@ -768,7 +765,7 @@
         $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
         ;;
     esac
-    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS)
+    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2))
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
     $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
 
@@ -1112,7 +1109,7 @@
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
-    $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
+    $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
     LDFLAGS_CXX_SOLSTUDIO="-norunpath"
     $2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
     $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
@@ -1147,11 +1144,11 @@
 
   $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \
+    $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
         -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     $2JDKLIB_LIBS=""
   else
-    $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \
+    $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
         -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)"
 
     if test "x$1" = "xTARGET"; then
@@ -1160,17 +1157,17 @@
       # Only add client/minimal dir if client/minimal is being built.
     # Default to server for other variants.
       if HOTSPOT_CHECK_JVM_VARIANT(server); then
-        $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
+        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
       elif HOTSPOT_CHECK_JVM_VARIANT(client); then
-        $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/client"
+        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/client"
       elif HOTSPOT_CHECK_JVM_VARIANT(minimal); then
-        $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/minimal"
+        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/minimal"
     else
-        $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
+        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
     fi
     elif test "x$1" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
-      $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} \
+      $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
           -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_$1_CPU_LIBDIR)/server"
     fi
 
@@ -1181,6 +1178,8 @@
 
   fi
 
+$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2JAVA_BASE_LDFLAGS}"
+
   # Set $2JVM_LIBS (per os)
   if test "x$OPENJDK_$1_OS" = xlinux; then
     $2JVM_LIBS="[$]$2JVM_LIBS -lm -ldl -lpthread"
@@ -1447,19 +1446,24 @@
   AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
 ])
 
-AC_DEFUN_ONCE([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
+# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
+# Arguments:
+# $1 - Optional prefix for each variable defined.
+AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
 [
   # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
   # runs afoul of the more aggressive versions of these optimisations.
   # Notably, value range propagation now assumes that the this pointer of C++
   # member functions is non-null.
-  NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks"
-  FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_NULL_POINTER_CHECK_CFLAG -Werror],
-  					     IF_FALSE: [NO_NULL_POINTER_CHECK_CFLAG=""])
-  AC_SUBST([NO_NULL_POINTER_CHECK_CFLAG])
+  NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
+  dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
+  dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
+  dnl					     IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
   NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
-  FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
-  					     IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
-  CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
-  AC_SUBST([NO_LIFETIME_DSE_CFLAG])
+  dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
+  dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
+  dnl					     IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
+  AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}])
+  $1CFLAGS_JDK="[$]$1CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
+  $1JVM_CFLAGS="[$]$1JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
 ])
--- a/common/autoconf/generated-configure.sh	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/autoconf/generated-configure.sh	Fri Aug 05 13:37:53 2016 -0700
@@ -749,8 +749,6 @@
 CFLAGS_JDKEXE
 CFLAGS_JDKLIB
 MACOSX_VERSION_MIN
-NO_LIFETIME_DSE_CFLAG
-NO_NULL_POINTER_CHECK_CFLAG
 CXXSTD_CXXFLAG
 CXX_O_FLAG_SIZE
 CXX_O_FLAG_NONE
@@ -4092,6 +4090,9 @@
 
 
 
+# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
+# Arguments:
+# $1 - Optional prefix for each variable defined.
 
 
 #
@@ -4913,7 +4914,7 @@
 TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
 TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
 TOOLCHAIN_MINIMUM_VERSION_microsoft=""
-TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12"
+TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
 TOOLCHAIN_MINIMUM_VERSION_xlc=""
 
 # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
@@ -5094,7 +5095,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1469202305
+DATE_WHEN_GENERATED=1470415803
 
 ###############################################################################
 #
@@ -43767,8 +43768,12 @@
   fi
 
 
-  # Restore old path.
-  PATH="$OLD_PATH"
+  # Restore old path, except for the microsoft toolchain, which requires VS_PATH
+  # to remain in place. Otherwise the compiler will not work in some siutations
+  # in later configure checks.
+  if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then
+    PATH="$OLD_PATH"
+  fi
 
   # Restore the flags to the user specified values.
   # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
@@ -47232,6 +47237,28 @@
     BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
     BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
     BUILD_AR="$AR"
+
+
+  if test "x$CC_VERSION_NUMBER" != "x$CXX_VERSION_NUMBER"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&5
+$as_echo "$as_me: WARNING: C and C++ compiler have different version numbers, $CC_VERSION_NUMBER vs $CXX_VERSION_NUMBER." >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5
+$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;}
+  fi
+
+  # We only check CC_VERSION_NUMBER since we assume CXX_VERSION_NUMBER is equal.
+  if  [[ "[$]CC_VERSION_NUMBER" =~ (.*\.){3} ]] ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&5
+$as_echo "$as_me: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;}
+  fi
+
+  if  [[  "[$]CC_VERSION_NUMBER" =~ [0-9]{6} ]] ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&5
+$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION_NUMBER. Comparisons might be wrong." >&2;}
+  fi
+
+  OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", $1, $2, $3) }' <<< "$CC_VERSION_NUMBER"`
+
   fi
 
 
@@ -49781,20 +49808,17 @@
 
 
     CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}"
+    JVM_CFLAGS="${JVM_CFLAGS} ${CXXSTD_CXXFLAG}"
 
   fi
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
-    CFLAGS_JDKLIB_EXTRA='-xstrconst'
-    CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
-    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
     CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
-    CFLAGS_JDKLIB_EXTRA='-xstrconst'
   fi
 
   CFLAGS_JDK="${CFLAGS_JDK} ${EXTRA_CFLAGS}"
@@ -49913,542 +49937,12 @@
   # runs afoul of the more aggressive versions of these optimisations.
   # Notably, value range propagation now assumes that the this pointer of C++
   # member functions is non-null.
-  NO_NULL_POINTER_CHECK_CFLAG="-fno-delete-null-pointer-checks"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # Execute function body
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # Execute function body
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"" >&5
-$as_echo_n "checking if the C compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"... " >&6; }
-  supports=yes
-
-  saved_cflags="$CFLAGS"
-  CFLAGS="$CFLAGS $NO_NULL_POINTER_CHECK_CFLAG -Werror"
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int i;
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  supports=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-  CFLAGS="$saved_cflags"
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
-$as_echo "$supports" >&6; }
-  if test "x$supports" = "xyes" ; then
-    :
-    C_COMP_SUPPORTS="yes"
-  else
-    :
-    C_COMP_SUPPORTS="no"
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # Execute function body
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"" >&5
-$as_echo_n "checking if the C++ compiler supports \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"... " >&6; }
-  supports=yes
-
-  saved_cxxflags="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAG $NO_NULL_POINTER_CHECK_CFLAG -Werror"
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int i;
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  supports=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-  CXXFLAGS="$saved_cxxflags"
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
-$as_echo "$supports" >&6; }
-  if test "x$supports" = "xyes" ; then
-    :
-    CXX_COMP_SUPPORTS="yes"
-  else
-    :
-    CXX_COMP_SUPPORTS="no"
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"" >&5
-$as_echo_n "checking if both compilers support \"$NO_NULL_POINTER_CHECK_CFLAG -Werror\"... " >&6; }
-  supports=no
-  if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
-$as_echo "$supports" >&6; }
-  if test "x$supports" = "xyes" ; then
-    :
-
-  else
-    :
-    NO_NULL_POINTER_CHECK_CFLAG=""
-  fi
-
-
-
-
-
-
-
-  NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # Execute function body
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # Execute function body
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"" >&5
-$as_echo_n "checking if the C compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"... " >&6; }
-  supports=yes
-
-  saved_cflags="$CFLAGS"
-  CFLAGS="$CFLAGS $NO_LIFETIME_DSE_CFLAG -Werror"
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int i;
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  supports=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-  CFLAGS="$saved_cflags"
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
-$as_echo "$supports" >&6; }
-  if test "x$supports" = "xyes" ; then
-    :
-    C_COMP_SUPPORTS="yes"
-  else
-    :
-    C_COMP_SUPPORTS="no"
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    # Execute function body
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"" >&5
-$as_echo_n "checking if the C++ compiler supports \"$NO_LIFETIME_DSE_CFLAG -Werror\"... " >&6; }
-  supports=yes
-
-  saved_cxxflags="$CXXFLAGS"
-  CXXFLAGS="$CXXFLAG $NO_LIFETIME_DSE_CFLAG -Werror"
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int i;
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  supports=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-  CXXFLAGS="$saved_cxxflags"
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
-$as_echo "$supports" >&6; }
-  if test "x$supports" = "xyes" ; then
-    :
-    CXX_COMP_SUPPORTS="yes"
-  else
-    :
-    CXX_COMP_SUPPORTS="no"
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if both compilers support \"$NO_LIFETIME_DSE_CFLAG -Werror\"" >&5
-$as_echo_n "checking if both compilers support \"$NO_LIFETIME_DSE_CFLAG -Werror\"... " >&6; }
-  supports=no
-  if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
-$as_echo "$supports" >&6; }
-  if test "x$supports" = "xyes" ; then
-    :
-
-  else
-    :
-    NO_LIFETIME_DSE_CFLAG=""
-  fi
-
-
-
-
-
-
-  CFLAGS_JDK="${CFLAGS_JDK} ${NO_NULL_POINTER_CHECK_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
-
-
+  NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
+        NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&5
+$as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&6;}
+  CFLAGS_JDK="$CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
+  JVM_CFLAGS="$JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
 
   else
     :
@@ -50900,7 +50394,7 @@
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
-    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
+    LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
     LDFLAGS_CXX_SOLSTUDIO="-norunpath"
     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
     JVM_LDFLAGS="$JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
@@ -50935,11 +50429,11 @@
 
   LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
+    JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
         -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     JDKLIB_LIBS=""
   else
-    LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
+    JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
         -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)"
 
     if test "xTARGET" = "xTARGET"; then
@@ -50948,17 +50442,17 @@
       # Only add client/minimal dir if client/minimal is being built.
     # Default to server for other variants.
       if   [[ " $JVM_VARIANTS " =~ " server " ]]  ; then
-        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
+        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
       elif   [[ " $JVM_VARIANTS " =~ " client " ]]  ; then
-        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/client"
+        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/client"
       elif   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
-        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/minimal"
-    else
-        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
+        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/minimal"
+    else
+        JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
     fi
     elif test "xTARGET" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
-      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
+      JAVA_BASE_LDFLAGS="${JAVA_BASE_LDFLAGS} \
           -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
     fi
 
@@ -50969,6 +50463,8 @@
 
   fi
 
+LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${JAVA_BASE_LDFLAGS}"
+
   # Set JVM_LIBS (per os)
   if test "x$OPENJDK_TARGET_OS" = xlinux; then
     JVM_LIBS="$JVM_LIBS -lm -ldl -lpthread"
@@ -51127,20 +50623,17 @@
 
 
     OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}"
+    OPENJDK_BUILD_JVM_CFLAGS="${OPENJDK_BUILD_JVM_CFLAGS} ${OPENJDK_BUILD_CXXSTD_CXXFLAG}"
 
   fi
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__"
     OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__"
-    OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA='-xstrconst'
-    CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
-    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
   fi
 
   if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} -D__solaris__"
     OPENJDK_BUILD_CXXFLAGS_JDK="${OPENJDK_BUILD_CXXFLAGS_JDK} -D__solaris__"
-    OPENJDK_BUILD_CFLAGS_JDKLIB_EXTRA='-xstrconst'
   fi
 
   OPENJDK_BUILD_CFLAGS_JDK="${OPENJDK_BUILD_CFLAGS_JDK} ${OPENJDK_BUILD_EXTRA_CFLAGS}"
@@ -51255,6 +50748,17 @@
   if test $OPENJDK_BUILD_COMPARABLE_ACTUAL_VERSION -ge $COMPARABLE_REFERENCE_VERSION ; then
     :
 
+  # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
+  # runs afoul of the more aggressive versions of these optimisations.
+  # Notably, value range propagation now assumes that the this pointer of C++
+  # member functions is non-null.
+  NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
+        NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&5
+$as_echo "$as_me: GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}" >&6;}
+  OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
+  OPENJDK_BUILD_JVM_CFLAGS="$OPENJDK_BUILD_JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
+
   else
     :
 
@@ -51705,7 +51209,7 @@
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
     LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
-    OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
+    OPENJDK_BUILD_LDFLAGS_JDK="$OPENJDK_BUILD_LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
     LDFLAGS_CXX_SOLSTUDIO="-norunpath"
     OPENJDK_BUILD_LDFLAGS_CXX_JDK="$OPENJDK_BUILD_LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
     OPENJDK_BUILD_JVM_LDFLAGS="$OPENJDK_BUILD_JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
@@ -51740,11 +51244,11 @@
 
   OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
   if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \
+    OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
         -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
     OPENJDK_BUILD_JDKLIB_LIBS=""
   else
-    OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \
+    OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
         -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)"
 
     if test "xBUILD" = "xTARGET"; then
@@ -51753,17 +51257,17 @@
       # Only add client/minimal dir if client/minimal is being built.
     # Default to server for other variants.
       if   [[ " $JVM_VARIANTS " =~ " server " ]]  ; then
-        OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
+        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
       elif   [[ " $JVM_VARIANTS " =~ " client " ]]  ; then
-        OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/client"
+        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/client"
       elif   [[ " $JVM_VARIANTS " =~ " minimal " ]]  ; then
-        OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/minimal"
-    else
-        OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
+        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/minimal"
+    else
+        OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
     fi
     elif test "xBUILD" = "xBUILD"; then
       # When building a buildjdk, it's always only the server variant
-      OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \
+      OPENJDK_BUILD_JAVA_BASE_LDFLAGS="${OPENJDK_BUILD_JAVA_BASE_LDFLAGS} \
           -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_BUILD_CPU_LIBDIR)/server"
     fi
 
@@ -51774,6 +51278,8 @@
 
   fi
 
+OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${OPENJDK_BUILD_JAVA_BASE_LDFLAGS}"
+
   # Set OPENJDK_BUILD_JVM_LIBS (per os)
   if test "x$OPENJDK_BUILD_OS" = xlinux; then
     OPENJDK_BUILD_JVM_LIBS="$OPENJDK_BUILD_JVM_LIBS -lm -ldl -lpthread"
@@ -51838,7 +51344,7 @@
 
 
   LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
-  LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
+  LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
 
 
 
@@ -53328,8 +52834,8 @@
     as_fn_error $? "Specified JVM feature 'management' requires feature 'nmt'" "$LINENO" 5
   fi
 
-  if   [[ " $JVM_FEATURES " =~ " jvmci " ]]   && !   [[ " $JVM_FEATURES " =~ " compiler2 " ]]  ; then
-    as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2'" "$LINENO" 5
+  if   [[ " $JVM_FEATURES " =~ " jvmci " ]]   && ! (  [[ " $JVM_FEATURES " =~ " compiler1 " ]]   ||   [[ " $JVM_FEATURES " =~ " compiler2 " ]]  ); then
+    as_fn_error $? "Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'" "$LINENO" 5
   fi
 
   if   [[ " $JVM_FEATURES " =~ " compiler2 " ]]   && !   [[ " $JVM_FEATURES " =~ " all-gcs " ]]  ; then
@@ -53369,7 +52875,7 @@
     fi
   fi
 
-  # Only enable jvmci on x86_64, sparcv9 and aarch64, and only on server.
+  # Only enable jvmci on x86_64, sparcv9 and aarch64.
   if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
       test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
       test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
@@ -53383,7 +52889,7 @@
 
   # Enable features depending on variant.
   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
-  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES"
+  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
   JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"
   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
--- a/common/autoconf/hotspot.m4	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/autoconf/hotspot.m4	Fri Aug 05 13:37:53 2016 -0700
@@ -198,8 +198,8 @@
     AC_MSG_ERROR([Specified JVM feature 'management' requires feature 'nmt'])
   fi
 
-  if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! HOTSPOT_CHECK_JVM_FEATURE(compiler2); then
-    AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2'])
+  if HOTSPOT_CHECK_JVM_FEATURE(jvmci) && ! (HOTSPOT_CHECK_JVM_FEATURE(compiler1) || HOTSPOT_CHECK_JVM_FEATURE(compiler2)); then
+    AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
   fi
 
   if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
@@ -239,7 +239,7 @@
     fi
   fi
 
-  # Only enable jvmci on x86_64, sparcv9 and aarch64, and only on server.
+  # Only enable jvmci on x86_64, sparcv9 and aarch64.
   if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
       test "x$OPENJDK_TARGET_CPU" = "xsparcv9" || \
       test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
@@ -253,7 +253,7 @@
 
   # Enable features depending on variant.
   JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
-  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES"
+  JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
   JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
   JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES"
   JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
--- a/common/autoconf/spec.gmk.in	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/autoconf/spec.gmk.in	Fri Aug 05 13:37:53 2016 -0700
@@ -391,8 +391,6 @@
 WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
 
 CFLAGS_CCACHE:=@CFLAGS_CCACHE@
-NO_NULL_POINTER_CHECK_FLAG=@NO_NULL_POINTER_CHECK_CFLAG@
-NO_LIFETIME_DSE_CFLAG=@NO_LIFETIME_DSE_CFLAG@
 CXXSTD_CXXFLAG=@CXXSTD_CXXFLAG@
 
 # Tools that potentially need to be cross compilation aware.
--- a/common/autoconf/toolchain.m4	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/autoconf/toolchain.m4	Fri Aug 05 13:37:53 2016 -0700
@@ -54,7 +54,7 @@
 TOOLCHAIN_MINIMUM_VERSION_clang="3.2"
 TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
 TOOLCHAIN_MINIMUM_VERSION_microsoft=""
-TOOLCHAIN_MINIMUM_VERSION_solstudio="5.12"
+TOOLCHAIN_MINIMUM_VERSION_solstudio="5.13"
 TOOLCHAIN_MINIMUM_VERSION_xlc=""
 
 # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
@@ -312,8 +312,12 @@
 # Restore path, etc
 AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
 [
-  # Restore old path.
-  PATH="$OLD_PATH"
+  # Restore old path, except for the microsoft toolchain, which requires VS_PATH
+  # to remain in place. Otherwise the compiler will not work in some siutations
+  # in later configure checks.
+  if test "x$TOOLCHAIN_TYPE" != "xmicrosoft"; then
+    PATH="$OLD_PATH"
+  fi
 
   # Restore the flags to the user specified values.
   # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
@@ -831,6 +835,8 @@
     BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
     BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
     BUILD_AR="$AR"
+    
+    TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS([], [OPENJDK_BUILD_])
   fi
 
   AC_SUBST(BUILD_CC)
--- a/common/bin/hgforest.sh	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/bin/hgforest.sh	Fri Aug 05 13:37:53 2016 -0700
@@ -335,7 +335,10 @@
     for j in ${repos_extra} ; do
       if [ "${i}" = "${j}" ] ; then
         # it's an "extra"
-        pull_base="${pull_extra}"
+        if [ -n "${pull_extra}" ]; then
+          # if no pull_extra is defined, assume that pull_default is valid
+          pull_base="${pull_extra}"
+        fi
       fi
     done
 
--- a/common/conf/jib-profiles.js	Fri Aug 05 16:23:44 2016 +0300
+++ b/common/conf/jib-profiles.js	Fri Aug 05 13:37:53 2016 -0700
@@ -357,6 +357,18 @@
     var boot_jdk_platform = input.build_os + "-"
         + (input.build_cpu == "x86" ? "i586" : input.build_cpu);
 
+    var boot_jdk_revision = "8";
+    var boot_jdk_subdirpart = "1.8.0";
+    // JDK 8 does not work on sparc M7 cpus, need a newer update when building
+    // on such hardware.
+    if (input.build_cpu == "sparcv9") {
+       var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
+       if (cpu_brand.trim() == 'SPARC-M7') {
+           boot_jdk_revision = "8u20";
+           boot_jdk_subdirpart = "1.8.0_20";
+       }
+    }
+
     var devkit_platform_revisions = {
         linux_x64: "gcc4.9.2-OEL6.4+1.0",
         macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
@@ -374,12 +386,12 @@
         boot_jdk: {
             server: "javare",
             module: "jdk",
-            revision: "8",
+            revision: boot_jdk_revision,
             checksum_file: boot_jdk_platform + "/MD5_VALUES",
-            file: boot_jdk_platform + "/jdk-8-" + boot_jdk_platform + ".tar.gz",
+            file: boot_jdk_platform + "/jdk-" + boot_jdk_revision + "-" + boot_jdk_platform + ".tar.gz",
             configure_args: (input.build_os == "macosx"
-                ? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0.jdk/Contents/Home"
-                : "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk1.8.0")
+                ? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart + ".jdk/Contents/Home"
+                : "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart)
         },
 
         devkit: {
--- a/corba/.hgtags	Fri Aug 05 16:23:44 2016 +0300
+++ b/corba/.hgtags	Fri Aug 05 13:37:53 2016 -0700
@@ -372,3 +372,4 @@
 8fab452b6f4710762ba1d8e55fd62db00b1355fe jdk-9+127
 1f093d3f8cd99cd37c3b0af4cf5c3bffaa9c8b98 jdk-9+128
 c3e83ccab3bb1733ae903d681879a33f85ed465c jdk-9+129
+77f9692d5976ae155773dd3e07533616bb95bae1 jdk-9+130
--- a/hotspot/.hgtags	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/.hgtags	Fri Aug 05 13:37:53 2016 -0700
@@ -532,3 +532,4 @@
 352357128f602dcf0426b1cbe011a4685a4d9f97 jdk-9+127
 22bf6db9767b1b3a1994cbf32eb3331f31ae2093 jdk-9+128
 e96b34b76d863ed1fa04e0eeb3f297ac17b490fd jdk-9+129
+7d54c7056328b6a2bf4877458b8f4d8cd870f93b jdk-9+130
--- a/hotspot/make/test/JtregNative.gmk	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/make/test/JtregNative.gmk	Fri Aug 05 13:37:53 2016 -0700
@@ -50,7 +50,6 @@
     $(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \
     $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \
     $(HOTSPOT_TOPDIR)/test/compiler/calls \
-    $(HOTSPOT_TOPDIR)/test/compiler/native \
     $(HOTSPOT_TOPDIR)/test/serviceability/jvmti/GetNamedModule \
     $(HOTSPOT_TOPDIR)/test/testlibrary/jvmti \
     $(HOTSPOT_TOPDIR)/test/compiler/jvmci/jdk.vm.ci.code.test \
--- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -110,17 +110,7 @@
     // Entry frame checks
     if (is_entry_frame()) {
       // an entry frame must have a valid fp.
-
-      if (!fp_safe) return false;
-
-      // Validate the JavaCallWrapper an entry frame must have
-
-      address jcw = (address)entry_frame_call_wrapper();
-
-      bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > fp);
-
-      return jcw_safe;
-
+      return fp_safe && is_entry_frame_valid(thread);
     }
 
     intptr_t* sender_sp = NULL;
@@ -210,15 +200,8 @@
       }
 
       // construct the potential sender
-
       frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
-
-      // Validate the JavaCallWrapper an entry frame must have
-      address jcw = (address)sender.entry_frame_call_wrapper();
-
-      bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > (address)sender.fp());
-
-      return jcw_safe;
+      return sender.is_entry_frame_valid(thread);
     }
 
     CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -225,19 +225,7 @@
     // Entry frame checks
     if (is_entry_frame()) {
       // an entry frame must have a valid fp.
-
-      if (!fp_safe) {
-        return false;
-      }
-
-      // Validate the JavaCallWrapper an entry frame must have
-
-      address jcw = (address)entry_frame_call_wrapper();
-
-      bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > _FP);
-
-      return jcw_safe;
-
+      return fp_safe && is_entry_frame_valid(thread);
     }
 
     intptr_t* younger_sp = sp();
@@ -290,14 +278,8 @@
       return false;
     }
 
-    if( sender.is_entry_frame()) {
-      // Validate the JavaCallWrapper an entry frame must have
-
-      address jcw = (address)sender.entry_frame_call_wrapper();
-
-      bool jcw_safe = (jcw <= thread->stack_base()) && ( jcw > sender_fp);
-
-      return jcw_safe;
+    if (sender.is_entry_frame()) {
+      return sender.is_entry_frame_valid(thread);
     }
 
     // If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
--- a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,9 @@
 // make sure the defines don't screw up the declarations later on in this file
 #define DONT_USE_REGISTER_DEFINES
 
-#include "precompiled.hpp"
+// Note: precompiled headers can not be used in this file because of the above
+//       definition
+
 #include "asm/assembler.hpp"
 #include "asm/register.hpp"
 #include "interp_masm_sparc.hpp"
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -108,17 +108,7 @@
     // Entry frame checks
     if (is_entry_frame()) {
       // an entry frame must have a valid fp.
-
-      if (!fp_safe) return false;
-
-      // Validate the JavaCallWrapper an entry frame must have
-
-      address jcw = (address)entry_frame_call_wrapper();
-
-      bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > fp);
-
-      return jcw_safe;
-
+      return fp_safe && is_entry_frame_valid(thread);
     }
 
     intptr_t* sender_sp = NULL;
@@ -209,15 +199,8 @@
       }
 
       // construct the potential sender
-
       frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
-
-      // Validate the JavaCallWrapper an entry frame must have
-      address jcw = (address)sender.entry_frame_call_wrapper();
-
-      bool jcw_safe = (jcw < thread->stack_base()) && ( jcw > (address)sender.fp());
-
-      return jcw_safe;
+      return sender.is_entry_frame_valid(thread);
     }
 
     CompiledMethod* nm = sender_blob->as_compiled_method_or_null();
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodCounters.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodCounters.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -1173,7 +1173,7 @@
   if (class_loader() == NULL) {
     out->print("NULL class_loader");
   } else {
-    out->print("class loader " INTPTR_FORMAT, p2i(this));
+    out->print("class loader " INTPTR_FORMAT " ", p2i(this));
     class_loader()->print_value_on(out);
   }
 }
--- a/hotspot/src/share/vm/gc/g1/g1Analytics.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/gc/g1/g1Analytics.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -316,8 +316,12 @@
   return get_new_size_prediction(_pending_cards_seq);
 }
 
+double G1Analytics::oldest_known_gc_end_time_sec() const {
+  return _recent_prev_end_times_for_all_gcs_sec->oldest();
+}
+
 double G1Analytics::last_known_gc_end_time_sec() const {
-  return _recent_prev_end_times_for_all_gcs_sec->oldest();
+  return _recent_prev_end_times_for_all_gcs_sec->last();
 }
 
 void G1Analytics::update_recent_gc_times(double end_time_sec,
--- a/hotspot/src/share/vm/gc/g1/g1Analytics.hpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/gc/g1/g1Analytics.hpp	Fri Aug 05 13:37:53 2016 -0700
@@ -155,6 +155,7 @@
   void update_recent_gc_times(double end_time_sec, double elapsed_ms);
   void compute_pause_time_ratio(double interval_ms, double pause_time_ms);
 
+  double oldest_known_gc_end_time_sec() const;
   double last_known_gc_end_time_sec() const;
 };
 
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -28,6 +28,7 @@
 #include "classfile/symbolTable.hpp"
 #include "code/codeCache.hpp"
 #include "code/icBuffer.hpp"
+#include "gc/g1/g1Analytics.hpp"
 #include "gc/g1/bufferingOopClosure.hpp"
 #include "gc/g1/concurrentG1Refine.hpp"
 #include "gc/g1/concurrentG1RefineThread.hpp"
@@ -2473,8 +2474,19 @@
 }
 
 jlong G1CollectedHeap::millis_since_last_gc() {
-  // assert(false, "NYI");
-  return 0;
+  jlong now = os::elapsed_counter() / NANOSECS_PER_MILLISEC;
+  const G1Analytics* analytics = _g1_policy->analytics();
+  double last = analytics->last_known_gc_end_time_sec();
+  jlong ret_val = now - (last * 1000);
+  if (ret_val < 0) {
+    // See the notes in GenCollectedHeap::millis_since_last_gc()
+    // for more information about the implementation.
+    log_warning(gc)("Detected clock going backwards. "
+      "Milliseconds since last GC would be " JLONG_FORMAT
+      ". returning zero instead.", ret_val);
+    return 0;
+  }
+  return ret_val;
 }
 
 void G1CollectedHeap::prepare_for_verify() {
--- a/hotspot/src/share/vm/gc/g1/g1DefaultPolicy.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/gc/g1/g1DefaultPolicy.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -604,7 +604,7 @@
     _analytics->report_alloc_rate_ms(alloc_rate_ms);
 
     double interval_ms =
-      (end_time_sec - _analytics->last_known_gc_end_time_sec()) * 1000.0;
+      (end_time_sec - _analytics->oldest_known_gc_end_time_sec()) * 1000.0;
     _analytics->update_recent_gc_times(end_time_sec, pause_time_ms);
     _analytics->compute_pause_time_ratio(interval_ms, pause_time_ms);
   }
--- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -1256,21 +1256,21 @@
 };
 
 jlong GenCollectedHeap::millis_since_last_gc() {
-  // We need a monotonically non-decreasing time in ms but
-  // os::javaTimeMillis() does not guarantee monotonicity.
+  // javaTimeNanos() is guaranteed to be monotonically non-decreasing
+  // provided the underlying platform provides such a time source
+  // (and it is bug free). So we still have to guard against getting
+  // back a time later than 'now'.
   jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
   GenTimeOfLastGCClosure tolgc_cl(now);
   // iterate over generations getting the oldest
   // time that a generation was collected
   generation_iterate(&tolgc_cl, false);
 
-  // javaTimeNanos() is guaranteed to be monotonically non-decreasing
-  // provided the underlying platform provides such a time source
-  // (and it is bug free). So we still have to guard against getting
-  // back a time later than 'now'.
   jlong retVal = now - tolgc_cl.time();
   if (retVal < 0) {
-    NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, retVal);)
+    log_warning(gc)("Detected clock going backwards. "
+      "Milliseconds since last GC would be " JLONG_FORMAT
+      ". returning zero instead.", retVal);
     return 0;
   }
   return retVal;
--- a/hotspot/src/share/vm/oops/methodCounters.hpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/oops/methodCounters.hpp	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/hotspot/src/share/vm/prims/whitebox.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/prims/whitebox.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -350,6 +350,11 @@
   return (jlong)alignment;
 WB_END
 
+WB_ENTRY(jlong, WB_GetHeapAlignment(JNIEnv* env, jobject o))
+  size_t alignment = Universe::heap()->collector_policy()->heap_alignment();
+  return (jlong)alignment;
+WB_END
+
 #if INCLUDE_ALL_GCS
 WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj))
   G1CollectedHeap* g1 = G1CollectedHeap::heap();
@@ -401,14 +406,21 @@
 WB_END
 
 WB_ENTRY(jlong, WB_PSVirtualSpaceAlignment(JNIEnv* env, jobject o))
-  ParallelScavengeHeap* ps = ParallelScavengeHeap::heap();
-  size_t alignment = ps->gens()->virtual_spaces()->alignment();
-  return (jlong)alignment;
+#if INCLUDE_ALL_GCS
+  if (UseParallelGC) {
+    return ParallelScavengeHeap::heap()->gens()->virtual_spaces()->alignment();
+  }
+#endif // INCLUDE_ALL_GCS
+  THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "WB_PSVirtualSpaceAlignment: Parallel GC is not enabled");
 WB_END
 
 WB_ENTRY(jlong, WB_PSHeapGenerationAlignment(JNIEnv* env, jobject o))
-  size_t alignment = ParallelScavengeHeap::heap()->generation_alignment();
-  return (jlong)alignment;
+#if INCLUDE_ALL_GCS
+  if (UseParallelGC) {
+    return ParallelScavengeHeap::heap()->generation_alignment();
+  }
+#endif // INCLUDE_ALL_GCS
+  THROW_MSG_0(vmSymbols::java_lang_RuntimeException(), "WB_PSHeapGenerationAlignment: Parallel GC is not enabled");
 WB_END
 
 WB_ENTRY(jobject, WB_G1AuxiliaryMemoryUsage(JNIEnv* env))
@@ -1694,6 +1706,7 @@
   {CC"getVMAllocationGranularity",       CC"()J",                   (void*)&WB_GetVMAllocationGranularity },
   {CC"getVMLargePageSize",               CC"()J",                   (void*)&WB_GetVMLargePageSize},
   {CC"getHeapSpaceAlignment",            CC"()J",                   (void*)&WB_GetHeapSpaceAlignment},
+  {CC"getHeapAlignment",                 CC"()J",                   (void*)&WB_GetHeapAlignment},
   {CC"isClassAlive0",                    CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
   {CC"parseCommandLine0",
       CC"(Ljava/lang/String;C[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
--- a/hotspot/src/share/vm/runtime/frame.cpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Fri Aug 05 13:37:53 2016 -0700
@@ -225,6 +225,19 @@
   return NULL;
 }
 
+bool frame::is_entry_frame_valid(JavaThread* thread) const {
+  // Validate the JavaCallWrapper an entry frame must have
+  address jcw = (address)entry_frame_call_wrapper();
+  bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)fp()); // less than stack base
+  if (!jcw_safe) {
+    return false;
+  }
+
+  // Validate sp saved in the java frame anchor
+  JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor();
+  return (jfa->last_Java_sp() > sp());
+}
+
 bool frame::should_be_deoptimized() const {
   if (_deopt_state == is_deoptimized ||
       !is_compiled_frame() ) return false;
--- a/hotspot/src/share/vm/runtime/frame.hpp	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Fri Aug 05 13:37:53 2016 -0700
@@ -166,6 +166,8 @@
   frame sender_for_interpreter_frame(RegisterMap* map) const;
   frame sender_for_native_frame(RegisterMap* map) const;
 
+  bool is_entry_frame_valid(JavaThread* thread) const;
+
   // All frames:
 
   // A low-level interface for vframes:
--- a/hotspot/test/Makefile	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/Makefile	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -226,6 +226,9 @@
 ( \
   jtregExitCode=$$? && \
   _summary="$(SUMMARY_TXT)"; \
+  if [ $${jtregExitCode} = 1 ] ; then \
+    jtregExitCode=0; \
+  fi; \
   $(RM) -f $(STATS_TXT) $(RUNLIST) $(PASSLIST) $(FAILLIST) $(EXITCODE); \
   $(ECHO) "$${jtregExitCode}" > $(EXITCODE); \
   if [ -r "$${_summary}" ] ; then \
--- a/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/compiler/codecache/stress/RandomAllocationTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test RandomAllocationTest
+ * @key stress
  * @summary stressing code cache by allocating randomly sized "dummy" code blobs
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
--- a/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/compiler/codecache/stress/UnexpectedDeoptimizationTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -24,6 +24,7 @@
 
 /*
  * @test UnexpectedDeoptimizationTest
+ * @key stress
  * @summary stressing code cache by forcing unexpected deoptimizations
  * @library /testlibrary /test/lib /
  * @modules java.base/jdk.internal.misc
--- a/hotspot/test/compiler/codegen/aes/TestAESMain.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/compiler/codegen/aes/TestAESMain.java	Fri Aug 05 13:37:53 2016 -0700
@@ -25,6 +25,7 @@
 /**
  * @test
  * @bug 7184394
+ * @key stress
  * @summary add intrinsics to use AES instructions
  * @library /testlibrary /
  * @modules java.base/jdk.internal.misc
--- a/hotspot/test/compiler/floatingpoint/ModNaN.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/compiler/floatingpoint/ModNaN.java	Fri Aug 05 13:37:53 2016 -0700
@@ -26,7 +26,6 @@
  * @bug 8015396
  * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X)
  *
- * @ignore 8145543
  * @run main compiler.floatingpoint.ModNaN
  */
 
--- a/hotspot/test/gc/arguments/TestNewSizeFlags.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/gc/arguments/TestNewSizeFlags.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,13 +60,13 @@
 
         // Test NewSize and MaxNewSize
         testNewSizeFlags(20 * M, 10 * M, 30 * M, 40 * M, options, false);
-        testNewSizeFlags(10 * M, 20 * M, 30 * M, 40 * M, options, false);
+        testNewSizeFlags(10 * M, 20 * M, 30 * M, 80 * M, options, false);
         testNewSizeFlags(-1, 20 * M, 30 * M, 40 * M, options, false);
         testNewSizeFlags(10 * M, -1, 30 * M, 40 * M, options, false);
         testNewSizeFlags(20 * M, 20 * M, 30 * M, 40 * M, options, false);
         testNewSizeFlags(20 * M, 30 * M, 40 * M, 50 * M, options, false);
         testNewSizeFlags(30 * M, 100 * M, 150 * M, 200 * M, options, false);
-        testNewSizeFlags(0, -1, 30 * M, 40 * M, options, false);
+        testNewSizeFlags(20 * M, 30 * M, 128 * M, 128 * M, options, false);
 
         // Test -Xmn
         testXmnFlags(0, 30 * M, 40 * M, options, true);
@@ -88,9 +88,11 @@
             long heapSize, long maxHeapSize,
             LinkedList<String> options,
             boolean failureExpected) throws Exception {
+        long expectedNewSize = newSize;
+        long expectedMaxNewSize = (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize);
         testVMOptions(newSize, maxNewSize,
                 heapSize, maxHeapSize,
-                newSize, (maxNewSize >= 0 ? Math.max(maxNewSize, newSize) : maxNewSize),
+                expectedNewSize, expectedMaxNewSize,
                 options, failureExpected);
     }
 
@@ -159,7 +161,9 @@
                 "-XX:-UseLargePages",
                 NewSizeVerifier.class.getName(),
                 Long.toString(expectedNewSize),
-                Long.toString(expectedMaxNewSize)
+                Long.toString(expectedMaxNewSize),
+                Long.toString(heapSize),
+                Long.toString(maxHeapSize)
         );
         vmOptions.removeIf(String::isEmpty);
         ProcessBuilder procBuilder = ProcessTools.createJavaProcessBuilder(vmOptions.toArray(new String[vmOptions.size()]));
@@ -177,7 +181,12 @@
      */
     public static class NewSizeVerifier {
 
-        static WhiteBox wb = WhiteBox.getWhiteBox();
+        private static final WhiteBox WB = WhiteBox.getWhiteBox();
+        private static final GCTypes.YoungGCType YOUNG_GC_TYPE = GCTypes.YoungGCType.getYoungGCType();
+        private static final long HEAP_SPACE_ALIGNMENT = WB.getHeapSpaceAlignment();
+        private static final long HEAP_ALIGNMENT = WB.getHeapAlignment();
+        private static final long PS_VIRTUAL_SPACE_ALIGNMENT =
+                (YOUNG_GC_TYPE == GCTypes.YoungGCType.PSNew) ? WB.psVirtualSpaceAlignment() : 0;
 
         public static final int ARRAY_LENGTH = 100;
         public static final int CHUNK_SIZE = 1024;
@@ -185,63 +194,79 @@
         public static byte garbage[][] = new byte[ARRAY_LENGTH][];
 
         public static void main(String args[]) throws Exception {
-            if (args.length != 2) {
-                throw new IllegalArgumentException("Expected 2 args: <expectedNewSize> <expectedMaxNewSize>");
+            if (args.length != 4) {
+                throw new IllegalArgumentException("Expected 4 args: <expectedNewSize> <expectedMaxNewSize> <initialHeapSize> <maxHeapSize>");
             }
             final long newSize = Long.valueOf(args[0]);
             final long maxNewSize = Long.valueOf(args[1]);
+            final long initialHeapSize = Long.valueOf(args[2]);
+            final long maxHeapSize = Long.valueOf(args[3]);
 
             // verify initial size
-            verifyNewSize(newSize, maxNewSize);
+            verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize);
 
             // force GC and verify that size is still correct
-            AllocationHelper allocator = new AllocationHelper(MAX_ITERATIONS, ARRAY_LENGTH, CHUNK_SIZE, () -> (verifyNewSize(newSize, maxNewSize)));
+            AllocationHelper allocator = new AllocationHelper(MAX_ITERATIONS, ARRAY_LENGTH, CHUNK_SIZE, () -> (verifyNewSize(newSize, maxNewSize, initialHeapSize, maxHeapSize)));
             allocator.allocateMemoryAndVerifyNoOOME();
         }
 
         /**
          * Verify that actual young gen size conforms NewSize and MaxNewSize values.
          */
-        public static Void verifyNewSize(long newSize, long maxNewSize) {
-            long alignedNewSize = alignNewSize(newSize);
-            long alignedMaxNewSize = alignNewSize(maxNewSize);
+        public static Void verifyNewSize(long newSize, long maxNewSize,
+                long initialHeapSize, long maxHeapSize) {
+            long alignedNewSize = alignGenSize(newSize);
+            long alignedMaxNewSize = alignGenSize(maxNewSize);
+            long alignedXms = alignHeapSize(initialHeapSize);
+            long alignedXmx = alignHeapSize(maxHeapSize);
 
             MemoryUsage youngGenUsage = getYoungGenUsage();
+            long initSize = youngGenUsage.getInit();
+            long commitedSize = youngGenUsage.getCommitted();
+            long maxSize = youngGenUsage.getMax();
 
             if (newSize != -1) {
-                if (youngGenUsage.getInit() < alignedNewSize) {
+                if (initSize < alignedNewSize) {
                     throw new RuntimeException("initial new size < NewSize value: "
-                            + youngGenUsage.getInit() + " < " + alignedNewSize);
+                            + initSize + " < " + alignedNewSize);
                 }
 
-                if (youngGenUsage.getCommitted() < alignedNewSize) {
+                if (commitedSize < alignedNewSize) {
                     throw new RuntimeException("actual new size < NewSize value: "
-                            + youngGenUsage.getCommitted() + " < " + alignedNewSize);
+                            + commitedSize + " < " + alignedNewSize);
                 }
 
                 // for G1 max new size == committed new size
-                if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1
-                        && youngGenUsage.getMax() < alignedNewSize) {
+                if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
+                        && maxSize < alignedNewSize) {
                     throw new RuntimeException("max new size < NewSize value: "
-                            + youngGenUsage.getMax() + " < " + alignedNewSize);
+                            + maxSize + " < " + alignedNewSize);
                 }
             }
 
             if (maxNewSize != -1) {
-                if (youngGenUsage.getInit() > alignedMaxNewSize) {
+                if (initSize > alignedMaxNewSize) {
                     throw new RuntimeException("initial new size > MaxNewSize value: "
-                            + youngGenUsage.getInit() + " > " + alignedMaxNewSize);
+                            + initSize + " > " + alignedMaxNewSize);
                 }
 
-                if (youngGenUsage.getCommitted() > alignedMaxNewSize) {
+                if (commitedSize > alignedMaxNewSize) {
                     throw new RuntimeException("actual new size > MaxNewSize value: "
-                            + youngGenUsage.getCommitted() + " > " + alignedMaxNewSize);
+                            + commitedSize + " > " + alignedMaxNewSize);
                 }
 
-                if (GCTypes.YoungGCType.getYoungGCType() != GCTypes.YoungGCType.G1
-                        && youngGenUsage.getMax() != alignedMaxNewSize) {
-                    throw new RuntimeException("max new size != MaxNewSize value: "
-                            + youngGenUsage.getMax() + " != " + alignedMaxNewSize);
+                if (alignedXms != alignedXmx) {
+                    if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
+                            && maxSize != alignedMaxNewSize) {
+                        throw new RuntimeException("max new size != MaxNewSize value: "
+                                + maxSize + " != " + alignedMaxNewSize);
+                    }
+                } else {
+                    if (YOUNG_GC_TYPE != GCTypes.YoungGCType.G1
+                            && maxSize != alignedNewSize) {
+                        throw new RuntimeException("max new size != NewSize for case InitialHeapSize == MaxHeapSize value: "
+                                + maxSize + " != " + alignedNewSize + " HeapSize == " + alignedXms);
+                    }
                 }
             }
             return null;
@@ -256,41 +281,47 @@
          *  For all GCs used value is 0.
          */
         private static MemoryUsage getYoungGenUsage() {
-            if (GCTypes.YoungGCType.getYoungGCType() == GCTypes.YoungGCType.G1) {
-                return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit()
-                        + HeapRegionUsageTool.getSurvivorUsage().getInit(),
-                        0,
-                        HeapRegionUsageTool.getEdenUsage().getCommitted()
-                        + HeapRegionUsageTool.getSurvivorUsage().getCommitted(),
-                        Long.MAX_VALUE);
+            MemoryUsage edenUsage = HeapRegionUsageTool.getEdenUsage();
+            MemoryUsage survivorUsage = HeapRegionUsageTool.getSurvivorUsage();
+            long edenUsageInit = edenUsage.getInit();
+            long edenUsageCommited = edenUsage.getCommitted();
+            long survivorUsageInit = survivorUsage.getInit();
+            long survivorUsageCommited = survivorUsage.getCommitted();
+
+            if (YOUNG_GC_TYPE == GCTypes.YoungGCType.G1) {
+                return new MemoryUsage(edenUsageInit + survivorUsageInit, 0,
+                        edenUsageCommited + survivorUsageCommited, Long.MAX_VALUE);
             } else {
-                return new MemoryUsage(HeapRegionUsageTool.getEdenUsage().getInit()
-                        + HeapRegionUsageTool.getSurvivorUsage().getInit() * 2,
-                        0,
-                        HeapRegionUsageTool.getEdenUsage().getCommitted()
-                        + HeapRegionUsageTool.getSurvivorUsage().getCommitted() * 2,
-                        HeapRegionUsageTool.getEdenUsage().getMax()
-                        + HeapRegionUsageTool.getSurvivorUsage().getMax() * 2);
+                return new MemoryUsage(edenUsageInit + survivorUsageInit * 2, 0,
+                        edenUsageCommited + survivorUsageCommited * 2,
+                        edenUsage.getMax() + survivorUsage.getMax() * 2);
             }
         }
 
         /**
-         * Align value regardful to used young GC.
+         * Align generation size regardful to used young GC.
          */
-        public static long alignNewSize(long value) {
-            switch (GCTypes.YoungGCType.getYoungGCType()) {
+        public static long alignGenSize(long value) {
+            switch (YOUNG_GC_TYPE) {
                 case DefNew:
                 case ParNew:
-                    return HeapRegionUsageTool.alignDown(value, wb.getHeapSpaceAlignment());
+                    return HeapRegionUsageTool.alignDown(value, HEAP_SPACE_ALIGNMENT);
                 case PSNew:
                     return HeapRegionUsageTool.alignUp(HeapRegionUsageTool.alignDown(value,
-                            wb.getHeapSpaceAlignment()),
-                            wb.psVirtualSpaceAlignment());
+                            HEAP_SPACE_ALIGNMENT),
+                            PS_VIRTUAL_SPACE_ALIGNMENT);
                 case G1:
-                    return HeapRegionUsageTool.alignUp(value, wb.g1RegionSize());
+                    return HeapRegionUsageTool.alignUp(value, WB.g1RegionSize());
                 default:
                     throw new RuntimeException("Unexpected young GC type");
             }
         }
+
+        /**
+         * Align heap size.
+         */
+        public static long alignHeapSize(long value){
+            return HeapRegionUsageTool.alignUp(value,HEAP_ALIGNMENT);
+        }
     }
 }
--- a/hotspot/test/gc/g1/ihop/TestIHOPErgo.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/gc/g1/ihop/TestIHOPErgo.java	Fri Aug 05 13:37:53 2016 -0700
@@ -24,6 +24,7 @@
  /*
  * @test TestIHOPErgo
  * @bug 8148397
+ * @key stress
  * @summary Test checks that behavior of Adaptive and Static IHOP at concurrent cycle initiation
  * @requires vm.gc.G1
  * @requires !vm.flightRecorder
--- a/hotspot/test/runtime/8007320/ConstMethodTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/runtime/8007320/ConstMethodTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8007320 8014709
+ * @bug 8007320 8014709 8163231
  * @summary Test all optional fields in ConstMethod
  * @compile -g -parameters ConstMethodTest.java
  * @run main ConstMethodTest
@@ -122,8 +122,8 @@
                 equal(ann.length, 3);
                 Annotation foo = ann[0][0];
                 Annotation bar = ann[1][0];
-                equal(foo.toString(), "@Named(value=aName)");
-                equal(bar.toString(), "@Named(value=bName)");
+                equal(foo.toString(), "@Named(value=\"aName\")");
+                equal(bar.toString(), "@Named(value=\"bName\")");
                 check(foo.equals(foo));
                 check(bar.equals(bar));
                 check(! foo.equals(bar));
@@ -131,7 +131,7 @@
                 Annotation[] ann2 = m.getAnnotations();
                 equal(ann2.length, 1);
                 Annotation mann = ann2[0];
-                equal(mann.toString(), "@MyAnnotation(date=today, name=someName, value=Hello World)");
+                equal(mann.toString(), "@MyAnnotation(date=\"today\", name=\"someName\", value=\"Hello World\")");
                 // Test Method parameter names
                 Parameter[] parameters = m.getParameters();
                 if(parameters == null)
--- a/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/runtime/RedefineTests/RedefineAnnotations.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -370,7 +370,7 @@
     }
 
     private static void verifyTestAnnSite(Annotation testAnn, String expectedSite) {
-        String expectedAnn = "@TestAnn(site=" + expectedSite + ")";
+        String expectedAnn = "@TestAnn(site=\"" + expectedSite + "\")";
         assertTrue(testAnn.toString().equals(expectedAnn),
                    "Expected \"" + expectedAnn + "\", got \"" + testAnn + "\"");
     }
--- a/hotspot/test/runtime/StackGuardPages/exeinvoke.c	Fri Aug 05 16:23:44 2016 +0300
+++ b/hotspot/test/runtime/StackGuardPages/exeinvoke.c	Fri Aug 05 13:37:53 2016 -0700
@@ -242,7 +242,7 @@
       CLASS_PATH_OPT, javaclasspath);
 
   options[0].optionString = "-Xint";
-  options[1].optionString = "-Xss328k";
+  options[1].optionString = "-Xss1M";
   options[2].optionString = javaclasspathopt;
 
   vm_args.version = JNI_VERSION_1_2;
--- a/jaxp/.hgtags	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/.hgtags	Fri Aug 05 13:37:53 2016 -0700
@@ -372,3 +372,4 @@
 bdc3c0b737efbf899709eb3121ce760dcfb51151 jdk-9+127
 8a7681a9d70640ac7fbf05c28f53c1d51d8d00a1 jdk-9+128
 74241304e87b0d463391a8ecab40979b5af86dc2 jdk-9+129
+e66cdc2de6b02443911d386fc9217b0d824d0686 jdk-9+130
--- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/XPathFactory.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -93,14 +93,14 @@
     public static XPathFactory newInstance() {
 
         try {
-                return newInstance(DEFAULT_OBJECT_MODEL_URI);
-        } catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
-                throw new RuntimeException(
-                        "XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
-                        + DEFAULT_OBJECT_MODEL_URI
-                        + " with the XPathFactoryConfigurationException: "
-                        + xpathFactoryConfigurationException.toString()
-                );
+            return newInstance(DEFAULT_OBJECT_MODEL_URI);
+        } catch (XPathFactoryConfigurationException e) {
+            throw new RuntimeException(
+                    "XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
+                    + DEFAULT_OBJECT_MODEL_URI
+                    + " with the XPathFactoryConfigurationException: "
+                    + e.getMessage(), e
+            );
         }
     }
 
--- a/jaxp/test/ProblemList.txt	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/ProblemList.txt	Fri Aug 05 13:37:53 2016 -0700
@@ -27,4 +27,4 @@
 
 javax/xml/jaxp/unittest/common/TransformationWarningsTest.java	8150145 generic-all
 
-javax/xml/jaxp/unittest/stream/FactoryFindTest.java             8156508 generic-all
+javax/xml/jaxp/unittest/common/ValidationWarningsTest.java      8150145 generic-all
--- a/jaxp/test/TEST.ROOT	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/TEST.ROOT	Fri Aug 05 13:37:53 2016 -0700
@@ -14,6 +14,11 @@
 # Tests that must run in othervm mode
 othervm.dirs=javax/xml/jaxp
 
+lib.dirs = /javax/xml/jaxp/libs
+
+# Declare module dependency
+modules=java.xml
+
 # Group definitions
 groups=TEST.groups
 
--- a/jaxp/test/javax/xml/jaxp/functional/TEST.properties	Fri Aug 05 16:23:44 2016 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-# This file identifies root(s) of the test-ng hierarchy.
-
-TestNG.dirs = .
-
-lib.dirs = /javax/xml/jaxp/libs
-
-# Tests that must run in othervm mode
-othervm.dirs= /javax/xml/jaxp/functional
-
-# Declare module dependency
-modules=java.xml
-
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/CatalogReferCircularityTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/CatalogReferCircularityTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,17 +28,21 @@
 import javax.xml.catalog.CatalogException;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.CatalogReferCircularityTest
+ * @run testng/othervm catalog.CatalogReferCircularityTest
  * @summary Via nextCatalog entry, the catalog reference chain may be
  *          a (partial) closed circuit. For instance, a catalog may use itself
  *          as an additional catalog specified in its own nextCatalog entry.
  *          This case tests if the implementation handles this issue.
- * @compile ../../libs/catalog/CatalogTestUtils.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class CatalogReferCircularityTest {
 
     @Test(dataProvider = "catalogName",
@@ -49,7 +53,7 @@
     }
 
     @DataProvider(name = "catalogName")
-    private Object[][] catalogName() {
+    public Object[][] catalogName() {
         return new Object[][] {
                 // This catalog defines itself as next catalog.
                 { "catalogReferCircle-itself.xml" },
@@ -60,3 +64,4 @@
                 { "catalogReferCircle-left.xml" } };
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DefaultFeaturesTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DefaultFeaturesTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 @@
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.DefaultFeaturesTest
+ * @run testng/othervm catalog.DefaultFeaturesTest
  * @summary This case tests if the default feature values are expected.
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class DefaultFeaturesTest {
 
     private CatalogFeatures defaultFeature;
@@ -56,7 +61,7 @@
     }
 
     @DataProvider(name = "feature-value")
-    private Object[][] data() {
+    public Object[][] data() {
         return new Object[][] {
                 { Feature.FILES, null },
                 { Feature.PREFER, CatalogTestUtils.PREFER_PUBLIC },
@@ -64,3 +69,4 @@
                 { Feature.RESOLVE, CatalogTestUtils.RESOLVE_STRICT } };
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,6 +28,8 @@
 import static catalog.CatalogTestUtils.getCatalogPath;
 import static javax.xml.catalog.CatalogFeatures.Feature.DEFER;
 import static javax.xml.catalog.CatalogManager.catalog;
+import static jaxp.library.JAXPTestUtilities.runWithAllPerm;
+import static jaxp.library.JAXPTestUtilities.tryRunWithAllPerm;
 
 import java.lang.reflect.Method;
 
@@ -36,16 +38,20 @@
 
 import org.testng.Assert;
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.DeferFeatureTest
+ * @run testng/othervm catalog.DeferFeatureTest
  * @summary This case tests whether the catalogs specified in delegateSystem,
  *          delegatePublic, delegateURI and nextCatalog entries are used lazily
  *          in resolution via defer feature.
- * @compile ../../libs/catalog/CatalogTestUtils.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class DeferFeatureTest {
 
     @Test(dataProvider = "catalog-countOfLoadedCatalogFile")
@@ -55,7 +61,7 @@
     }
 
     @DataProvider(name = "catalog-countOfLoadedCatalogFile")
-    private Object[][] data() {
+    public Object[][] data() {
         return new Object[][]{
             // By default, alternative catalogs are not loaded.
             {createCatalog(CatalogFeatures.defaults()), 0},
@@ -75,9 +81,9 @@
     }
 
     private int loadedCatalogCount(Catalog catalog) throws Exception {
-        Method method = catalog.getClass().getDeclaredMethod(
-                "loadedCatalogCount");
-        method.setAccessible(true);
+        Method method = tryRunWithAllPerm(() -> catalog.getClass().getDeclaredMethod("loadedCatalogCount"));
+        runWithAllPerm(() -> method.setAccessible(true));
         return (int) method.invoke(catalog);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DelegatePublicTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DelegatePublicTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.DelegatePublicTest
+ * @run testng/othervm catalog.DelegatePublicTest
  * @summary Get matched URIs from DelegatePublic entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class DelegatePublicTest {
 
     @Test(dataProvider = "publicId-matchedUri")
@@ -48,7 +51,7 @@
     }
 
     @DataProvider(name = "publicId-matchedUri")
-    private Object[][] dataOnMatch() {
+    public Object[][] dataOnMatch() {
         return new Object[][] {
                 // The matched URI of the specified public id is defined in
                 // a delegate catalog file of the current catalog file.
@@ -79,7 +82,7 @@
     }
 
     @DataProvider(name = "publicId-expectedExceptionClass")
-    private Object[][] dataOnException() {
+    public Object[][] dataOnException() {
         return new Object[][] {
                 // The matched delegatePublic entry of the specified public id
                 // defines a non-existing delegate catalog file. That should
@@ -97,3 +100,4 @@
         return catalogResolver("delegatePublic.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DelegateSystemTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DelegateSystemTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.DelegateSystemTest
+ * @run testng/othervm catalog.DelegateSystemTest
  * @summary Get matched URIs from delegateSystem entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class DelegateSystemTest {
 
     @Test(dataProvider = "systemId-matchedUri")
@@ -48,7 +51,7 @@
     }
 
     @DataProvider(name = "systemId-matchedUri")
-    private Object[][] dataOnMatch() {
+    public Object[][] dataOnMatch() {
         return new Object[][] {
                 // The matched URI of the specified system id is defined in
                 // a delegate catalog file of the current catalog file.
@@ -79,7 +82,7 @@
     }
 
     @DataProvider(name = "systemId-expectedExceptionClass")
-    private Object[][] dataOnException() {
+    public Object[][] dataOnException() {
         return new Object[][] {
                 // The matched delegateSystem entry of the specified system id
                 // defines a non-existing delegate catalog file. That should
@@ -97,3 +100,4 @@
         return catalogResolver("delegateSystem.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DelegateUriTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DelegateUriTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.DelegateUriTest
+ * @run testng/othervm catalog.DelegateUriTest
  * @summary Get matched URIs from delegateURI entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class DelegateUriTest {
 
     @Test(dataProvider = "uri-matchedUri")
@@ -48,7 +51,7 @@
     }
 
     @DataProvider(name = "uri-matchedUri")
-    private Object[][] data() {
+    public Object[][] data() {
         return new Object[][] {
                 // The matched URI of the specified URI reference is defined in
                 // a delegate catalog file of the current catalog file.
@@ -78,7 +81,7 @@
     }
 
     @DataProvider(name = "uri-expectedExceptionClass")
-    private Object[][] dataOnException() {
+    public Object[][] dataOnException() {
         return new Object[][] {
                 // The matched delegateURI entry of the specified URI reference
                 // defines a non-existing delegate catalog file. That should
@@ -96,3 +99,4 @@
         return catalogUriResolver("delegateUri.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/GroupTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/GroupTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,16 +32,19 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.GroupTest
+ * @run testng/othervm catalog.GroupTest
  * @summary Get matched URIs from system, public and uri entries respectively,
  *          and some of the entries are enclosed by group entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class GroupTest {
 
     private static final String CATALOG_GROUP = "group.xml";
@@ -52,7 +55,7 @@
     }
 
     @DataProvider(name = "systemId-matchedUri")
-    private Object[][] dataOnSysId() {
+    public Object[][] dataOnSysId() {
         return new Object[][] {
                 // The matched URI of the specified system id is enclosed by a
                 // group entry.
@@ -78,7 +81,7 @@
     }
 
     @DataProvider(name = "publicId-matchedUri")
-    private Object[][] dataOnPubId() {
+    public Object[][] dataOnPubId() {
         return new Object[][] {
                 // The matched URI of the specified public id is enclosed by a
                 // group entry.
@@ -104,7 +107,7 @@
     }
 
     @DataProvider(name = "uri-matchedUri")
-    private Object[][] dataOnUri() {
+    public Object[][] dataOnUri() {
         return new Object[][] {
                 // The matched URI of the specified URI reference is enclosed by
                 // a group entry.
@@ -128,3 +131,4 @@
         return catalogResolver(CATALOG_GROUP);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/LoadCatalogTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/LoadCatalogTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,17 +36,20 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.LoadCatalogTest
+ * @run testng/othervm catalog.LoadCatalogTest
  * @summary When catalog resolver loads catalog files, the current catalog file
  *          and the catalog files specified by the nextCatalog entries may not
  *          accessible. This case tests how does the resolver handle this issue.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class LoadCatalogTest {
 
     private static final String CATALOG_LOADCATALOGFILES = "loadCatalogFiles.xml";
@@ -62,7 +65,7 @@
     }
 
     @DataProvider(name = "entityResolver")
-    private Object[][] entityResolver() {
+    public Object[][] entityResolver() {
         return new Object[][] {
                 // This EntityResolver loads multiple catalog files one by one.
                 // All of the files are available.
@@ -82,7 +85,7 @@
     }
 
     @DataProvider(name = "uriResolver")
-    private Object[][] uriResolver() {
+    public Object[][] uriResolver() {
         return new Object[][] {
                 // This URIResolver loads multiple catalog files one by one.
                 // All of the files are available.
@@ -108,7 +111,7 @@
     }
 
     @DataProvider(name = "catalogName")
-    private Object[][] catalogName() {
+    public Object[][] catalogName() {
         return new Object[][] {
                 // This catalog file set includes null catalog files.
                 { (String[]) null },
@@ -118,3 +121,4 @@
                 { new String[] { CATALOG_LOADCATALOGFILES } } };
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/NextCatalogTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/NextCatalogTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,16 +33,19 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.NextCatalogTest
+ * @run testng/othervm catalog.NextCatalogTest
  * @summary Get matched URIs from system, public and uri entries respectively,
  *          but some of the entries are defined in none-current catalog files.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class NextCatalogTest {
 
     private static final String CATALOG_NEXTCATALOGLEFT
@@ -56,7 +59,7 @@
     }
 
     @DataProvider(name = "systemId-matchedUri")
-    private Object[][] dataOnSysId() {
+    public Object[][] dataOnSysId() {
         return new Object[][] {
                 // This matched URI of the specified system id is defined in a
                 // next catalog file.
@@ -88,7 +91,7 @@
     }
 
     @DataProvider(name = "publicId-matchedUri")
-    private Object[][] dataOnPubId() {
+    public Object[][] dataOnPubId() {
         return new Object[][] {
                 // This matched URI of the specified public id is defined in a
                 // next catalog file.
@@ -120,7 +123,7 @@
     }
 
     @DataProvider(name = "uri-matchedUri")
-    private Object[][] dataOnUri() {
+    public Object[][] dataOnUri() {
         return new Object[][] {
                 // This matched URI of the specified URI reference is defined in
                 // a next catalog file.
@@ -156,3 +159,4 @@
                 CATALOG_NEXTCATALOGRIGHT);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/NormalizationTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/NormalizationTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +33,21 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.NormalizationTest
+ * @run testng/othervm catalog.NormalizationTest
  * @summary Before matching identifiers and URI references, it has to normalize
  *          the passed identifiers and URI references. And then the catalog
  *          resolver uses the normalized stuff to search the counterparts in
  *          catalog files.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class NormalizationTest {
 
     private static final String CATALOG_NORMALIZATION = "normalization.xml";
@@ -65,7 +68,7 @@
     }
 
     @DataProvider(name = "systemId_uri-matchedUri")
-    private Object[][] dataOnSysIdAndUri() {
+    public Object[][] dataOnSysIdAndUri() {
         return new Object[][] {
                 // The specified system id/URI reference contains spaces. And
                 // the counterparts in system/uri entries also contain spaces.
@@ -87,7 +90,7 @@
     }
 
     @DataProvider(name = "publicId-matchedUri")
-    private Object[][] dataOnPubId() {
+    public Object[][] dataOnPubId() {
         return new Object[][] {
                 // The specified public id contains spaces. And the counterparts
                 // in public entry also contains spaces.
@@ -112,3 +115,4 @@
         return catalogUriResolver(CATALOG_NORMALIZATION);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/PreferFeatureTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/PreferFeatureTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,16 +33,20 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.PreferFeatureTest
+ * @run testng/othervm catalog.PreferFeatureTest
  * @summary This case tests how does the feature affect the catalog resolution,
  *          and tests the priority between this feature and attribute prefer
  *          in catalog file.
- * @compile ../../libs/catalog/CatalogTestUtils.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class PreferFeatureTest {
 
     @Test(dataProvider = "prefer-publicId-systemId",
@@ -53,7 +57,7 @@
     }
 
     @DataProvider(name = "prefer-publicId-systemId")
-    private Object[][] data() {
+    public Object[][] data() {
         return new Object[][] {
                 // The feature prefer is system. There's a match for the
                 // specified public id, and no match for the specified system id.
@@ -77,3 +81,4 @@
                 "preferFeature.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/PreferTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/PreferTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +29,21 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.PreferTest
+ * @run testng/othervm catalog.PreferTest
  * @summary Get matched URIs from system and public family entries, which
  *          specify the prefer attribute. It tests how does the prefer attribute
  *          affect the resolution procedure. The test rule is based on OASIS
  *          Standard V1.1 section 4.1.1. "The prefer attribute".
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class PreferTest {
 
     @Test(dataProvider = "publicId-systemId-matchedUri")
@@ -50,7 +53,7 @@
     }
 
     @DataProvider(name = "publicId-systemId-matchedUri")
-    private Object[][] data() {
+    public Object[][] data() {
         return new Object[][] {
                 // The prefer attribute is public. Both of the specified public
                 // id and system id have matches in the catalog file. But
@@ -89,3 +92,4 @@
         return catalogResolver("prefer.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/PublicFamilyTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/PublicFamilyTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +30,21 @@
 import javax.xml.catalog.CatalogException;
 import javax.xml.catalog.CatalogResolver;
 
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.PublicFamilyTest
+ * @run testng/othervm catalog.PublicFamilyTest
  * @summary Get matched URIs from public and delegatePublic entries.
  *          It tests the resolution priorities among the public family entries.
  *          The test rule is based on OASIS Standard V1.1 section 7.1.2.
  *          "Resolution of External Identifiers".
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class PublicFamilyTest {
 
     /*
@@ -67,3 +70,4 @@
         return catalogResolver("publicFamily.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/PublicTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/PublicTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,15 +32,18 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.PublicTest
+ * @run testng/othervm catalog.PublicTest
  * @summary Get matched URIs from public entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class PublicTest {
 
     @Test(dataProvider = "publicId-matchedUri")
@@ -89,3 +92,4 @@
         return catalogResolver(CATALOG_PUBLIC);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/ResolveFeatureTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/ResolveFeatureTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,16 +40,19 @@
 import javax.xml.catalog.CatalogResolver;
 import javax.xml.catalog.CatalogUriResolver;
 
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.ResolveFeatureTest
+ * @run testng/othervm catalog.ResolveFeatureTest
  * @summary This case tests how does resolve feature affect the catalog
  *          resolution.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class ResolveFeatureTest {
 
     /*
@@ -128,3 +131,4 @@
         return builder().with(Feature.RESOLVE, resolve).build();
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/RewriteSystemTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/RewriteSystemTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.RewriteSystemTest
+ * @run testng/othervm catalog.RewriteSystemTest
  * @summary Get matched URIs from rewriteSystem entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class RewriteSystemTest {
 
     @Test(dataProvider = "systemId-matchedUri")
@@ -92,3 +95,4 @@
         return catalogResolver("rewriteSystem.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/RewriteUriTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/RewriteUriTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.RewriteUriTest
+ * @run testng/othervm catalog.RewriteUriTest
  * @summary Get matched URIs from rewriteURI entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class RewriteUriTest {
 
     @Test(dataProvider = "uri-matchedUri")
@@ -92,3 +95,4 @@
         return catalogUriResolver("rewriteUri.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/SpecifyCatalogTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/SpecifyCatalogTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,8 @@
 
 package catalog;
 
+import static jaxp.library.JAXPTestUtilities.setSystemProperty;
+
 import static catalog.CatalogTestUtils.FEATURE_FILES;
 import static catalog.CatalogTestUtils.catalogResolver;
 import static catalog.CatalogTestUtils.catalogUriResolver;
@@ -36,15 +38,18 @@
 import javax.xml.catalog.CatalogResolver;
 import javax.xml.catalog.CatalogUriResolver;
 
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.SpecifyCatalogTest
+ * @run testng/othervm catalog.SpecifyCatalogTest
  * @summary This case tests how to specify the catalog files.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class SpecifyCatalogTest {
 
     private static final String ID_URI = "http://remote/dtd/uri/doc.dtd";
@@ -76,7 +81,7 @@
      */
     @Test
     public void specifyCatalogViaSysProps() {
-        System.setProperty(FEATURE_FILES,
+        setSystemProperty(FEATURE_FILES,
                 getCatalogPath("specifyCatalog-sysProps.xml"));
 
         checkResolutionOnEntityResolver(catalogResolver((String[]) null),
@@ -106,3 +111,4 @@
         return builder().with(FILES, getCatalogPath(catalogName)).build();
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/SystemFamilyTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/SystemFamilyTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +31,21 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.SystemFamilyTest
+ * @run testng/othervm catalog.SystemFamilyTest
  * @summary Get matched URIs from system, rewriteSystem, systemSuffix and
  *          delegateSystem entries. It tests the resolution priorities among
  *          the system family entries. The test rule is based on OASIS
  *          Standard V1.1 section 7.1.2. "Resolution of External Identifiers".
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class SystemFamilyTest {
 
     @Test(dataProvider = "systemId-matchedUri")
@@ -81,3 +84,4 @@
         return catalogResolver("systemFamily.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/SystemSuffixTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/SystemSuffixTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.SystemSuffixTest
+ * @run testng/othervm catalog.SystemSuffixTest
  * @summary Get matched URIs from systemSuffix entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class SystemSuffixTest {
 
     @Test(dataProvider = "systemId-matchedUri")
@@ -92,3 +95,4 @@
         return catalogResolver("systemSuffix.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/SystemTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/SystemTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,15 +32,18 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.SystemTest
+ * @run testng/othervm catalog.SystemTest
  * @summary Get matched URIs from system entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class SystemTest {
 
     @Test(dataProvider = "systemId-matchedUri")
@@ -89,3 +92,4 @@
         return catalogResolver(CATALOG_SYSTEM);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/UriFamilyTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/UriFamilyTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +31,21 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.UriFamilyTest
+ * @run testng/othervm catalog.UriFamilyTest
  * @summary Get matched URIs from uri, rewriteURI, uriSuffix and delegateURI
  *          entries. It tests the resolution priorities among the uri family
  *          entries. The test rule is based on OASIS Standard V1.1 section
  *          7.2.2. "Resolution of External Identifiers".
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class UriFamilyTest {
 
     @Test(dataProvider = "uri-matchedUri")
@@ -81,3 +84,4 @@
         return catalogUriResolver("uriFamily.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/UriSuffixTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/UriSuffixTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +31,18 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.UriSuffixTest
+ * @run testng/othervm catalog.UriSuffixTest
  * @summary Get matched URIs from rewriteURI entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class UriSuffixTest {
 
     @Test(dataProvider = "uri-matchedUri")
@@ -92,3 +95,4 @@
         return catalogUriResolver("uriSuffix.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/UriTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/UriTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +34,18 @@
 import javax.xml.catalog.CatalogUriResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.UriTest
+ * @run testng/othervm catalog.UriTest
  * @summary Get matched URIs from uri entries.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class UriTest {
 
     @Test(dataProvider = "uri-matchedUri")
@@ -101,3 +104,4 @@
         return catalogUriResolver(CATALOG_URI);
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/UrnUnwrappingTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/UrnUnwrappingTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,17 +29,20 @@
 import javax.xml.catalog.CatalogResolver;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.UrnUnwrappingTest
+ * @run testng/othervm catalog.UrnUnwrappingTest
  * @summary If the passed public identifier is started with "urn:publicid:",
  *          it has to be regarded as URN and normalized. And then the catalog
  *          resolver uses the normalized stuff to do matching.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class UrnUnwrappingTest {
 
     @Test(dataProvider = "urn-matchedUri")
@@ -48,7 +51,7 @@
     }
 
     @DataProvider(name = "urn-matchedUri")
-    private Object[][] data() {
+    public Object[][] data() {
         return new Object[][] {
                 // The specified public id is URN format.
                 { "urn:publicid:-:REMOTE:DTD+ALICE+DOCALICE+XML:EN",
@@ -64,3 +67,4 @@
         return catalogResolver("urnUnwrapping.xml");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/ValidateCatalogTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/ValidateCatalogTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,17 +32,20 @@
 
 import javax.xml.catalog.CatalogException;
 
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
  * @test
  * @bug 8077931
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true catalog.ValidateCatalogTest
+ * @run testng/othervm catalog.ValidateCatalogTest
  * @summary A legal catalog file must be well-formed XML, the root element
  *          must be catalog, and the naming space of the root element must be
  *          urn:oasis:names:tc:entity:xmlns:xml:catalog.
- * @compile ../../libs/catalog/CatalogTestUtils.java
- * @compile ../../libs/catalog/ResolutionChecker.java
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class ValidateCatalogTest {
 
     private static final String CATALOG_WRONGROOT = "validateCatalog-wrongRoot.xml";
@@ -99,3 +102,4 @@
                 "http://local/dtd/docAliceURI.dtd");
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/DurationTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/DurationTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -44,17 +44,21 @@
 import javax.xml.datatype.Duration;
 import javax.xml.namespace.QName;
 
-import jaxp.library.JAXPBaseTest;
-
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.DurationTest
+ * @run testng/othervm javax.xml.datatype.ptests.DurationTest
  * @summary Class containing the test cases for Duration.
  */
-public class DurationTest extends JAXPBaseTest {
+@Listeners({jaxp.library.BasePolicy.class})
+public class DurationTest {
 
     private DatatypeFactory datatypeFactory;
 
@@ -583,3 +587,4 @@
     private final BigInteger one = BigInteger.ONE;
 
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/FactoryNewInstanceTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/FactoryNewInstanceTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +30,20 @@
 import javax.xml.datatype.Duration;
 
 import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPBaseTest;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.FactoryNewInstanceTest
+ * @run testng/othervm javax.xml.datatype.ptests.FactoryNewInstanceTest
  * @summary Tests for DatatypeFactory.newInstance(factoryClassName , classLoader)
  */
-public class FactoryNewInstanceTest extends JAXPBaseTest {
+@Listeners({jaxp.library.BasePolicy.class})
+public class FactoryNewInstanceTest {
 
     private static final String DATATYPE_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl";
 
@@ -72,3 +77,4 @@
     }
 
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/XMLGregorianCalendarTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/datatype/ptests/XMLGregorianCalendarTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,18 +39,22 @@
 import javax.xml.datatype.Duration;
 import javax.xml.datatype.XMLGregorianCalendar;
 
-import jaxp.library.JAXPBaseTest;
-
 import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
+ * @test
  * @bug 5049592 5041845 5048932 5064587 5040542 5049531 5049528
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.datatype.ptests.XMLGregorianCalendarTest
+ * @run testng/othervm javax.xml.datatype.ptests.XMLGregorianCalendarTest
  * @summary Class containing the test cases for XMLGregorianCalendar
  */
-public class XMLGregorianCalendarTest extends JAXPBaseTest {
+@Listeners({jaxp.library.BasePolicy.class})
+public class XMLGregorianCalendarTest {
 
     private DatatypeFactory datatypeFactory;
 
@@ -354,3 +358,4 @@
     private final int undef = DatatypeConstants.FIELD_UNDEFINED;
 
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DBFNamespaceTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DBFNamespaceTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,18 +23,21 @@
 
 package javax.xml.parsers.ptests;
 
+import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
+import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
 import static jaxp.library.JAXPTestUtilities.USER_DIR;
 import static jaxp.library.JAXPTestUtilities.compareWithGold;
 import static org.testng.Assert.assertTrue;
+
 import java.io.File;
+
 import javax.xml.parsers.DocumentBuilderFactory;
-import static javax.xml.parsers.ptests.ParserTestConst.GOLDEN_DIR;
-import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.sax.SAXResult;
-import jaxp.library.JAXPFileBaseTest;
+
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 
@@ -42,7 +45,14 @@
  * This tests DocumentBuilderFactory for namespace processing and no-namespace
  * processing.
  */
-public class DBFNamespaceTest extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DBFNamespaceTest
+ * @run testng/othervm javax.xml.parsers.ptests.DBFNamespaceTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class DBFNamespaceTest {
 
     /**
      * Provide input for the cases that supporting namespace or not.
@@ -95,3 +105,5 @@
         }
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactoryTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderFactoryTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.FilePermission;
 import java.io.FileReader;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -55,9 +54,9 @@
 import javax.xml.transform.sax.SAXResult;
 
 import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPFileBaseTest;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -70,7 +69,14 @@
  * @bug 8080907
  * This checks the methods of DocumentBuilderFactoryImpl.
  */
-public class DocumentBuilderFactoryTest extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DocumentBuilderFactoryTest
+ * @run testng/othervm javax.xml.parsers.ptests.DocumentBuilderFactoryTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class DocumentBuilderFactoryTest {
     /**
      * DocumentBuilderFactory implementation class name.
      */
@@ -419,8 +425,6 @@
     @Test
     public void testCheckDocumentBuilderFactory13() throws Exception {
         // Accesing default working directory.
-        String workingDir = getSystemProperty("user.dir");
-        setPermissions(new FilePermission(workingDir + "/*", "read"));
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = dbf.newDocumentBuilder();
         Document doc = docBuilder.parse(new File(XML_DIR + "dbf10import.xsl")
@@ -436,8 +440,6 @@
     @Test(expectedExceptions = SAXException.class)
     public void testCheckDocumentBuilderFactory14() throws Exception {
         // Accesing default working directory.
-        String workingDir = getSystemProperty("user.dir");
-        setPermissions(new FilePermission(workingDir, "read"));
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = dbf.newDocumentBuilder();
         docBuilder.parse("");
@@ -529,3 +531,5 @@
         assertTrue(compareWithGold(goldFile, outputFile));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderImpl01.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/DocumentBuilderImpl01.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,18 +23,21 @@
 
 package javax.xml.parsers.ptests;
 
+import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
 import static jaxp.library.JAXPTestUtilities.FILE_SEP;
 import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FilePermission;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
-import static org.testng.Assert.assertNotNull;
+
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.InputSource;
@@ -42,8 +45,14 @@
 /**
  * This checks for the methods of DocumentBuilder
  */
-public class DocumentBuilderImpl01 extends JAXPFileReadOnlyBaseTest
-            implements EntityResolver {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.DocumentBuilderImpl01
+ * @run testng/othervm javax.xml.parsers.ptests.DocumentBuilderImpl01
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class DocumentBuilderImpl01 implements EntityResolver {
     /**
      * Provide DocumentBuilder.
      *
@@ -82,7 +91,7 @@
      * @param docBuilder document builder instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider")
+    @Test(dataProvider = "builder-provider")
     public void testCheckDocumentBuilderImpl04(DocumentBuilder docBuilder)
             throws Exception {
         try (FileInputStream fis = new FileInputStream(new File(XML_DIR,
@@ -97,7 +106,7 @@
      * @param docBuilder document builder instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider")
+    @Test(dataProvider = "builder-provider")
     public void testCheckDocumentBuilderImpl05(DocumentBuilder docBuilder)
             throws Exception {
         assertNotNull(docBuilder.parse(new File(XML_DIR,
@@ -109,11 +118,9 @@
      * @param docBuilder document builder instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "builder-provider")
+    @Test(dataProvider = "builder-provider")
     public void testCheckDocumentBuilderImpl06(DocumentBuilder docBuilder)
             throws Exception {
-        setPermissions(new FilePermission(XML_DIR + "../-",
-                "read"));
         try (FileInputStream fis = new FileInputStream(new File(XML_DIR,
                 "DocumentBuilderImpl02.xml"))) {
             assertNotNull(docBuilder.parse(fis, new File(XML_DIR).toURI()
@@ -150,3 +157,5 @@
             return null;
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/FactoryConfErrorTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/FactoryConfErrorTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,20 +23,30 @@
 
 package javax.xml.parsers.ptests;
 
+import static jaxp.library.JAXPTestUtilities.setSystemProperty;
+import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
+
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.SAXParserFactory;
-import jaxp.library.JAXPBaseTest;
 
 import org.testng.annotations.AfterTest;
 import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
  * Class containing the test cases for SAXParserFactory/DocumentBuilderFactory
  * newInstance methods.
  */
-public class FactoryConfErrorTest extends JAXPBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.FactoryConfErrorTest
+ * @run testng/othervm javax.xml.parsers.ptests.FactoryConfErrorTest
+ */
+@Listeners({jaxp.library.BasePolicy.class})
+public class FactoryConfErrorTest {
 
     /**
      * Set properties DocumentBuilderFactory and SAXParserFactory to invalid
@@ -54,8 +64,8 @@
      */
     @AfterTest
     public void cleanup() {
-        setSystemProperty("javax.xml.parsers.DocumentBuilderFactory", null);
-        setSystemProperty("javax.xml.parsers.SAXParserFactory", null);
+        clearSystemProperty("javax.xml.parsers.DocumentBuilderFactory");
+        clearSystemProperty("javax.xml.parsers.SAXParserFactory");
     }
 
     /**
@@ -76,3 +86,5 @@
         DocumentBuilderFactory.newInstance();
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXFactoryNewInstanceTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXFactoryNewInstanceTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,16 +31,21 @@
 import javax.xml.parsers.SAXParserFactory;
 
 import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPBaseTest;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.SAXException;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
+ * @run testng/othervm javax.xml.parsers.ptests.SAXFactoryNewInstanceTest
  * @summary Tests for SAXParserFactory.newInstance(factoryClassName , classLoader)
  */
-public class SAXFactoryNewInstanceTest extends JAXPBaseTest {
+@Listeners({jaxp.library.BasePolicy.class})
+public class SAXFactoryNewInstanceTest {
 
     private static final String SAXPARSER_FACTORY_CLASSNAME = "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl";
 
@@ -73,3 +78,5 @@
     }
 
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserFactTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserFactTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,23 @@
 package javax.xml.parsers.ptests;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
+
 import javax.xml.parsers.SAXParserFactory;
-import jaxp.library.JAXPBaseTest;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
  * Class containing the test cases for SAXParserFactory API.
  */
-public class SAXParserFactTest extends JAXPBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserFactTest
+ * @run testng/othervm javax.xml.parsers.ptests.SAXParserFactTest
+ */
+@Listeners({jaxp.library.BasePolicy.class})
+public class SAXParserFactTest {
 
     private static final String NAMESPACES = "http://xml.org/sax/features/namespaces";
     private static final String NAMESPACE_PREFIXES = "http://xml.org/sax/features/namespace-prefixes";
@@ -220,3 +229,5 @@
         assertFalse(spf.getFeature(EXTERNAL_P_ENTITIES));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,15 +23,23 @@
 
 package javax.xml.parsers.ptests;
 
+import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.tryRunWithTmpPermission;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FilePermission;
 import java.io.IOException;
+import java.util.PropertyPermission;
+
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
-import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
+
+import jaxp.library.JAXPTestUtilities;
+
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.HandlerBase;
 import org.xml.sax.InputSource;
@@ -41,7 +49,14 @@
 /**
  * Class contains the test cases for SAXParser API
  */
-public class SAXParserTest extends JAXPFileReadOnlyBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest
+ * @run testng/othervm javax.xml.parsers.ptests.SAXParserTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class SAXParserTest {
     /**
      * Provide SAXParser.
      *
@@ -92,13 +107,7 @@
     @Test(expectedExceptions = { SAXException.class },
             dataProvider = "parser-provider")
     public void testParse03(SAXParser saxparser) throws Exception {
-        String workingDir = getSystemProperty("user.dir");
-        setPermissions(new FilePermission(workingDir, "read"));
-        try {
-            saxparser.parse("", new HandlerBase());
-        } finally {
-            setPermissions();
-        }
+        saxparser.parse("", new HandlerBase());
     }
 
     /**
@@ -124,13 +133,7 @@
      */
     @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
     public void testParse05(SAXParser saxparser) throws Exception {
-        String workingDir = getSystemProperty("user.dir");
-        setPermissions(new FilePermission(workingDir, "read"));
-        try {
-            saxparser.parse(new File(""), new HandlerBase());
-        } finally {
-            setPermissions();
-        }
+        tryRunWithTmpPermission(() -> saxparser.parse(new File(""), new HandlerBase()), new PropertyPermission("user.dir", "read"));
     }
 
     /**
@@ -176,23 +179,18 @@
     }
 
     /**
-     * Test with non-existence URI, parsing should fail and throw
-     * SAXException or IOException.
+     * Test with non-existence URI, parsing should fail and throw SAXException
+     * or IOException.
      *
-     * @param saxparser a SAXParser instance.
-     * @throws Exception If any errors occur.
+     * @param saxparser
+     *            a SAXParser instance.
+     * @throws Exception
+     *             If any errors occur.
      */
-    @Test(expectedExceptions = { SAXException.class, IOException.class },
-            dataProvider = "parser-provider")
+    @Test(expectedExceptions = { SAXException.class, IOException.class }, dataProvider = "parser-provider")
     public void testParse09(SAXParser saxparser) throws Exception {
-        String workingDir = getSystemProperty("user.dir");
-        setPermissions(new FilePermission(workingDir + "/../-", "read"));
-        String uri = " ";
-        try {
-            saxparser.parse(uri, new DefaultHandler());
-        } finally {
-            setPermissions();
-        }
+        JAXPTestUtilities.tryRunWithTmpPermission(() -> saxparser.parse(" ", new DefaultHandler()),
+                new FilePermission(USER_DIR + " ", "read"));
     }
 
     /**
@@ -204,14 +202,8 @@
      */
     @Test(expectedExceptions = SAXException.class, dataProvider = "parser-provider")
     public void testParse10(SAXParser saxparser) throws Exception {
-        String workingDir = getSystemProperty("user.dir");
-        setPermissions(new FilePermission(workingDir, "read"));
         File file = new File("");
-        try {
-            saxparser.parse(file, new DefaultHandler());
-        } finally {
-            setPermissions();
-        }
+        tryRunWithTmpPermission(() -> saxparser.parse(file, new DefaultHandler()), new PropertyPermission("user.dir", "read"));
     }
 
     /**
@@ -248,7 +240,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
+    @Test(expectedExceptions = SAXException.class,
             dataProvider = "parser-provider")
     public void testParse13(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(new File(
@@ -263,7 +255,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse14(SAXParser saxparser) throws Exception {
         saxparser.parse(new File(XML_DIR, "parsertest.xml"),
                 new HandlerBase());
@@ -276,7 +268,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse15(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
                 "correct.xml"))) {
@@ -291,7 +283,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse16(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(
                 new File(XML_DIR, "parsertest.xml"))) {
@@ -306,7 +298,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse17(SAXParser saxparser) throws Exception {
         File file = new File(XML_DIR, "correct.xml");
         saxparser.parse(file.toURI().toASCIIString(), new HandlerBase());
@@ -319,7 +311,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
+    @Test(expectedExceptions = SAXException.class,
             dataProvider = "parser-provider")
     public void testParse18(SAXParser saxparser) throws Exception {
         saxparser.parse(new File(XML_DIR, "valid.xml"), new HandlerBase());
@@ -332,7 +324,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse19(SAXParser saxparser) throws Exception {
         saxparser.parse(new File(XML_DIR, "correct.xml"), new HandlerBase());
     }
@@ -344,7 +336,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
+    @Test(expectedExceptions = SAXException.class,
             dataProvider = "parser-provider")
     public void testParse20(SAXParser saxparser) throws Exception {
         try(FileInputStream instream = new FileInputStream(new File(XML_DIR,
@@ -360,7 +352,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse21(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
                 "correct.xml"))) {
@@ -375,7 +367,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
+    @Test(expectedExceptions = SAXException.class,
             dataProvider = "parser-provider")
     public void testParse22(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(
@@ -391,7 +383,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse23(SAXParser saxparser) throws Exception {
         DefaultHandler handler = new DefaultHandler();
         saxparser.parse(new File(XML_DIR, "parsertest.xml"), handler);
@@ -404,7 +396,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse24(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(new File(XML_DIR,
                 "correct.xml"))) {
@@ -420,7 +412,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse25(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(
                 new File(XML_DIR, "parsertest.xml"))) {
@@ -435,7 +427,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse26(SAXParser saxparser) throws Exception {
         File file = new File(XML_DIR, "correct.xml");
         saxparser.parse(file.toURI().toASCIIString(), new DefaultHandler());
@@ -448,7 +440,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
+    @Test(expectedExceptions = SAXException.class,
             dataProvider = "parser-provider")
     public void testParse27(SAXParser saxparser) throws Exception {
         saxparser.parse(new File(XML_DIR, "valid.xml"), new DefaultHandler());
@@ -461,7 +453,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse28(SAXParser saxparser) throws Exception {
         saxparser.parse(new File(XML_DIR, "correct.xml"), new DefaultHandler());
     }
@@ -472,7 +464,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, expectedExceptions = SAXException.class,
+    @Test(expectedExceptions = SAXException.class,
             dataProvider = "parser-provider")
     public void testParse29(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(
@@ -487,7 +479,7 @@
      * @param saxparser a SAXParser instance.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "parser-provider")
+    @Test(dataProvider = "parser-provider")
     public void testParse30(SAXParser saxparser) throws Exception {
         try (FileInputStream instream = new FileInputStream(
                 new File(XML_DIR, "correct.xml"))) {
@@ -500,7 +492,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"})
+    @Test
     public void testParse31() throws Exception {
         try (FileInputStream instream = new FileInputStream(
                 new File(XML_DIR, "ns4.xml"))) {
@@ -510,3 +502,5 @@
         }
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest02.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest02.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,13 +24,15 @@
 package javax.xml.parsers.ptests;
 
 import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
 import static org.testng.Assert.assertTrue;
+
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
-import jaxp.library.JAXPBaseTest;
-import static org.testng.Assert.assertNotNull;
+
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXNotSupportedException;
@@ -40,7 +42,14 @@
 /**
  * Class contains the test cases for SAXParser API
  */
-public class SAXParserTest02 extends JAXPBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest02
+ * @run testng/othervm javax.xml.parsers.ptests.SAXParserTest02
+ */
+@Listeners({jaxp.library.BasePolicy.class})
+public class SAXParserTest02 {
     private static final String DOM_NODE = "http://xml.org/sax/properties/dom-node";
     private static final String XML_STRING = "http://xml.org/sax/properties/xml-string";
     private static final String DECL_HANDLER = "http://xml.org/sax/properties/declaration-handler";
@@ -260,3 +269,5 @@
         }
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest03.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/parsers/ptests/SAXParserTest03.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,25 +23,32 @@
 
 package javax.xml.parsers.ptests;
 
+import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
 import java.io.File;
-import java.io.FilePermission;
+
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
-import static javax.xml.parsers.ptests.ParserTestConst.XML_DIR;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
-import static org.testng.Assert.fail;
-import org.testng.annotations.AfterGroups;
-import org.testng.annotations.BeforeGroups;
+
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.SAXException;
 
 /**
  * Class contains the test cases for SAXParser API
  */
-public class SAXParserTest03 extends JAXPFileReadOnlyBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.parsers.ptests.SAXParserTest03
+ * @run testng/othervm javax.xml.parsers.ptests.SAXParserTest03
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class SAXParserTest03 {
 
     /**
      * Provide SAXParserFactory.
@@ -63,7 +70,7 @@
      * @param handler an error handler for capturing events.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "input-provider")
+    @Test(dataProvider = "input-provider")
     public void testParseValidate01(SAXParserFactory spf, MyErrorHandler handler)
             throws Exception {
             spf.newSAXParser().parse(new File(XML_DIR, "parsertest.xml"), handler);
@@ -78,7 +85,7 @@
      * @param handler an error handler for capturing events.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "input-provider")
+    @Test(dataProvider = "input-provider")
     public void testParseValidate02(SAXParserFactory spf, MyErrorHandler handler)
             throws Exception {
             spf.setNamespaceAware(true);
@@ -95,7 +102,7 @@
      * @param handler an error handler for capturing events.
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"}, dataProvider = "input-provider")
+    @Test(dataProvider = "input-provider")
     public void testParseValidate03(SAXParserFactory spf, MyErrorHandler handler)
             throws Exception {
         try {
@@ -109,3 +116,5 @@
     }
 
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLEventFactoryNewInstanceTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLEventFactoryNewInstanceTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,20 +23,28 @@
 
 package javax.xml.stream.ptests;
 
+import static jaxp.library.JAXPTestUtilities.setSystemProperty;
+import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
+
 import static org.testng.Assert.assertNotNull;
 
 import javax.xml.stream.XMLEventFactory;
 
 import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPBaseTest;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.stream.ptests.XMLEventFactoryNewInstanceTest
+ * @run testng/othervm javax.xml.stream.ptests.XMLEventFactoryNewInstanceTest
  * @summary Tests for XMLEventFactory.newFactory(factoryId , classLoader)
  */
-public class XMLEventFactoryNewInstanceTest extends JAXPBaseTest {
+@Listeners({jaxp.library.BasePolicy.class})
+public class XMLEventFactoryNewInstanceTest {
 
     private static final String XMLEVENT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.events.XMLEventFactoryImpl";
     private static final String XMLEVENT_FACRORY_ID = "javax.xml.stream.XMLEventFactory";
@@ -59,7 +67,7 @@
             XMLEventFactory xef = XMLEventFactory.newFactory(factoryId, classLoader);
             assertNotNull(xef);
         } finally {
-            setSystemProperty(XMLEVENT_FACRORY_ID, null);
+            clearSystemProperty(XMLEVENT_FACRORY_ID);
         }
     }
 
@@ -74,3 +82,4 @@
     }
 
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLInputFactoryNewInstanceTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/stream/ptests/XMLInputFactoryNewInstanceTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,20 +23,28 @@
 
 package javax.xml.stream.ptests;
 
+import static jaxp.library.JAXPTestUtilities.setSystemProperty;
+import static jaxp.library.JAXPTestUtilities.clearSystemProperty;
+
 import static org.testng.Assert.assertNotNull;
 
 import javax.xml.stream.XMLInputFactory;
 
 import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPBaseTest;
 
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.stream.ptests.XMLInputFactoryNewInstanceTest
+ * @run testng/othervm javax.xml.stream.ptests.XMLInputFactoryNewInstanceTest
  * @summary Tests for XMLInputFactory.newFactory(factoryId , classLoader)
  */
-public class XMLInputFactoryNewInstanceTest extends JAXPBaseTest {
+@Listeners({jaxp.library.BasePolicy.class})
+public class XMLInputFactoryNewInstanceTest {
 
     private static final String XMLINPUT_FACTORY_CLASSNAME = "com.sun.xml.internal.stream.XMLInputFactoryImpl";
     private static final String XMLINPUT_FACRORY_ID = "javax.xml.stream.XMLInputFactory";
@@ -59,7 +67,7 @@
             XMLInputFactory xif = XMLInputFactory.newFactory(factoryId, classLoader);
             assertNotNull(xif);
         } finally {
-            setSystemProperty(XMLINPUT_FACRORY_ID, null);
+            clearSystemProperty(XMLINPUT_FACRORY_ID);
         }
     }
 
@@ -74,3 +82,4 @@
     }
 
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/Bug6384418Test.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/Bug6384418Test.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,8 @@
 
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 
@@ -34,17 +36,20 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
-import jaxp.library.JAXPFileBaseTest;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
-
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 
 /*
+ * @test
  * @bug 6384418
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.Bug6384418Test
+ * @run testng/othervm javax.xml.transform.ptests.Bug6384418Test
  * @summary verify the transforming won't throw any exception
  */
-public class Bug6384418Test extends JAXPFileBaseTest {
+@Listeners({jaxp.library.FilePolicy.class})
+public class Bug6384418Test {
 
     @Test
     public void test() throws Exception {
@@ -62,3 +67,5 @@
     }
 
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/DOMResultTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/DOMResultTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,20 +23,23 @@
 
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static org.testng.Assert.assertTrue;
+
 import java.io.BufferedWriter;
 import java.io.FileWriter;
 import java.io.IOException;
+
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMResult;
-import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.sax.TransformerHandler;
-import jaxp.library.JAXPFileBaseTest;
-import static jaxp.library.JAXPTestUtilities.USER_DIR;
-import static jaxp.library.JAXPTestUtilities.compareWithGold;
-import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Attr;
 import org.w3c.dom.NamedNodeMap;
@@ -50,7 +53,14 @@
  * DOM parse on test file to be compared with golden output file. No Exception
  * is expected.
  */
-public class DOMResultTest extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.DOMResultTest
+ * @run testng/othervm javax.xml.transform.ptests.DOMResultTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class DOMResultTest {
     /**
      * Unit test for simple DOM parsing.
      * @throws Exception If any errors occur.
@@ -108,3 +118,5 @@
                 writeNodes(kids.item(i), bWriter);
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/ErrorListenerTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/ErrorListenerTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,23 +23,32 @@
 
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.fail;
+
 import java.io.File;
-import java.io.FilePermission;
+
 import javax.xml.transform.ErrorListener;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPBaseTest;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.fail;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
  * Class containing the test cases for ErrorListener interface
  */
-public class ErrorListenerTest extends JAXPBaseTest implements ErrorListener {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.ErrorListenerTest
+ * @run testng/othervm javax.xml.transform.ptests.ErrorListenerTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class ErrorListenerTest implements ErrorListener {
     /**
      * Define ErrorListener's status.
      */
@@ -60,7 +69,6 @@
         try {
             TransformerFactory tfactory = TransformerFactory.newInstance();
             tfactory.setErrorListener (listener);
-            setPermissions(new FilePermission(XML_DIR + "invalid.xsl", "read"));
             tfactory.newTransformer(new StreamSource(
                                         new File(XML_DIR + "invalid.xsl")));
             fail("Expect TransformerConfigurationException here");
@@ -96,3 +104,5 @@
         this.status = ListenerStatus.FATAL;
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXSourceTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXSourceTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,18 +23,21 @@
 
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertNull;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.InputSource;
 
@@ -42,7 +45,14 @@
 /**
  * Unit test for SAXSource sourceToInputSource API.
  */
-public class SAXSourceTest extends JAXPFileReadOnlyBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.SAXSourceTest
+ * @run testng/othervm javax.xml.transform.ptests.SAXSourceTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class SAXSourceTest {
     /**
      * Test style-sheet file name
      */
@@ -53,7 +63,7 @@
      *
      * @throws IOException reading file error.
      */
-    @Test(groups = {"readLocalFiles"})
+    @Test
     public void source2inputsource01() throws IOException {
         try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
             StreamSource streamSource = new StreamSource(fis);
@@ -68,7 +78,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test(groups = {"readLocalFiles"})
+    @Test
     public void source2inputsource02() throws Exception {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
@@ -83,7 +93,7 @@
      *
      * @throws IOException reading file error.
      */
-    @Test(groups = {"readLocalFiles"})
+    @Test
     public void source2inputsource03() throws IOException {
         String SYSTEM_ID = "file:///" + XML_DIR;
         try (FileInputStream fis = new FileInputStream(TEST_FILE)) {
@@ -95,3 +105,5 @@
         }
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/SAXTFactoryTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,27 +23,30 @@
 
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static org.testng.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Result;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.sax.TemplatesHandler;
 import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileBaseTest;
-import static jaxp.library.JAXPTestUtilities.USER_DIR;
-import static jaxp.library.JAXPTestUtilities.compareWithGold;
-import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -56,7 +59,14 @@
  * Test newTransformerhandler() method which takes StreamSource as argument can
  * be set to XMLReader.
  */
-public class SAXTFactoryTest extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.SAXTFactoryTest
+ * @run testng/othervm javax.xml.transform.ptests.SAXTFactoryTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class SAXTFactoryTest {
     /**
      * Test style-sheet file.
      */
@@ -421,3 +431,5 @@
         assertTrue(compareWithGold(goldFile, outputFile));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/StreamResultTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/StreamResultTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,16 @@
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.failUnexpected;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Properties;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -34,12 +39,10 @@
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileBaseTest;
-import static jaxp.library.JAXPTestUtilities.USER_DIR;
-import static jaxp.library.JAXPTestUtilities.failUnexpected;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
@@ -48,7 +51,14 @@
  * Test a StreamResult using a file name that contains URL characters that need
  * to be encoded.
  */
-public class StreamResultTest extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.StreamResultTest
+ * @run testng/othervm javax.xml.transform.ptests.StreamResultTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class StreamResultTest {
     /**
      * Unit test for StreamResult.
      */
@@ -96,3 +106,5 @@
         });
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TfClearParamTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TfClearParamTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,20 +22,23 @@
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNull;
+
 import java.io.File;
 import java.io.FileInputStream;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -44,7 +47,14 @@
 /**
  * Class containing the test cases for SAXParserFactory API
  */
-public class TfClearParamTest extends JAXPFileReadOnlyBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TfClearParamTest
+ * @run testng/othervm javax.xml.transform.ptests.TfClearParamTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class TfClearParamTest {
     /**
      * Test style-sheet file name.
      */
@@ -128,7 +138,7 @@
      * @throws TransformerConfigurationException If for some reason the
      *         TransformerHandler can not be created.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void clear05() throws TransformerConfigurationException {
         Transformer transformer = TransformerFactory.newInstance().
                 newTransformer(new StreamSource(new File(XSL_FILE)));
@@ -143,7 +153,7 @@
      * @throws TransformerConfigurationException If for some reason the
      *         TransformerHandler can not be created.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void clear06() throws TransformerConfigurationException {
         Transformer transformer = TransformerFactory.newInstance().
                 newTransformer(new StreamSource(new File(XSL_FILE)));
@@ -157,7 +167,7 @@
      * the a name that set before. Value should be same as set one.
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void clear07() throws Exception {
         try (FileInputStream fis = new FileInputStream(XSL_FILE)) {
             SAXSource saxSource = new SAXSource();
@@ -174,7 +184,7 @@
      * the a name that wasn't set before. Null is expected.
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void clear08() throws Exception {
         try (FileInputStream fis = new FileInputStream(XSL_FILE)) {
             SAXSource saxSource = new SAXSource();
@@ -192,7 +202,7 @@
      * the a name that set before. Value should be same as set one.
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void clear09() throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
 
@@ -213,7 +223,7 @@
      * the a name that wasn't set before. Null is expected.
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void clear10() throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
 
@@ -229,3 +239,5 @@
         assertNull(transformer.getParameter(LONG_PARAM_NAME));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.stream.XMLEventWriter;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLOutputFactory;
@@ -58,10 +57,9 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
-import jaxp.library.JAXPFileBaseTest;
-
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.Attributes;
@@ -71,10 +69,15 @@
 import org.xml.sax.SAXException;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformTest
+ * @run testng/othervm javax.xml.transform.ptests.TransformTest
  * @summary Tests for variable combination of Transformer.transform(Source, Result)
  */
 @Test(singleThreaded = true)
-public class TransformTest extends JAXPFileBaseTest {
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformTest {
 
     /*
      * Initialize the share objects.
@@ -381,3 +384,5 @@
     private Document xmlDoc;
 
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerExcpTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerExcpTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,32 +22,40 @@
  */
 package javax.xml.transform.ptests;
 
-import java.io.File;
-import java.io.FilePermission;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
 import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
-import javax.xml.transform.sax.SAXResult;
-import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPBaseTest;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertNull;
 import static org.testng.Assert.fail;
+
+import java.io.File;
+
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
  *  Basic test for TransformerException specification.
  */
-public class TransformerExcpTest extends JAXPBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerExcpTest
+ * @run testng/othervm javax.xml.transform.ptests.TransformerExcpTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformerExcpTest {
     /**
      * Transform an unformatted style-sheet file. TransformerException is thrown.
      */
     @Test
     public void tfexception() {
         try {
-            setPermissions(new FilePermission(XML_DIR  + "-", "read"));
             // invalid.xsl has well-formedness error. Therefore transform throws
             // TransformerException
             StreamSource streamSource
@@ -63,8 +71,6 @@
             assertNotNull(e.getException());
             assertNull(e.getLocationAsString());
             assertEquals(e.getMessageAndLocation(),e.getMessage());
-        } finally {
-            setPermissions();
         }
     }
 
@@ -99,3 +105,5 @@
         assertNotNull(te.initCause(null));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerFactoryTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,33 +22,45 @@
  */
 package javax.xml.transform.ptests;
 
-import java.io.*;
-
-import javax.xml.parsers.*;
-import javax.xml.transform.*;
-import javax.xml.transform.dom.*;
-
 import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
 import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
-
-import javax.xml.transform.stream.*;
-
-import jaxp.library.JAXPDataProvider;
-import jaxp.library.JAXPFileBaseTest;
 import static jaxp.library.JAXPTestUtilities.USER_DIR;
 import static jaxp.library.JAXPTestUtilities.compareWithGold;
 import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
 
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import jaxp.library.JAXPDataProvider;
+
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
-import org.w3c.dom.*;
+import org.w3c.dom.Document;
 
 /**
  * Class containing the test cases for TransformerFactory API's
  * getAssociatedStyleSheet method and TransformerFactory.newInstance(factoryClassName , classLoader).
  */
-public class TransformerFactoryTest extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerFactoryTest
+ * @run testng/othervm javax.xml.transform.ptests.TransformerFactoryTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformerFactoryTest {
     /**
      * TransformerFactory implementation class name.
      */
@@ -129,3 +141,5 @@
         assertTrue(compareWithGold(goldFile, outputFile));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,9 +22,15 @@
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.util.Properties;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.ErrorListener;
@@ -33,13 +39,10 @@
 import javax.xml.transform.TransformerException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileReadOnlyBaseTest;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
@@ -47,7 +50,14 @@
 /**
  * Basic test cases for Transformer API
  */
-public class TransformerTest extends JAXPFileReadOnlyBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerTest
+ * @run testng/othervm javax.xml.transform.ptests.TransformerTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformerTest {
     /**
      * XSLT file serves every test method.
      */
@@ -58,7 +68,7 @@
      * @throws TransformerConfigurationException If for some reason the
      *         TransformerHandler can not be created.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void transformer01() throws TransformerConfigurationException {
         TransformerFactory tfactory = TransformerFactory.newInstance();
         StreamSource streamSource = new StreamSource(
@@ -71,7 +81,7 @@
      * This tests if newTransformer(SAXSource) method returns Transformer.
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void transformer02() throws Exception {
         try (FileInputStream fis = new FileInputStream(TEST_XSL)) {
             TransformerFactory tfactory = TransformerFactory.newInstance();
@@ -86,7 +96,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void transformer03() throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
 
@@ -105,7 +115,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void transformer04() throws Exception {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
@@ -125,7 +135,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void transformer05() throws Exception {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         dbf.setNamespaceAware(true);
@@ -150,7 +160,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public void transformer06() throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
 
@@ -197,3 +207,5 @@
         System.out.println(" In fatal");
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest02.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest02.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,21 +22,24 @@
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static org.testng.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileBaseTest;
-import static jaxp.library.JAXPTestUtilities.USER_DIR;
-import static jaxp.library.JAXPTestUtilities.compareWithGold;
-import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 
@@ -44,7 +47,14 @@
  * Here a transformer is created using DOMSource. Some specific output property
  * is set on transformer. Then transform(StreamSource, StreamResult) is tested.
  */
-public class TransformerTest02 extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerTest02
+ * @run testng/othervm javax.xml.transform.ptests.TransformerTest02
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformerTest02 {
     /**
      * Unit test for transform(StreamSource, StreamResult).
      *
@@ -75,3 +85,5 @@
         assertTrue(compareWithGold(goldFile, outputFile));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest03.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/TransformerTest03.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,22 +22,25 @@
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static jaxp.library.JAXPTestUtilities.USER_DIR;
+import static jaxp.library.JAXPTestUtilities.compareWithGold;
+import static org.testng.Assert.assertTrue;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.util.Properties;
+
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.GOLDEN_DIR;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileBaseTest;
-import static jaxp.library.JAXPTestUtilities.USER_DIR;
-import static jaxp.library.JAXPTestUtilities.compareWithGold;
-import static org.testng.Assert.assertTrue;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
@@ -46,7 +49,14 @@
  * for transformer. Then transform(StreamSource, StreamResult) is used for
  * transformation. This tests the setOutputProperties() method.
  */
-public class TransformerTest03 extends JAXPFileBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.TransformerTest03
+ * @run testng/othervm javax.xml.transform.ptests.TransformerTest03
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class TransformerTest03 {
     /**
      * Test for Transformer.setOutputProperties method.
      *
@@ -84,3 +94,5 @@
         assertTrue(compareWithGold(goldFile, outputFile));
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/URIResolverTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/URIResolverTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +22,13 @@
  */
 package javax.xml.transform.ptests;
 
+import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
+
 import java.io.File;
 import java.io.FileInputStream;
+
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.Source;
@@ -31,13 +36,11 @@
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.URIResolver;
 import javax.xml.transform.dom.DOMSource;
-import static javax.xml.transform.ptests.TransformerTestConst.XML_DIR;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import jaxp.library.JAXPFileBaseTest;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
@@ -45,7 +48,14 @@
 /**
  * URIResolver should be invoked when transform happens.
  */
-public class URIResolverTest extends JAXPFileBaseTest implements URIResolver {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.URIResolverTest
+ * @run testng/othervm javax.xml.transform.ptests.URIResolverTest
+ */
+@Listeners({jaxp.library.FilePolicy.class})
+public class URIResolverTest implements URIResolver {
     /**
      * System ID constant.
      */
@@ -115,7 +125,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void resolver01() throws Exception {
         try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)) {
             TransformerFactory tfactory = TransformerFactory.newInstance();
@@ -134,7 +144,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void resolver02() throws Exception {
         TransformerFactory tfactory = TransformerFactory.newInstance();
         URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@@ -155,7 +165,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void resolver03() throws Exception {
         try (FileInputStream fis = new FileInputStream(XSL_INCLUDE_FILE)){
             URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@@ -174,7 +184,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void resolver04() throws Exception {
         try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)) {
             URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@@ -192,7 +202,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void resolver05() throws Exception {
         URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
         TransformerFactory tfactory = TransformerFactory.newInstance();
@@ -211,7 +221,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void resolver06() throws Exception {
         try (FileInputStream fis = new FileInputStream(XSL_IMPORT_FILE)){
             URIResolverTest resolver = new URIResolverTest(XSL_TEMP_FILE, SYSTEM_ID);
@@ -230,7 +240,7 @@
      *
      * @throws Exception If any errors occur.
      */
-    @Test (groups = {"readLocalFiles"})
+    @Test
     public static void docResolver01() throws Exception {
         try (FileInputStream fis = new FileInputStream(XML_DIR + "doctest.xsl")) {
             URIResolverTest resolver = new URIResolverTest("temp/colors.xml", SYSTEM_ID);
@@ -252,3 +262,5 @@
         }
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/othervm/TFCErrorTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/transform/ptests/othervm/TFCErrorTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,15 +22,27 @@
  */
 package javax.xml.transform.ptests.othervm;
 
-import javax.xml.transform.*;
-import jaxp.library.JAXPBaseTest;
+import static jaxp.library.JAXPTestUtilities.setSystemProperty;
+
 import static org.testng.Assert.fail;
+
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.TransformerFactoryConfigurationError;
+
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 
 /**
  * Negative test for set invalid TransformerFactory property.
  */
-public class TFCErrorTest  extends JAXPBaseTest {
+/*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.transform.ptests.othervm.TFCErrorTest
+ * @run testng/othervm javax.xml.transform.ptests.othervm.TFCErrorTest
+ */
+@Listeners({jaxp.library.BasePolicy.class})
+public class TFCErrorTest {
     @Test(expectedExceptions = ClassNotFoundException.class)
     public void tfce01() throws Exception {
         try{
@@ -42,3 +54,5 @@
         }
     }
 }
+
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/SchemaFactoryTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/SchemaFactoryTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,7 @@
 
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.xml.sax.ErrorHandler;
@@ -64,10 +65,15 @@
 import org.xml.sax.SAXParseException;
 
 /*
+ * @test
  * @bug 8080907
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.validation.ptests.SchemaFactoryTest
+ * @run testng/othervm javax.xml.validation.ptests.SchemaFactoryTest
  * @summary Class containing the test cases for SchemaFactory
  */
 @Test(singleThreaded = true)
+@Listeners({jaxp.library.FilePolicy.class})
 public class SchemaFactoryTest {
 
     @BeforeClass
@@ -398,3 +404,4 @@
     private Document xsdDoc2;
     private byte[] xml;
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/TypeInfoProviderTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/TypeInfoProviderTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,8 +39,7 @@
 import javax.xml.validation.TypeInfoProvider;
 import javax.xml.validation.ValidatorHandler;
 
-import jaxp.library.JAXPFileBaseTest;
-
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -49,9 +48,14 @@
 import org.xml.sax.helpers.DefaultHandler;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.validation.ptests.TypeInfoProviderTest
+ * @run testng/othervm javax.xml.validation.ptests.TypeInfoProviderTest
  * @summary test ValidatorHandler.getTypeInfoProvider()
  */
-public class TypeInfoProviderTest extends JAXPFileBaseTest {
+@Listeners({jaxp.library.FilePolicy.class})
+public class TypeInfoProviderTest {
 
     private ValidatorHandler validatorHandler;
 
@@ -91,3 +95,4 @@
 
     }
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/ValidatorHandlerTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/ValidatorHandlerTest.java	Fri Aug 05 13:37:53 2016 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * 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,7 @@
 import javax.xml.validation.ValidatorHandler;
 
 import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Listeners;
 import org.testng.annotations.Test;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.ErrorHandler;
@@ -46,8 +47,13 @@
 import org.xml.sax.helpers.DefaultHandler;
 
 /*
+ * @test
+ * @library /javax/xml/jaxp/libs
+ * @run testng/othervm -DrunSecMngr=true javax.xml.validation.ptests.ValidatorHandlerTest
+ * @run testng/othervm javax.xml.validation.ptests.ValidatorHandlerTest
  * @summary Class containing the test cases for ValidatorHandler API
  */
+@Listeners({jaxp.library.FilePolicy.class})
 public class ValidatorHandlerTest {
     @BeforeClass
     public void setup() throws SAXException {
@@ -142,3 +148,4 @@
     private Schema schema;
 
 }
+
--- a/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/ValidatorTest.java	Fri Aug 05 16:23:44 2016 +0300
+++ b/jaxp/test/javax/xml/jaxp/functional/javax/xml/validation/ptests/ValidatorTe