diff --git a/.hgtags b/.hgtags
index d213f1fbfe4..744ce58f2fe 100644
--- a/.hgtags
+++ b/.hgtags
@@ -342,3 +342,5 @@ f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92
4edcff1b9a8875eb6380a2165dfec599e8e3f7c0 jdk-9+97
d00ad2d9049ac60815f70bff445e95df85648bd2 jdk-9+98
f9bcdce2df26678c3fe468130b535c0342c69b89 jdk-9+99
+4379223f8806626852c46c52d4e7a27a584b406e jdk-9+100
+80f67512daa15cf37b4825c1c62a675d524d7c49 jdk-9+101
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index d10b68389a6..ad5eaa36b36 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -342,3 +342,5 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
75c3897541ecb52ee16d001ea605b12971df7303 jdk-9+97
48987460c7d49a29013963ee44d090194396bb61 jdk-9+98
7c0577bea4c65d69c5bef67023a89d2efa4fb2f7 jdk-9+99
+c1f30ac14db0eaff398429c04cd9fab92e1b4b2a jdk-9+100
+c4d72a1620835b5d657b7b6792c2879367d0154f jdk-9+101
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index f6b11c8a3bf..be85de751eb 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -23,6 +23,74 @@
# questions.
#
+# Create a function/macro that takes a series of named arguments. The call is
+# similar to AC_DEFUN, but the setup of the function looks like this:
+# BASIC_DEFUN_NAMED([MYFUNC], [FOO *BAR], [$@], [
+# ... do something
+# AC_MSG_NOTICE([Value of BAR is ARG_BAR])
+# ])
+# A star (*) in front of a named argument means that it is required and it's
+# presence will be verified. To pass e.g. the first value as a normal indexed
+# argument, use [m4_shift($@)] as the third argument instead of [$@]. These
+# arguments are referenced in the function by their name prefixed by ARG_, e.g.
+# "ARG_FOO".
+#
+# The generated function can be called like this:
+# MYFUNC(FOO: [foo-val], BAR:
+# [
+# $ECHO hello world
+# ])
+#
+#
+# Argument 1: Name of the function to define
+# Argument 2: List of legal named arguments, with a * prefix for required arguments
+# Argument 3: Argument array to treat as named, typically $@
+# Argument 4: The main function body
+AC_DEFUN([BASIC_DEFUN_NAMED],
+[
+ AC_DEFUN($1, [
+ m4_foreach(arg, m4_split($2), [
+ m4_if(m4_bregexp(arg, [^\*]), -1,
+ [
+ m4_set_add(legal_named_args, arg)
+ ],
+ [
+ m4_set_add(legal_named_args, m4_substr(arg, 1))
+ m4_set_add(required_named_args, m4_substr(arg, 1))
+ ]
+ )
+ ])
+
+ m4_foreach([arg], [$3], [
+ m4_define(arg_name, m4_substr(arg, 0, m4_bregexp(arg, [: ])))
+ m4_set_contains(legal_named_args, arg_name, [],[AC_MSG_ERROR([Internal error: arg_name is not a valid named argument to [$1]. Valid arguments are 'm4_set_contents(legal_named_args, [ ])'.])])
+ m4_set_remove(required_named_args, arg_name)
+ m4_set_remove(legal_named_args, arg_name)
+ m4_pushdef([ARG_][]arg_name, m4_substr(arg, m4_incr(m4_incr(m4_bregexp(arg, [: ])))))
+ m4_set_add(defined_args, arg_name)
+ m4_undefine([arg_name])
+ ])
+ m4_set_empty(required_named_args, [], [
+ AC_MSG_ERROR([Internal error: Required named arguments are missing for [$1]. Missing arguments: 'm4_set_contents(required_named_args, [ ])'])
+ ])
+ m4_foreach([arg], m4_indir([m4_dquote]m4_set_listc([legal_named_args])), [
+ m4_pushdef([ARG_][]arg, [])
+ m4_set_add(defined_args, arg)
+ ])
+ m4_set_delete(legal_named_args)
+ m4_set_delete(required_named_args)
+
+ # Execute function body
+ $4
+
+ m4_foreach([arg], m4_indir([m4_dquote]m4_set_listc([defined_args])), [
+ m4_popdef([ARG_][]arg)
+ ])
+
+ m4_set_delete(defined_args)
+ ])
+])
+
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
# If so, then append $1 to $2 \
# Also set JVM_ARG_OK to true/false depending on outcome.
@@ -1122,7 +1190,6 @@ AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
# Move configure.log from current directory to the build output root
if test -e ./configure.log; then
- echo found it
$MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
fi
diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4
index 5c2f1b62642..463498f8471 100644
--- a/common/autoconf/build-performance.m4
+++ b/common/autoconf/build-performance.m4
@@ -251,6 +251,24 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
])
+################################################################################
+#
+# Runs icecc-create-env once and prints the error if it fails
+#
+# $1: arguments to icecc-create-env
+# $2: log file
+#
+AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
+[
+ cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+ && ${ICECC_CREATE_ENV} $1 > $2 2>&1
+ if test "$?" != "0"; then
+ AC_MSG_NOTICE([icecc-create-env output:])
+ cat $2
+ AC_MSG_ERROR([Failed to create icecc compiler environment])
+ fi
+])
+
################################################################################
#
# Optionally enable distributed compilation of native code using icecc/icecream
@@ -271,16 +289,18 @@ AC_DEFUN([BPERF_SETUP_ICECC],
# be sent to the other hosts in the icecream cluster.
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
- AC_MSG_CHECKING([for icecc build environment for target compiler])
+ # Older versions of icecc does not have the --gcc parameter
+ if ${ICECC_CREATE_ENV} | $GREP -q -e --gcc; then
+ icecc_gcc_arg="--gcc"
+ fi
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log}
+ BPERF_RUN_ICECC_CREATE_ENV([${icecc_gcc_arg} ${CC} ${CXX}], \
+ ${icecc_create_env_log})
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
# For clang, the icecc compilerwrapper is needed. It usually resides next
# to icecc-create-env.
BASIC_REQUIRE_PROGS(ICECC_WRAPPER, compilerwrapper)
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
+ BPERF_RUN_ICECC_CREATE_ENV([--clang ${CC} ${ICECC_WRAPPER}], ${icecc_create_env_log})
else
AC_MSG_ERROR([Can only create icecc compiler packages for toolchain types gcc and clang])
fi
@@ -289,24 +309,31 @@ AC_DEFUN([BPERF_SETUP_ICECC],
# to find it.
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
+ if test ! -f ${ICECC_ENV_BUNDLE}; then
+ AC_MSG_ERROR([icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}])
+ fi
+ AC_MSG_CHECKING([for icecc build environment for target compiler])
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
if test "x${COMPILE_TYPE}" = "xcross"; then
# If cross compiling, create a separate env package for the build compiler
- AC_MSG_CHECKING([for icecc build environment for build compiler])
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
+ icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log"
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log}
+ BPERF_RUN_ICECC_CREATE_ENV([${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX}], \
+ ${icecc_create_env_log_build})
elif test "x${BUILD_CC##*/}" = "xclang"; then
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
+ BPERF_RUN_ICECC_CREATE_ENV([--clang ${BUILD_CC} ${ICECC_WRAPPER}], ${icecc_create_env_log_build})
else
AC_MSG_ERROR([Cannot create icecc compiler package for ${BUILD_CC}])
fi
- ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
+ ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log_build}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
+ if test ! -f ${ICECC_ENV_BUNDLE}; then
+ AC_MSG_ERROR([icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}])
+ fi
+ AC_MSG_CHECKING([for icecc build environment for build compiler])
AC_MSG_RESULT([${ICECC_ENV_BUNDLE}])
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
ICECC_CXX=${BUILD_CXX} ${ICECC_CMD}"
diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index e2b54ba9b11..d8f0c85020f 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -128,6 +128,26 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
else
COMPILER_TARGET_BITS_FLAG="-m"
COMPILER_COMMAND_FILE_FLAG="@"
+
+ # The solstudio linker does not support @-files.
+ if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+ COMPILER_COMMAND_FILE_FLAG=
+ fi
+
+ # Check if @file is supported by gcc
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ AC_MSG_CHECKING([if @file is supported by gcc])
+ # Extra emtpy "" to prevent ECHO from interpreting '--version' as argument
+ $ECHO "" "--version" > command.file
+ if $CXX @command.file 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
+ AC_MSG_RESULT(yes)
+ COMPILER_COMMAND_FILE_FLAG="@"
+ else
+ AC_MSG_RESULT(no)
+ COMPILER_COMMAND_FILE_FLAG=
+ fi
+ rm -rf command.file
+ fi
fi
AC_SUBST(COMPILER_TARGET_BITS_FLAG)
AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
@@ -405,7 +425,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
# Add runtime stack smashing and undefined behavior checks.
# Not all versions of gcc support -fstack-protector
STACK_PROTECTOR_CFLAG="-fstack-protector-all"
- FLAGS_COMPILER_CHECK_ARGUMENTS([$STACK_PROTECTOR_CFLAG], [], [STACK_PROTECTOR_CFLAG=""])
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG], IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
@@ -722,7 +742,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
-I${JDK_TOPDIR}/src/java.base/share/native/include \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include \
- -I${JDK_TOPDIR}/src/java.base/share/native/libjava \
+ -I${JDK_TOPDIR}/src/java.base/share/native/libjava \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava"
# The shared libraries are compiled using the picflag.
@@ -876,17 +896,18 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
AC_SUBST(LDFLAGS_TESTEXE)
])
-# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
-# [RUN-IF-FALSE])
+# FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
+# IF_FALSE: [RUN-IF-FALSE])
# ------------------------------------------------------------
# Check that the c and c++ compilers support an argument
-AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
+BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS],
+ [*ARGUMENT IF_TRUE IF_FALSE], [$@],
[
- AC_MSG_CHECKING([if compiler supports "$1"])
+ AC_MSG_CHECKING([if compiler supports "ARG_ARGUMENT"])
supports=yes
saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS $1"
+ CFLAGS="$CFLAGS ARG_ARGUMENT"
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no])
@@ -894,7 +915,7 @@ AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
CFLAGS="$saved_cflags"
saved_cxxflags="$CXXFLAGS"
- CXXFLAGS="$CXXFLAG $1"
+ CXXFLAGS="$CXXFLAG ARG_ARGUMENT"
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
[supports=no])
@@ -903,23 +924,26 @@ AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
AC_MSG_RESULT([$supports])
if test "x$supports" = "xyes" ; then
- m4_ifval([$2], [$2], [:])
+ :
+ ARG_IF_TRUE
else
- m4_ifval([$3], [$3], [:])
+ :
+ ARG_IF_FALSE
fi
])
-# FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
-# [RUN-IF-FALSE])
+# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
+# IF_FALSE: [RUN-IF-FALSE])
# ------------------------------------------------------------
# Check that the linker support an argument
-AC_DEFUN([FLAGS_LINKER_CHECK_ARGUMENTS],
+BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS],
+ [*ARGUMENT IF_TRUE IF_FALSE], [$@],
[
- AC_MSG_CHECKING([if linker supports "$1"])
+ AC_MSG_CHECKING([if linker supports "ARG_ARGUMENT"])
supports=yes
saved_ldflags="$LDFLAGS"
- LDFLAGS="$LDFLAGS $1"
+ LDFLAGS="$LDFLAGS ARG_ARGUMENT"
AC_LANG_PUSH([C])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
[], [supports=no])
@@ -928,9 +952,11 @@ AC_DEFUN([FLAGS_LINKER_CHECK_ARGUMENTS],
AC_MSG_RESULT([$supports])
if test "x$supports" = "xyes" ; then
- m4_ifval([$2], [$2], [:])
+ :
+ ARG_IF_TRUE
else
- m4_ifval([$3], [$3], [:])
+ :
+ ARG_IF_FALSE
fi
])
@@ -945,14 +971,14 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
*)
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
esac
- FLAGS_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""])
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$ZERO_ARCHFLAG], IF_FALSE: [ZERO_ARCHFLAG=""])
AC_SUBST(ZERO_ARCHFLAG)
# Check that the compiler supports -mX (or -qX on AIX) flags
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
- FLAGS_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
- [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
- [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
+ IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
+ IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
@@ -993,9 +1019,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
;;
gcc)
# Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
- FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist],
- [GCC_CAN_DISABLE_WARNINGS=true],
- [GCC_CAN_DISABLE_WARNINGS=false]
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
+ IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true],
+ IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false]
)
if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
DISABLE_WARNING_PREFIX="-Wno-"
@@ -1006,9 +1032,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
# Repeate the check for the BUILD_CC
CC_OLD="$CC"
CC="$BUILD_CC"
- FLAGS_COMPILER_CHECK_ARGUMENTS([-Wno-this-is-a-warning-that-do-not-exist],
- [BUILD_CC_CAN_DISABLE_WARNINGS=true],
- [BUILD_CC_CAN_DISABLE_WARNINGS=false]
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
+ IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true],
+ IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false]
)
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 7993514be60..1f2e61096dd 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -3451,6 +3451,31 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# questions.
#
+# Create a function/macro that takes a series of named arguments. The call is
+# similar to AC_DEFUN, but the setup of the function looks like this:
+# BASIC_DEFUN_NAMED([MYFUNC], [FOO *BAR], [$@], [
+# ... do something
+# AC_MSG_NOTICE([Value of BAR is ARG_BAR])
+# ])
+# A star (*) in front of a named argument means that it is required and it's
+# presence will be verified. To pass e.g. the first value as a normal indexed
+# argument, use [m4_shift($@)] as the third argument instead of [$@]. These
+# arguments are referenced in the function by their name prefixed by ARG_, e.g.
+# "ARG_FOO".
+#
+# The generated function can be called like this:
+# MYFUNC(FOO: [foo-val], BAR:
+# [
+# $ECHO hello world
+# ])
+#
+#
+# Argument 1: Name of the function to define
+# Argument 2: List of legal named arguments, with a * prefix for required arguments
+# Argument 3: Argument array to treat as named, typically $@
+# Argument 4: The main function body
+
+
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
# If so, then append $1 to $2 \
# Also set JVM_ARG_OK to true/false depending on outcome.
@@ -3792,6 +3817,15 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+################################################################################
+#
+# Runs icecc-create-env once and prints the error if it fails
+#
+# $1: arguments to icecc-create-env
+# $2: log file
+#
+
+
################################################################################
#
# Optionally enable distributed compilation of native code using icecc/icecream
@@ -3877,20 +3911,24 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
-# [RUN-IF-FALSE])
+# FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
+# IF_FALSE: [RUN-IF-FALSE])
# ------------------------------------------------------------
# Check that the c and c++ compilers support an argument
-# FLAGS_LINKER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
-# [RUN-IF-FALSE])
+
+
+# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
+# IF_FALSE: [RUN-IF-FALSE])
# ------------------------------------------------------------
# Check that the linker support an argument
+
+
#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4308,7 +4346,7 @@ pkgadd_help() {
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -4801,7 +4839,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1450400041
+DATE_WHEN_GENERATED=1452780299
###############################################################################
#
@@ -45349,6 +45387,54 @@ $as_echo "$as_me: Rewriting BUILD_AR to \"$new_complete\"" >&6;}
# "-Og" suppported for GCC 4.8 and later
CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"" >&5
$as_echo_n "checking if compiler supports \"$CFLAG_OPTIMIZE_DEBUG_FLAG\"... " >&6; }
supports=yes
@@ -45408,15 +45494,76 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
+ :
HAS_CFLAG_OPTIMIZE_DEBUG=true
else
+ :
HAS_CFLAG_OPTIMIZE_DEBUG=false
fi
+
+
+
+
+
+
+
+
+
+
+
# "-z relro" supported in GNU binutils 2.17 and later
LINKER_RELRO_FLAG="-Wl,-z,relro"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_RELRO_FLAG\"" >&5
$as_echo_n "checking if linker supports \"$LINKER_RELRO_FLAG\"... " >&6; }
supports=yes
@@ -45458,15 +45605,76 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
+ :
HAS_LINKER_RELRO=true
else
+ :
HAS_LINKER_RELRO=false
fi
+
+
+
+
+
+
+
+
+
+
+
# "-z now" supported in GNU binutils 2.11 and later
LINKER_NOW_FLAG="-Wl,-z,now"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if linker supports \"$LINKER_NOW_FLAG\"" >&5
$as_echo_n "checking if linker supports \"$LINKER_NOW_FLAG\"... " >&6; }
supports=yes
@@ -45508,11 +45716,24 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
+ :
HAS_LINKER_NOW=true
else
+ :
HAS_LINKER_NOW=false
fi
+
+
+
+
+
+
+
+
+
+
+
fi
# Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
@@ -45930,6 +46151,29 @@ $as_echo "$tool_specified" >&6; }
else
COMPILER_TARGET_BITS_FLAG="-m"
COMPILER_COMMAND_FILE_FLAG="@"
+
+ # The solstudio linker does not support @-files.
+ if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
+ COMPILER_COMMAND_FILE_FLAG=
+ fi
+
+ # Check if @file is supported by gcc
+ if test "x$TOOLCHAIN_TYPE" = xgcc; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if @file is supported by gcc" >&5
+$as_echo_n "checking if @file is supported by gcc... " >&6; }
+ # Extra emtpy "" to prevent ECHO from interpreting '--version' as argument
+ $ECHO "" "--version" > command.file
+ if $CXX @command.file 2>&5 >&5; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ COMPILER_COMMAND_FILE_FLAG="@"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ COMPILER_COMMAND_FILE_FLAG=
+ fi
+ rm -rf command.file
+ fi
fi
@@ -46810,6 +47054,49 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
# Not all versions of gcc support -fstack-protector
STACK_PROTECTOR_CFLAG="-fstack-protector-all"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"" >&5
$as_echo_n "checking if compiler supports \"$STACK_PROTECTOR_CFLAG\"... " >&6; }
supports=yes
@@ -46870,11 +47157,24 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
+
else
+ :
STACK_PROTECTOR_CFLAG=""
fi
+
+
+
+
+
+
+
+
+
+
+
CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
;;
@@ -47352,6 +47652,49 @@ $as_echo "$supports" >&6; }
ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"$ZERO_ARCHFLAG\"" >&5
$as_echo_n "checking if compiler supports \"$ZERO_ARCHFLAG\"... " >&6; }
supports=yes
@@ -47412,15 +47755,76 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
:
+
else
+ :
ZERO_ARCHFLAG=""
fi
+
+
+
+
+
+
+
+
+
+
+
# Check that the compiler supports -mX (or -qX on AIX) flags
# Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"" >&5
$as_echo_n "checking if compiler supports \"${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}\"... " >&6; }
supports=yes
@@ -47480,13 +47884,26 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
+ :
COMPILER_SUPPORTS_TARGET_BITS_FLAG=true
else
+ :
COMPILER_SUPPORTS_TARGET_BITS_FLAG=false
fi
+
+
+
+
+
+
+
+
+
+
+
# Check whether --enable-warnings-as-errors was given.
if test "${enable_warnings_as_errors+set}" = set; then :
enableval=$enable_warnings_as_errors;
@@ -47533,6 +47950,54 @@ $as_echo "yes (default)" >&6; }
gcc)
# Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
$as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
supports=yes
@@ -47592,12 +48057,25 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
+ :
GCC_CAN_DISABLE_WARNINGS=true
else
+ :
GCC_CAN_DISABLE_WARNINGS=false
fi
+
+
+
+
+
+
+
+
+
+
+
if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
DISABLE_WARNING_PREFIX="-Wno-"
else
@@ -47608,6 +48086,54 @@ $as_echo "$supports" >&6; }
CC_OLD="$CC"
CC="$BUILD_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # Execute function body
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"" >&5
$as_echo_n "checking if compiler supports \"-Wno-this-is-a-warning-that-do-not-exist\"... " >&6; }
supports=yes
@@ -47667,12 +48193,25 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5
$as_echo "$supports" >&6; }
if test "x$supports" = "xyes" ; then
+ :
BUILD_CC_CAN_DISABLE_WARNINGS=true
else
+ :
BUILD_CC_CAN_DISABLE_WARNINGS=false
fi
+
+
+
+
+
+
+
+
+
+
+
if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
else
@@ -51750,12 +52289,28 @@ $as_echo "$as_me: WARNING: cups not used, so --with-cups[-*] is ignored" >&2;}
fi
if test "x${with_cups}" != x; then
- CUPS_CFLAGS="-I${with_cups}/include"
- CUPS_FOUND=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
+$as_echo_n "checking for cups headers... " >&6; }
+ if test -s "${with_cups}/include/cups/cups.h"; then
+ CUPS_CFLAGS="-I${with_cups}/include"
+ CUPS_FOUND=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
+$as_echo "$CUPS_FOUND" >&6; }
+ else
+ as_fn_error $? "Can't find 'include/cups/cups.h' under ${with_cups} given with the --with-cups option." "$LINENO" 5
+ fi
fi
if test "x${with_cups_include}" != x; then
- CUPS_CFLAGS="-I${with_cups_include}"
- CUPS_FOUND=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
+$as_echo_n "checking for cups headers... " >&6; }
+ if test -s "${with_cups_include}/cups/cups.h"; then
+ CUPS_CFLAGS="-I${with_cups_include}"
+ CUPS_FOUND=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
+$as_echo "$CUPS_FOUND" >&6; }
+ else
+ as_fn_error $? "Can't find 'cups/cups.h' under ${with_cups_include} given with the --with-cups-include option." "$LINENO" 5
+ fi
fi
if test "x$CUPS_FOUND" = xno; then
# Are the cups headers installed in the default /usr/include location?
@@ -59551,11 +60106,23 @@ $as_echo "$tool_specified" >&6; }
# be sent to the other hosts in the icecream cluster.
icecc_create_env_log="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env.log"
${MKDIR} -p ${CONFIGURESUPPORT_OUTPUTDIR}/icecc
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for target compiler" >&5
-$as_echo_n "checking for icecc build environment for target compiler... " >&6; }
+ # Older versions of icecc does not have the --gcc parameter
+ if ${ICECC_CREATE_ENV} | $GREP -q -e --gcc; then
+ icecc_gcc_arg="--gcc"
+ fi
if test "x${TOOLCHAIN_TYPE}" = "xgcc"; then
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --gcc ${CC} ${CXX} > ${icecc_create_env_log}
+
+ cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+ && ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${CC} ${CXX} > \
+ ${icecc_create_env_log} 2>&1
+ if test "$?" != "0"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
+$as_echo "$as_me: icecc-create-env output:" >&6;}
+ cat \
+ ${icecc_create_env_log}
+ as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
+ fi
+
elif test "x$TOOLCHAIN_TYPE" = "xclang"; then
# For clang, the icecc compilerwrapper is needed. It usually resides next
# to icecc-create-env.
@@ -59763,8 +60330,16 @@ $as_echo "$tool_specified" >&6; }
fi
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
+
+ cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+ && ${ICECC_CREATE_ENV} --clang ${CC} ${ICECC_WRAPPER} > ${icecc_create_env_log} 2>&1
+ if test "$?" != "0"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
+$as_echo "$as_me: icecc-create-env output:" >&6;}
+ cat ${icecc_create_env_log}
+ as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
+ fi
+
else
as_fn_error $? "Can only create icecc compiler packages for toolchain types gcc and clang" "$LINENO" 5
fi
@@ -59773,26 +60348,53 @@ $as_echo "$tool_specified" >&6; }
# to find it.
ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
+ if test ! -f ${ICECC_ENV_BUNDLE}; then
+ as_fn_error $? "icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}" "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for target compiler" >&5
+$as_echo_n "checking for icecc build environment for target compiler... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5
$as_echo "${ICECC_ENV_BUNDLE}" >&6; }
ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${CC} ICECC_CXX=${CXX} ${ICECC_CMD}"
if test "x${COMPILE_TYPE}" = "xcross"; then
# If cross compiling, create a separate env package for the build compiler
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for build compiler" >&5
-$as_echo_n "checking for icecc build environment for build compiler... " >&6; }
# Assume "gcc" or "cc" is gcc and "clang" is clang. Otherwise bail.
+ icecc_create_env_log_build="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/icecc_create_env_build.log"
if test "x${BUILD_CC##*/}" = "xgcc" || test "x${BUILD_CC##*/}" = "xcc"; then
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --gcc ${BUILD_CC} ${BUILD_CXX} > ${icecc_create_env_log}
+
+ cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+ && ${ICECC_CREATE_ENV} ${icecc_gcc_arg} ${BUILD_CC} ${BUILD_CXX} > \
+ ${icecc_create_env_log_build} 2>&1
+ if test "$?" != "0"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
+$as_echo "$as_me: icecc-create-env output:" >&6;}
+ cat \
+ ${icecc_create_env_log_build}
+ as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
+ fi
+
elif test "x${BUILD_CC##*/}" = "xclang"; then
- cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
- && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log}
+
+ cd ${CONFIGURESUPPORT_OUTPUTDIR}/icecc \
+ && ${ICECC_CREATE_ENV} --clang ${BUILD_CC} ${ICECC_WRAPPER} > ${icecc_create_env_log_build} 2>&1
+ if test "$?" != "0"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: icecc-create-env output:" >&5
+$as_echo "$as_me: icecc-create-env output:" >&6;}
+ cat ${icecc_create_env_log_build}
+ as_fn_error $? "Failed to create icecc compiler environment" "$LINENO" 5
+ fi
+
else
as_fn_error $? "Cannot create icecc compiler package for ${BUILD_CC}" "$LINENO" 5
fi
- ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log}`"
+ ICECC_ENV_BUNDLE_BASENAME="`${SED} -n '/^creating/s/creating //p' ${icecc_create_env_log_build}`"
ICECC_ENV_BUNDLE="${CONFIGURESUPPORT_OUTPUTDIR}/icecc/${ICECC_ENV_BUNDLE_BASENAME}"
+ if test ! -f ${ICECC_ENV_BUNDLE}; then
+ as_fn_error $? "icecc-create-env did not produce an environment ${ICECC_ENV_BUNDLE}" "$LINENO" 5
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icecc build environment for build compiler" >&5
+$as_echo_n "checking for icecc build environment for build compiler... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ICECC_ENV_BUNDLE}" >&5
$as_echo "${ICECC_ENV_BUNDLE}" >&6; }
BUILD_ICECC="ICECC_VERSION=${ICECC_ENV_BUNDLE} ICECC_CC=${BUILD_CC} \
@@ -61436,7 +62038,6 @@ fi
# Move configure.log from current directory to the build output root
if test -e ./configure.log; then
- echo found it
$MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
fi
diff --git a/common/autoconf/lib-cups.m4 b/common/autoconf/lib-cups.m4
index 2280edba896..8a61bc04104 100644
--- a/common/autoconf/lib-cups.m4
+++ b/common/autoconf/lib-cups.m4
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 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
@@ -48,12 +48,24 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS],
fi
if test "x${with_cups}" != x; then
- CUPS_CFLAGS="-I${with_cups}/include"
- CUPS_FOUND=yes
+ AC_MSG_CHECKING([for cups headers])
+ if test -s "${with_cups}/include/cups/cups.h"; then
+ CUPS_CFLAGS="-I${with_cups}/include"
+ CUPS_FOUND=yes
+ AC_MSG_RESULT([$CUPS_FOUND])
+ else
+ AC_MSG_ERROR([Can't find 'include/cups/cups.h' under ${with_cups} given with the --with-cups option.])
+ fi
fi
if test "x${with_cups_include}" != x; then
- CUPS_CFLAGS="-I${with_cups_include}"
- CUPS_FOUND=yes
+ AC_MSG_CHECKING([for cups headers])
+ if test -s "${with_cups_include}/cups/cups.h"; then
+ CUPS_CFLAGS="-I${with_cups_include}"
+ CUPS_FOUND=yes
+ AC_MSG_RESULT([$CUPS_FOUND])
+ else
+ AC_MSG_ERROR([Can't find 'cups/cups.h' under ${with_cups_include} given with the --with-cups-include option.])
+ fi
fi
if test "x$CUPS_FOUND" = xno; then
# Are the cups headers installed in the default /usr/include location?
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index 3f5750dcc89..4254d86a4fb 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -75,8 +75,8 @@ AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS],
# For full static builds, we're overloading the SHARED_LIBRARY
# variables in order to limit the amount of changes required.
# It would be better to remove SHARED and just use LIBRARY and
- # LIBRARY_SUFFIX for libraries that can be built either
- # shared or static and use STATIC_* for libraries that are
+ # LIBRARY_SUFFIX for libraries that can be built either
+ # shared or static and use STATIC_* for libraries that are
# always built statically.
if test "x$STATIC_BUILD" = xtrue; then
SHARED_LIBRARY='lib[$]1.a'
@@ -824,21 +824,21 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
# "-Og" suppported for GCC 4.8 and later
CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
- FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG],
- [HAS_CFLAG_OPTIMIZE_DEBUG=true],
- [HAS_CFLAG_OPTIMIZE_DEBUG=false])
+ FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CFLAG_OPTIMIZE_DEBUG_FLAG],
+ IF_TRUE: [HAS_CFLAG_OPTIMIZE_DEBUG=true],
+ IF_FALSE: [HAS_CFLAG_OPTIMIZE_DEBUG=false])
# "-z relro" supported in GNU binutils 2.17 and later
LINKER_RELRO_FLAG="-Wl,-z,relro"
- FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
- [HAS_LINKER_RELRO=true],
- [HAS_LINKER_RELRO=false])
+ FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [$LINKER_RELRO_FLAG],
+ IF_TRUE: [HAS_LINKER_RELRO=true],
+ IF_FALSE: [HAS_LINKER_RELRO=false])
# "-z now" supported in GNU binutils 2.11 and later
LINKER_NOW_FLAG="-Wl,-z,now"
- FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
- [HAS_LINKER_NOW=true],
- [HAS_LINKER_NOW=false])
+ FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [$LINKER_NOW_FLAG],
+ IF_TRUE: [HAS_LINKER_NOW=true],
+ IF_FALSE: [HAS_LINKER_NOW=false])
fi
# Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed
diff --git a/corba/.hgtags b/corba/.hgtags
index 9bd082d87fd..621cce92dcc 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -342,3 +342,5 @@ feb1bd85d7990dcf5584ca9e53104269c01db006 jdk-9+96
10a482b863582376d4ca229090334b23b05159fc jdk-9+97
ea285530245cf4e0edf0479121a41347d3030eba jdk-9+98
180212ee1d8710691ba9944593dfc1ff3e4f1532 jdk-9+99
+791d0d3ac0138faeb6110bd840a4545bc1950df2 jdk-9+100
+30dfb3bd3d06b4bb80a087babc0d1841edba187b jdk-9+101
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index ac6cea4d970..2861744a267 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -502,3 +502,5 @@ a94bb7203596dd632486f1e3655fa5f70541dc08 jdk-9+96
de592ea5f7ba0f8a8c5afc03bd169f7690c72b6f jdk-9+97
e5b1a23be1e105417ba1c4c576ab373eb3fa2c2b jdk-9+98
f008e8cc10d5b3212fb22d58c96fa01d38654f19 jdk-9+99
+bdb0acafc63c42e84d9d8195bf2e2b25ee9c3306 jdk-9+100
+9f45d3d57d6948cf526fbc2e2891a9a74ac6941a jdk-9+101
diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
index 463b42180d2..b416aa7c65c 100644
--- a/hotspot/src/share/vm/prims/jvm.cpp
+++ b/hotspot/src/share/vm/prims/jvm.cpp
@@ -285,7 +285,7 @@ JVM_LEAF(jlong, JVM_NanoTime(JNIEnv *env, jclass ignored))
return os::javaTimeNanos();
JVM_END
-// The function below is actually exposed by sun.misc.VM and not
+// The function below is actually exposed by jdk.internal.misc.VM and not
// java.lang.System, but we choose to keep it here so that it stays next
// to JVM_CurrentTimeMillis and JVM_NanoTime
diff --git a/hotspot/src/share/vm/prims/nativeLookup.cpp b/hotspot/src/share/vm/prims/nativeLookup.cpp
index fecef0a5055..d54f711c67d 100644
--- a/hotspot/src/share/vm/prims/nativeLookup.cpp
+++ b/hotspot/src/share/vm/prims/nativeLookup.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -124,7 +124,7 @@ static JNINativeMethod lookup_special_native_methods[] = {
{ CC"Java_jdk_internal_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) },
{ CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) },
{ CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) },
- { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) },
+ { CC"Java_jdk_internal_perf_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) },
{ CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) },
#if INCLUDE_JVMCI
{ CC"Java_jdk_vm_ci_runtime_JVMCI_initializeRuntime", NULL, FN_PTR(JVM_GetJVMCIRuntime) },
diff --git a/hotspot/src/share/vm/prims/perf.cpp b/hotspot/src/share/vm/prims/perf.cpp
index 435cb0146cb..1cbb9568298 100644
--- a/hotspot/src/share/vm/prims/perf.cpp
+++ b/hotspot/src/share/vm/prims/perf.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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,7 +34,7 @@
#include "runtime/perfMemory.hpp"
/*
- * Implementation of class sun.misc.Perf
+ * Implementation of class jdk.internal.perf.Perf
*/
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index a88e7f5e4e5..89a01eeb6d6 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -342,3 +342,5 @@ c8d0845877a811ab4350935892f826929359a3ff jdk-9+95
9c107c050335d7ee63b2a8b38ca5d498f19713a2 jdk-9+97
52b01339235f24c93b679bd6b8fb36a1072ad0ac jdk-9+98
52774b544850c791f1d1c67db2601b33739b18c9 jdk-9+99
+d45bcd374f6057851e3c2dcd45607cd362afadfa jdk-9+100
+d3e834ff74e724a2b92a558e18e8cbf81c6dbc59 jdk-9+101
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java
index ee6a29bfa26..7be69b9ea29 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogImpl.java
@@ -32,7 +32,6 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
@@ -43,6 +42,7 @@ import java.util.stream.StreamSupport;
import static javax.xml.catalog.BaseEntry.CatalogEntryType;
import static javax.xml.catalog.CatalogFeatures.DEFER_TRUE;
import javax.xml.catalog.CatalogFeatures.Feature;
+import static javax.xml.catalog.CatalogMessages.formatMessage;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
@@ -109,25 +109,20 @@ class CatalogImpl extends GroupEntry implements Catalog {
*/
public CatalogImpl(CatalogImpl parent, CatalogFeatures f, String... file) throws CatalogException {
super(CatalogEntryType.CATALOG);
- this.parent = parent;
- if (parent == null) {
- level = 0;
- } else {
- level = parent.level + 1;
- }
if (f == null) {
- this.features = CatalogFeatures.defaults();
- } else {
- this.features = f;
+ throw new NullPointerException(
+ formatMessage(CatalogMessages.ERR_NULL_ARGUMENT, new Object[]{"CatalogFeatures"}));
}
- setPrefer(features.get(Feature.PREFER));
- setDeferred(features.get(Feature.DEFER));
- setResolve(features.get(Feature.RESOLVE));
+
+ if (file.length > 0) {
+ CatalogMessages.reportNPEOnNull("The path to the catalog file", file[0]);
+ }
+
+ init(parent, f);
//Path of catalog files
String[] catalogFile = file;
- if (level == 0
- && (file == null || (file.length == 0 || file[0] == null))) {
+ if (level == 0 && file.length == 0) {
String files = features.get(Feature.FILES);
if (files != null) {
catalogFile = files.split(";[ ]*");
@@ -166,6 +161,23 @@ class CatalogImpl extends GroupEntry implements Catalog {
}
}
+ private void init(CatalogImpl parent, CatalogFeatures f) {
+ this.parent = parent;
+ if (parent == null) {
+ level = 0;
+ } else {
+ level = parent.level + 1;
+ }
+ if (f == null) {
+ this.features = CatalogFeatures.defaults();
+ } else {
+ this.features = f;
+ }
+ setPrefer(features.get(Feature.PREFER));
+ setDeferred(features.get(Feature.DEFER));
+ setResolve(features.get(Feature.RESOLVE));
+ }
+
/**
* Resets the Catalog instance to its initial state.
*/
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java
index 7539ec00be9..2e3c5b4f74b 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogManager.java
@@ -38,33 +38,38 @@ public final class CatalogManager {
}
/**
- * Creates a Catalog object using the specified feature settings and path to
- * a catalog file. If the features is null, the default features will be used.
- * If the path is empty, System property {@code javax.xml.catalog.files} will
- * be read to locate the initial list of catalog files.
+ * Creates a {@code Catalog} object using the specified feature settings and
+ * path to one or more catalog files.
*
- * If more than one catalog files are specified through the path argument or
+ * If {@code paths} is empty, system property {@code javax.xml.catalog.files}
+ * will be read to locate the initial list of catalog files.
+ *
+ * If more than one catalog files are specified through the paths argument or
* {@code javax.xml.catalog.files} property, the first entry is considered
* the main catalog, while others are treated as alternative catalogs after
* those referenced by the {@code nextCatalog} elements in the main catalog.
+ *
+ * As specified in
+ *
+ * XML Catalogs, OASIS Standard V1.1 , invalid path entries will be ignored.
+ * No error will be reported. In case all entries are invalid, the resolver
+ * will return as no mapping is found.
*
* @param features the catalog features
- * @param path path(s) to one or more catalogs.
+ * @param paths path(s) to one or more catalogs.
*
- * @return a catalog instance
- * @throws CatalogException If no catalog can be found whether through the
- * specified path or the System property {@code javax.xml.catalog.files}, or
- * an error occurs while parsing the catalog
+ * @return an instance of a {@code Catalog}
+ * @throws CatalogException If an error occurs while parsing the catalog
*/
- public static Catalog catalog(CatalogFeatures features, String... path) {
- return new CatalogImpl(features, path);
+ public static Catalog catalog(CatalogFeatures features, String... paths) {
+ return new CatalogImpl(features, paths);
}
/**
- * Creates an instance of a CatalogResolver using the specified catalog.
+ * Creates an instance of a {@code CatalogResolver} using the specified catalog.
*
* @param catalog the catalog instance
- * @return an instance of a CatalogResolver
+ * @return an instance of a {@code CatalogResolver}
*/
public static CatalogResolver catalogResolver(Catalog catalog) {
if (catalog == null) CatalogMessages.reportNPEOnNull("catalog", null);
@@ -72,10 +77,10 @@ public final class CatalogManager {
}
/**
- * Creates an instance of a CatalogUriResolver using the specified catalog.
+ * Creates an instance of a {@code CatalogUriResolver} using the specified catalog.
*
* @param catalog the catalog instance
- * @return an instance of a CatalogResolver
+ * @return an instance of a {@code CatalogResolver}
*/
public static CatalogUriResolver catalogUriResolver(Catalog catalog) {
if (catalog == null) CatalogMessages.reportNPEOnNull("catalog", null);
@@ -83,50 +88,60 @@ public final class CatalogManager {
}
/**
- * Creates an instance of a CatalogResolver using the specified feature settings
- * and path to a catalog file. If the features is null, the default features will
- * be used. If the path is empty, System property {@code javax.xml.catalog.files}
+ * Creates an instance of a {@code CatalogResolver} using the specified feature
+ * settings and path to one or more catalog files.
+ *
+ * If {@code paths} is empty, system property {@code javax.xml.catalog.files}
* will be read to locate the initial list of catalog files.
*
- * If more than one catalog files are specified through the path argument or
+ * If more than one catalog files are specified through the paths argument or
* {@code javax.xml.catalog.files} property, the first entry is considered
* the main catalog, while others are treated as alternative catalogs after
* those referenced by the {@code nextCatalog} elements in the main catalog.
+ *
+ * As specified in
+ *
+ * XML Catalogs, OASIS Standard V1.1 , invalid path entries will be ignored.
+ * No error will be reported. In case all entries are invalid, the resolver
+ * will return as no mapping is found.
*
* @param features the catalog features
- * @param path the path(s) to one or more catalogs
+ * @param paths the path(s) to one or more catalogs
*
- * @return an instance of a CatalogResolver
- * @throws CatalogException If no catalog can be found whether through the
- * specified path or the System property {@code javax.xml.catalog.files}, or
- * an error occurs while parsing the catalog
+ * @return an instance of a {@code CatalogResolver}
+ * @throws CatalogException If an error occurs while parsing the catalog
*/
- public static CatalogResolver catalogResolver(CatalogFeatures features, String... path) {
- Catalog catalog = catalog(features, path);
+ public static CatalogResolver catalogResolver(CatalogFeatures features, String... paths) {
+ Catalog catalog = catalog(features, paths);
return new CatalogResolverImpl(catalog);
}
/**
- * Creates an instance of a CatalogUriResolver using the specified feature settings
- * and path to a catalog file. If the features is null, the default features will
- * be used. If the path is empty, System property {@code javax.xml.catalog.files}
+ * Creates an instance of a {@code CatalogUriResolver} using the specified
+ * feature settings and path to one or more catalog files.
+ *
+ * If {@code paths} is empty, system property {@code javax.xml.catalog.files}
* will be read to locate the initial list of catalog files.
*
- * If more than one catalog files are specified through the path argument or
+ * If more than one catalog files are specified through the paths argument or
* {@code javax.xml.catalog.files} property, the first entry is considered
* the main catalog, while others are treated as alternative catalogs after
* those referenced by the {@code nextCatalog} elements in the main catalog.
+ *
+ * As specified in
+ *
+ * XML Catalogs, OASIS Standard V1.1 , invalid path entries will be ignored.
+ * No error will be reported. In case all entries are invalid, the resolver
+ * will return as no mapping is found.
*
* @param features the catalog features
- * @param path the path(s) to one or more catalogs
+ * @param paths the path(s) to one or more catalogs
*
- * @return an instance of a CatalogResolver
- * @throws CatalogException If no catalog can be found whether through the
- * specified path or the System property {@code javax.xml.catalog.files}, or
- * an error occurs while parsing the catalog
+ * @return an instance of a {@code CatalogUriResolver}
+ * @throws CatalogException If an error occurs while parsing the catalog
*/
- public static CatalogUriResolver catalogUriResolver(CatalogFeatures features, String... path) {
- Catalog catalog = catalog(features, path);
+ public static CatalogUriResolver catalogUriResolver(CatalogFeatures features, String... paths) {
+ Catalog catalog = catalog(features, paths);
return new CatalogUriResolverImpl(catalog);
}
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolver.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolver.java
index 13c0e3791e4..76ba60dd2eb 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolver.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/CatalogUriResolver.java
@@ -43,9 +43,9 @@ public interface CatalogUriResolver extends URIResolver {
* absolute if the absolute URI is required
*
* @return a {@link javax.xml.transform.Source} object if a mapping is found.
- * If no mapping is found, returns a {@link javax.xml.transform.Source} object
- * containing an empty {@link java.io.Reader} if the
- * {@code javax.xml.catalog.resolve} property is set to {@code ignore};
+ * If no mapping is found, returns an empty {@link javax.xml.transform.Source}
+ * object if the {@code javax.xml.catalog.resolve} property is set to
+ * {@code ignore};
* returns a {@link javax.xml.transform.Source} object with the original URI
* (href, or href resolved with base if base is not null) if the
* {@code javax.xml.catalog.resolve} property is set to {@code continue}.
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteSystem.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteSystem.java
index cf136f2cd59..f3f470243d5 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteSystem.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteSystem.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -72,6 +72,7 @@ final class RewriteSystem extends BaseEntry {
public String getSystemIdStartString () {
return systemIdStartString;
}
+
/**
* Get the rewritePrefix attribute.
* @return The rewritePrefix attribute value.
@@ -80,7 +81,6 @@ final class RewriteSystem extends BaseEntry {
return rewritePrefix;
}
-
/**
* Try to match the specified systemId with the entry. Return the match if it
* is successful and the length of the systemIdStartString is longer than the
@@ -91,14 +91,20 @@ final class RewriteSystem extends BaseEntry {
* @return The replacement URI if the match is successful, null if not.
*/
public String match(String systemId, int currentMatch) {
- if (systemIdStartString.length() <= systemId.length() &&
+ if (systemIdStartString.length() < systemId.length() &&
systemIdStartString.equals(systemId.substring(0, systemIdStartString.length()))) {
if (currentMatch < systemIdStartString.length()) {
String prefix = rewritePrefix.toExternalForm();
- if (!prefix.endsWith(SLASH) && !systemId.startsWith(SLASH)) {
- return prefix + SLASH + systemId.substring(systemIdStartString.length());
+ String sysId;
+ if (systemIdStartString.endsWith(SLASH)) {
+ sysId = systemId.substring(systemIdStartString.length());
} else {
- return prefix + systemId.substring(systemIdStartString.length());
+ sysId = systemId.substring(systemIdStartString.length() + 1);
+ }
+ if (prefix.endsWith(SLASH)) {
+ return prefix + sysId;
+ } else {
+ return prefix + SLASH + sysId;
}
}
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteUri.java b/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteUri.java
index 0aec4e41d29..f5c60b06730 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteUri.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/RewriteUri.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -72,6 +72,7 @@ final class RewriteUri extends BaseEntry {
public String getURIStartString () {
return uriStartString;
}
+
/**
* Get the rewritePrefix attribute.
* @return The rewritePrefix attribute value.
@@ -91,14 +92,20 @@ final class RewriteUri extends BaseEntry {
*/
@Override
public String match(String systemId, int currentMatch) {
- if (uriStartString.length() <= systemId.length() &&
+ if (uriStartString.length() < systemId.length() &&
uriStartString.equals(systemId.substring(0, uriStartString.length()))) {
if (currentMatch < uriStartString.length()) {
String prefix = rewritePrefix.toExternalForm();
- if (!prefix.endsWith(SLASH) && !systemId.startsWith(SLASH)) {
- return prefix + SLASH + systemId.substring(uriStartString.length());
+ String sysId;
+ if (uriStartString.endsWith(SLASH)) {
+ sysId = systemId.substring(uriStartString.length());
} else {
- return prefix + systemId.substring(uriStartString.length());
+ sysId = systemId.substring(uriStartString.length() + 1);
+ }
+ if (prefix.endsWith(SLASH)) {
+ return prefix + sysId;
+ } else {
+ return prefix + SLASH + sysId;
}
}
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/Source.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/Source.java
index fe3d7111439..a9b75f2c42f 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/Source.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/Source.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -52,4 +52,17 @@ public interface Source {
* if setSystemId was not called.
*/
public String getSystemId();
+
+ /**
+ * Indicates whether the {@code Source} object is empty. Empty means
+ * that there is no input available from this Source.
+ *
+ * @implSpec The default implementation of this method throws
+ * {@link UnsupportedOperationException}.
+ *
+ * @return true if the {@code Source} object is empty, false otherwise
+ */
+ default boolean isEmpty() {
+ throw new UnsupportedOperationException("The isEmpty method is not supported.");
+ }
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/dom/DOMSource.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/dom/DOMSource.java
index dc4e93e07f1..b977c14f035 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/dom/DOMSource.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/dom/DOMSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -122,6 +122,7 @@ public class DOMSource implements Source {
*
* @param systemID Base URL for this DOM tree.
*/
+ @Override
public void setSystemId(String systemID) {
this.systemID = systemID;
}
@@ -132,7 +133,25 @@ public class DOMSource implements Source {
*
* @return Base URL for this DOM tree.
*/
+ @Override
public String getSystemId() {
return this.systemID;
}
+
+ /**
+ * Indicates whether the {@code DOMSource} object is empty. Empty is
+ * defined as follows:
+ *
+ * if the system identifier and node are {@code null};
+ *
+ * if the system identifier is null, and the {@code node} has no child nodes.
+ *
+ *
+ *
+ * @return true if the {@code DOMSource} object is empty, false otherwise
+ */
+ @Override
+ public boolean isEmpty() {
+ return systemID == null && (node == null || !node.hasChildNodes());
+ }
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/sax/SAXSource.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/sax/SAXSource.java
index 0d573780e56..1829042e899 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/sax/SAXSource.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/sax/SAXSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -147,6 +147,7 @@ public class SAXSource implements Source {
*
* @param systemId The system identifier as a URI string.
*/
+ @Override
public void setSystemId(String systemId) {
if (null == inputSource) {
@@ -162,6 +163,7 @@ public class SAXSource implements Source {
*
* @return Base URL for the Source
, or null
.
*/
+ @Override
public String getSystemId() {
if (inputSource == null) {
@@ -207,4 +209,22 @@ public class SAXSource implements Source {
return null;
}
}
+
+ /**
+ * Indicates whether the {@code SAXSource} object is empty. Empty is
+ * defined as follows:
+ *
+ * if the system identifier and {@code InputSource} are {@code null};
+ *
+ * if the system identifier is {@code null}, and the {@code InputSource}
+ * is empty.
+ *
+ *
+ *
+ * @return true if the {@code SAXSource} object is empty, false otherwise
+ */
+ @Override
+ public boolean isEmpty() {
+ return getSystemId() == null && (inputSource == null || inputSource.isEmpty());
+ }
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/stax/StAXSource.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/stax/StAXSource.java
index dd04b63fb69..43e17c6e14e 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/stax/StAXSource.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/stax/StAXSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -209,6 +209,7 @@ public class StAXSource implements Source {
* @throws UnsupportedOperationException Is always
* thrown by this method.
*/
+ @Override
public void setSystemId(final String systemId) {
throw new UnsupportedOperationException(
@@ -229,8 +230,21 @@ public class StAXSource implements Source {
*
* @return System identifier used by this StAXSource
.
*/
+ @Override
public String getSystemId() {
return systemId;
}
+
+ /**
+ * Indicates whether the {@code StAXSource} object is empty. Since a
+ * {@code StAXSource} object can never be empty, this method always returns
+ * false.
+ *
+ * @return unconditionally false
+ */
+ @Override
+ public boolean isEmpty() {
+ return false;
+ }
}
diff --git a/jaxp/src/java.xml/share/classes/javax/xml/transform/stream/StreamSource.java b/jaxp/src/java.xml/share/classes/javax/xml/transform/stream/StreamSource.java
index 7627d5e3b55..a708db3017d 100644
--- a/jaxp/src/java.xml/share/classes/javax/xml/transform/stream/StreamSource.java
+++ b/jaxp/src/java.xml/share/classes/javax/xml/transform/stream/StreamSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -26,8 +26,10 @@
package javax.xml.transform.stream;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
+import javax.xml.transform.Result;
import javax.xml.transform.Source;
@@ -233,6 +235,7 @@ public class StreamSource implements Source {
*
* @param systemId The system identifier as a URL string.
*/
+ @Override
public void setSystemId(String systemId) {
this.systemId = systemId;
}
@@ -243,6 +246,7 @@ public class StreamSource implements Source {
* @return The system identifier that was set with setSystemId, or null
* if setSystemId was not called.
*/
+ @Override
public String getSystemId() {
return systemId;
}
@@ -259,6 +263,59 @@ public class StreamSource implements Source {
this.systemId = f.toURI().toASCIIString();
}
+ /**
+ * Indicates whether the {@code StreamSource} object is empty. Empty is
+ * defined as follows:
+ *
+ *
+ * In case of error while checking the byte or character stream, the method
+ * will return false to allow the XML processor to handle the error.
+ *
+ * @return true if the {@code StreamSource} object is empty, false otherwise
+ */
+ @Override
+ public boolean isEmpty() {
+ return (publicId == null && systemId == null && isStreamEmpty());
+ }
+
+ private boolean isStreamEmpty() {
+ boolean empty = true;
+ try {
+ if (inputStream != null) {
+ inputStream.reset();
+ int bytesRead = inputStream.available();
+ if (bytesRead > 0) {
+ return false;
+ }
+ }
+
+ if (reader != null) {
+ reader.reset();
+ int c = reader.read();
+ reader.reset();
+ if (c != -1) {
+ return false;
+ }
+ }
+ } catch (IOException ex) {
+ //in case of error, return false
+ return false;
+ }
+
+ return empty;
+ }
+
//////////////////////////////////////////////////////////////////////
// Internal state.
//////////////////////////////////////////////////////////////////////
diff --git a/jaxp/src/java.xml/share/classes/org/xml/sax/InputSource.java b/jaxp/src/java.xml/share/classes/org/xml/sax/InputSource.java
index 9498da395c7..f05d23f5108 100644
--- a/jaxp/src/java.xml/share/classes/org/xml/sax/InputSource.java
+++ b/jaxp/src/java.xml/share/classes/org/xml/sax/InputSource.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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,6 +30,7 @@
package org.xml.sax;
+import java.io.IOException;
import java.io.Reader;
import java.io.InputStream;
@@ -343,8 +344,57 @@ public class InputSource {
return characterStream;
}
+ /**
+ * Indicates whether the {@code InputSource} object is empty. Empty is
+ * defined as follows:
+ *
+ *
+ * In case of error while checking the byte or character stream, the method
+ * will return false to allow the XML processor to handle the error.
+ *
+ * @return true if the {@code InputSource} object is empty, false otherwise
+ */
+ public boolean isEmpty() {
+ return (publicId == null && systemId == null && isStreamEmpty());
+ }
+ private boolean isStreamEmpty() {
+ boolean empty = true;
+ try {
+ if (byteStream != null) {
+ byteStream.reset();
+ int bytesRead = byteStream.available();
+ if (bytesRead > 0) {
+ return false;
+ }
+ }
+ if (characterStream != null) {
+ characterStream.reset();
+ int c = characterStream.read();
+ characterStream.reset();
+ if (c != -1) {
+ return false;
+ }
+ }
+ } catch (IOException ex) {
+ //in case of error, return false
+ return false;
+ }
+
+ return empty;
+ }
////////////////////////////////////////////////////////////////////
// Internal state.
////////////////////////////////////////////////////////////////////
diff --git a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java
index cde6fafa8cc..a0066a9a0e5 100644
--- a/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java
+++ b/jaxp/test/javax/xml/jaxp/functional/catalog/DeferFeatureTest.java
@@ -56,23 +56,14 @@ public class DeferFeatureTest {
@DataProvider(name = "catalog-countOfLoadedCatalogFile")
private Object[][] data() {
- return new Object[][] {
- // This catalog specifies null catalog explicitly,
- // and the count of loaded catalogs should be 0.
- { createCatalog(null), 0 },
-
- // This catalog specifies null catalog implicitly,
- // and the count of loaded catalogs should be 0.
- { createCatalog(CatalogFeatures.defaults()), 0 },
-
- // This catalog loads null catalog with true DEFER,
- // and the count of loaded catalogs should be 0.
- { createCatalog(createDeferFeature(DEFER_TRUE)), 0 },
-
- // This catalog loads null catalog with false DEFER.
- // It should load all of none-current catalogs and the
- // count of loaded catalogs should be 3.
- { createCatalog(createDeferFeature(DEFER_FALSE)), 3 } };
+ return new Object[][]{
+ // By default, alternative catalogs are not loaded.
+ {createCatalog(CatalogFeatures.defaults()), 0},
+ // Alternative catalogs are not loaded when DEFER is set to true.
+ {createCatalog(createDeferFeature(DEFER_TRUE)), 0},
+ // The 3 alternative catalogs are not pre-loaded
+ //when DEFER is set to false.
+ {createCatalog(createDeferFeature(DEFER_FALSE)), 3}};
}
private CatalogFeatures createDeferFeature(String defer) {
diff --git a/jaxp/test/javax/xml/jaxp/libs/catalog/CatalogTestUtils.java b/jaxp/test/javax/xml/jaxp/libs/catalog/CatalogTestUtils.java
index 291d86d02c0..0e0ff9f194c 100644
--- a/jaxp/test/javax/xml/jaxp/libs/catalog/CatalogTestUtils.java
+++ b/jaxp/test/javax/xml/jaxp/libs/catalog/CatalogTestUtils.java
@@ -83,7 +83,7 @@ final class CatalogTestUtils {
* Creates CatalogResolver with a set of catalogs.
*/
static CatalogResolver catalogResolver(String... catalogName) {
- return catalogResolver(null, catalogName);
+ return catalogResolver(CatalogFeatures.defaults(), catalogName);
}
/*
@@ -91,15 +91,16 @@ final class CatalogTestUtils {
*/
static CatalogResolver catalogResolver(CatalogFeatures features,
String... catalogName) {
- return CatalogManager.catalogResolver(features,
- getCatalogPaths(catalogName));
+ return (catalogName == null) ?
+ CatalogManager.catalogResolver(features) :
+ CatalogManager.catalogResolver(features, getCatalogPaths(catalogName));
}
/*
* Creates catalogUriResolver with a set of catalogs.
*/
static CatalogUriResolver catalogUriResolver(String... catalogName) {
- return catalogUriResolver(null, catalogName);
+ return catalogUriResolver(CatalogFeatures.defaults(), catalogName);
}
/*
@@ -107,8 +108,9 @@ final class CatalogTestUtils {
*/
static CatalogUriResolver catalogUriResolver(
CatalogFeatures features, String... catalogName) {
- return CatalogManager.catalogUriResolver(features,
- getCatalogPaths(catalogName));
+ return (catalogName == null) ?
+ CatalogManager.catalogUriResolver(features) :
+ CatalogManager.catalogUriResolver(features, getCatalogPaths(catalogName));
}
// Gets the paths of the specified catalogs.
diff --git a/jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java b/jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java
index a7f18083d30..8269f05eee1 100644
--- a/jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java
+++ b/jaxp/test/javax/xml/jaxp/libs/jaxp/library/JAXPTestUtilities.java
@@ -89,7 +89,7 @@ public class JAXPTestUtilities {
/**
* BOM table for storing BOM header.
*/
- private final static Map bom = new HashMap();
+ private final static Map bom = new HashMap<>();
/**
* Initialize all BOM headers.
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
index a9515da6676..08830042132 100644
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
+++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogTest.java
@@ -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
@@ -27,14 +27,13 @@ import javax.xml.catalog.CatalogFeatures;
import javax.xml.catalog.CatalogFeatures.Feature;
import javax.xml.catalog.CatalogManager;
import javax.xml.catalog.CatalogResolver;
+import javax.xml.catalog.CatalogUriResolver;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import static jaxp.library.JAXPTestUtilities.getPathByClassName;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
-import org.w3c.dom.Element;
import org.xml.sax.Attributes;
import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
@@ -42,11 +41,65 @@ import org.xml.sax.XMLReader;
import org.xml.sax.ext.DefaultHandler2;
/*
- * @bug 8081248
+ * @bug 8081248, 8144966, 8146606
* @summary Tests basic Catalog functions.
*/
public class CatalogTest {
+ /*
+ @bug 8146606
+ Verifies that the resulting systemId does not contain duplicate slashes
+ */
+ public void testRewriteSystem() {
+ String catalog = getClass().getResource("rewriteCatalog.xml").getFile();
+
+ try {
+ CatalogResolver resolver = CatalogManager.catalogResolver(CatalogFeatures.defaults(), catalog);
+ String actualSystemId = resolver.resolveEntity(null, "http://remote.com/dtd/book.dtd").getSystemId();
+ Assert.assertTrue(!actualSystemId.contains("//"), "result contains duplicate slashes");
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+
+ }
+
+ /*
+ @bug 8146606
+ Verifies that the resulting systemId does not contain duplicate slashes
+ */
+ public void testRewriteUri() {
+ String catalog = getClass().getResource("rewriteCatalog.xml").getFile();
+
+ try {
+
+ CatalogUriResolver resolver = CatalogManager.catalogUriResolver(CatalogFeatures.defaults(), catalog);
+ String actualSystemId = resolver.resolve("http://remote.com/import/import.xsl", null).getSystemId();
+ Assert.assertTrue(!actualSystemId.contains("//"), "result contains duplicate slashes");
+ } catch (Exception e) {
+ Assert.fail(e.getMessage());
+ }
+ }
+
+ /*
+ @bug 8144966
+ Verifies that passing null as CatalogFeatures will result in a NPE.
+ */
+ @Test(expectedExceptions = NullPointerException.class)
+ public void testFeatureNull() {
+ CatalogResolver resolver = CatalogManager.catalogResolver(null, "");
+
+ }
+
+ /*
+ @bug 8144966
+ Verifies that passing null as the path will result in a NPE.
+ */
+ @Test(expectedExceptions = NullPointerException.class)
+ public void testPathNull() {
+ String path = null;
+ CatalogResolver resolver = CatalogManager.catalogResolver(CatalogFeatures.defaults(), path);
+ }
+
/*
Tests basic catalog feature by using a CatalogResolver instance to
resolve a DTD reference to a locally specified DTD file. If the resolution
@@ -61,7 +114,7 @@ public class CatalogTest {
}
String url = getClass().getResource(xml).getFile();
try {
- CatalogResolver cr = CatalogManager.catalogResolver(null, catalog);
+ CatalogResolver cr = CatalogManager.catalogResolver(CatalogFeatures.defaults(), catalog);
XMLReader reader = saxParser.getXMLReader();
reader.setEntityResolver(cr);
MyHandler handler = new MyHandler(saxParser);
@@ -84,7 +137,7 @@ public class CatalogTest {
String test = "testInvalidCatalog";
try {
- CatalogResolver resolver = CatalogManager.catalogResolver(null, catalog);
+ CatalogResolver resolver = CatalogManager.catalogResolver(CatalogFeatures.defaults(), catalog);
String actualSystemId = resolver.resolveEntity(null, "http://remote/xml/dtd/sys/alice/docAlice.dtd").getSystemId();
} catch (Exception e) {
String msg = e.getMessage();
diff --git a/jaxp/test/javax/xml/jaxp/unittest/catalog/rewriteCatalog.xml b/jaxp/test/javax/xml/jaxp/unittest/catalog/rewriteCatalog.xml
new file mode 100644
index 00000000000..8ef5c9b0117
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/rewriteCatalog.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/jaxp/test/javax/xml/jaxp/unittest/common/Sources.java b/jaxp/test/javax/xml/jaxp/unittest/common/Sources.java
new file mode 100644
index 00000000000..f3deba62395
--- /dev/null
+++ b/jaxp/test/javax/xml/jaxp/unittest/common/Sources.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package common;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.stream.XMLEventReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stax.StAXSource;
+import javax.xml.transform.stream.StreamSource;
+import org.testng.Assert;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+/*
+ * @bug 8144967
+ * @summary Tests related to the javax.xml.transform.Source
+ * and org.xml.sax.InputSource
+ */
+public class Sources {
+
+ /**
+ * @bug 8144967
+ * Tests whether a Source object is empty
+ * @param source the Source object
+ */
+ @Test(dataProvider = "emptySources")
+ public void testIsEmpty(Source source) {
+ Assert.assertTrue(source.isEmpty(), "The source is not empty");
+ }
+
+ /**
+ * @bug 8144967
+ * Tests that the source is not empty
+ * @param source the Source object
+ */
+ @Test(dataProvider = "nonEmptySources")
+ public void testIsNotEmpty(Source source) {
+ Assert.assertTrue(!source.isEmpty(), "The source is empty");
+ }
+
+ /**
+ * @bug 8144967
+ * Tests whether an InputSource object is empty
+ * @param source the InputSource object
+ */
+ @Test(dataProvider = "emptyInputSource")
+ public void testISIsEmpty(InputSource source) {
+ Assert.assertTrue(source.isEmpty(), "The source is not empty");
+ }
+
+ /*
+ * DataProvider: sources that are empty
+ */
+ @DataProvider(name = "emptySources")
+ Object[][] getSources() throws URISyntaxException {
+
+ return new Object[][]{
+ {new DOMSource()},
+ {new DOMSource(getDocument())},
+ {new SAXSource()},
+ {new SAXSource(new InputSource(new StringReader("")))},
+ {new SAXSource(getXMLReader(), new InputSource(new StringReader("")))},
+ {new StreamSource()},
+ {new StreamSource(new ByteArrayInputStream("".getBytes()))},
+ {new StreamSource(new StringReader(""))},
+ {new StreamSource(new StringReader(""), null)},
+ {new StreamSource((String) null)}
+ };
+ }
+
+ /*
+ * DataProvider: sources that are not empty
+ */
+ @DataProvider(name = "nonEmptySources")
+ Object[][] getSourcesEx() throws URISyntaxException {
+ StAXSource ss = null;
+ try {
+ ss = new StAXSource(getXMLEventReader());
+ } catch (XMLStreamException ex) {}
+
+ return new Object[][]{
+ //This will set a non-null systemId on the resulting StreamSource
+ {new StreamSource(new File(""))},
+ //Can't tell because XMLStreamReader is a pull parser, cursor advancement
+ //would have been required in order to examine the reader.
+ {new StAXSource(getXMLStreamReader())},
+ {ss}
+ };
+ }
+
+ /*
+ * DataProvider: sources that are empty
+ */
+ @DataProvider(name = "emptyInputSource")
+ Object[][] getInputSources() throws URISyntaxException {
+ byte[] utf8Bytes = null;
+ try {
+ utf8Bytes = "".getBytes("UTF8");
+ } catch (UnsupportedEncodingException ex) {
+ throw new RuntimeException(ex.getMessage());
+ }
+ return new Object[][]{
+ {new InputSource()},
+ {new InputSource(new ByteArrayInputStream(utf8Bytes))},
+ {new InputSource(new StringReader(""))},
+ {new InputSource((String) null)}
+ };
+ }
+
+ /**
+ * Returns an instance of Document.
+ *
+ * @return an instance of Document.
+ */
+ private Document getDocument() {
+ Document doc = null;
+ try {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ doc = dbf.newDocumentBuilder().newDocument();
+ } catch (ParserConfigurationException ex) {}
+ return doc;
+ }
+
+ /**
+ * Returns an instance of XMLReader.
+ *
+ * @return an instance of XMLReader.
+ */
+ private XMLReader getXMLReader() {
+ XMLReader reader = null;
+ try {
+ reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader();
+ } catch (ParserConfigurationException | SAXException ex) {}
+ return reader;
+ }
+
+ /**
+ * Returns an instance of XMLStreamReader.
+ *
+ * @return an instance of XMLStreamReader.
+ */
+ private XMLStreamReader getXMLStreamReader() {
+ XMLStreamReader r = null;
+ try {
+ XMLInputFactory xif = XMLInputFactory.newInstance();
+ r = xif.createXMLStreamReader(new ByteArrayInputStream("".getBytes()));
+ } catch (XMLStreamException ex) {}
+
+ return r;
+ }
+
+ /**
+ * Returns an instance of XMLEventReader.
+ *
+ * @return an instance of XMLEventReader.
+ */
+ private XMLEventReader getXMLEventReader() {
+ XMLEventReader r = null;
+ try {
+ r = XMLInputFactory.newInstance().createXMLEventReader(
+ new ByteArrayInputStream("".getBytes()));
+ } catch (XMLStreamException ex) {}
+
+ return r;
+ }
+}
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 26b9274c712..5450b82df39 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -345,3 +345,5 @@ b55cebc47555293cf9c2aefb3bf63c56e847ab19 jdk-9+96
7293db4716ee25b814e14f738b9acfb85700e3fa jdk-9+97
67c84077edc3db6b24998b35970b37c01aae985e jdk-9+98
97b31ca0dd77483cf20ff99a033a455673639578 jdk-9+99
+d0a97e57d2336238edf6a4cd60aafe67deb7258d jdk-9+100
+3e99318616da903e0dc8f07f9f9203dc1bd49921 jdk-9+101
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 2af851e8faa..20eb3f6d94f 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -342,3 +342,5 @@ c021b855f51e572e63982654b17742cb1f814fb4 jdk-9+96
fdd84b2265ddce7f50e084b7c8635189bba6f012 jdk-9+97
f86ee68d1107dad41a27efc34306e0e56244a12e jdk-9+98
e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99
+3d452840f48299a36842760d17c0c8402f0e1266 jdk-9+100
+5e8370fb3ed925335164afe340d1e54beab2d4d5 jdk-9+101
diff --git a/jdk/make/gendata/GendataBreakIterator.gmk b/jdk/make/gendata/GendataBreakIterator.gmk
index 4407fa9b166..38bf0e537bb 100644
--- a/jdk/make/gendata/GendataBreakIterator.gmk
+++ b/jdk/make/gendata/GendataBreakIterator.gmk
@@ -48,7 +48,6 @@ BREAK_ITERATOR_CLASSES := $(BUILDTOOLS_OUTPUTDIR)/break_iterator_classes
$(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(TEXT_SRCDIR), \
- INCLUDES := $(TEXT_PKG), \
INCLUDE_FILES := $(TEXT_SOURCES), \
BIN := $(BREAK_ITERATOR_CLASSES)))
diff --git a/jdk/make/lib/NioLibraries.gmk b/jdk/make/lib/NioLibraries.gmk
index bc021b14d58..6b7d305f914 100644
--- a/jdk/make/lib/NioLibraries.gmk
+++ b/jdk/make/lib/NioLibraries.gmk
@@ -58,7 +58,10 @@ endif
ifeq ($(OPENJDK_TARGET_OS), aix)
BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
BUILD_LIBNIO_EXFILES += \
- NativeThread.c
+ /NativeThread.c
+ # Notice: we really need the leading slash here because otherwise every
+ # FILE_NAME in EXCLUDE_FILES will actually match any file ending in FILE_NAME
+ # (e.g. 'NativeThread.c' will also exclude 'AixNativeThread.c').
endif
$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers
index dd7e58a6b2e..3ec9f530b2d 100644
--- a/jdk/make/mapfiles/libjava/mapfile-vers
+++ b/jdk/make/mapfiles/libjava/mapfile-vers
@@ -216,6 +216,7 @@ SUNWprivate_1.1 {
Java_java_lang_SecurityManager_getClassContext;
Java_java_lang_Shutdown_halt0;
Java_java_lang_String_intern;
+ Java_java_lang_StringCoding_err;
Java_java_lang_StringUTF16_isBigEndian;
Java_java_lang_System_identityHashCode;
Java_java_lang_System_initProperties;
@@ -243,8 +244,6 @@ SUNWprivate_1.1 {
Java_java_util_TimeZone_getSystemTimeZoneID;
Java_java_util_TimeZone_getSystemGMTOffsetID;
Java_java_util_concurrent_atomic_AtomicLong_VMSupportsCS8;
- Java_sun_misc_MessageUtils_toStderr;
- Java_sun_misc_MessageUtils_toStdout;
Java_sun_misc_NativeSignalHandler_handle0;
Java_sun_misc_Signal_findSignal;
Java_sun_misc_Signal_handle0;
@@ -274,12 +273,12 @@ SUNWprivate_1.1 {
Java_sun_reflect_Reflection_getClassAccessFlags;
Java_sun_misc_Version_getJdkVersionInfo;
Java_sun_misc_Version_getJvmVersionInfo;
- Java_sun_misc_VM_latestUserDefinedLoader;
- Java_sun_misc_VM_getuid;
- Java_sun_misc_VM_geteuid;
- Java_sun_misc_VM_getgid;
- Java_sun_misc_VM_getegid;
- Java_sun_misc_VM_initialize;
+ Java_jdk_internal_misc_VM_latestUserDefinedLoader;
+ Java_jdk_internal_misc_VM_getuid;
+ Java_jdk_internal_misc_VM_geteuid;
+ Java_jdk_internal_misc_VM_getgid;
+ Java_jdk_internal_misc_VM_getegid;
+ Java_jdk_internal_misc_VM_initialize;
Java_sun_misc_VMSupport_initAgentProperties;
Java_sun_misc_VMSupport_getVMTemporaryDirectory;
diff --git a/jdk/make/src/classes/build/tools/dtdbuilder/DTDParser.java b/jdk/make/src/classes/build/tools/dtdbuilder/DTDParser.java
index 753007a08ec..0dee68e367f 100644
--- a/jdk/make/src/classes/build/tools/dtdbuilder/DTDParser.java
+++ b/jdk/make/src/classes/build/tools/dtdbuilder/DTDParser.java
@@ -35,8 +35,6 @@ import java.util.Hashtable;
import java.util.BitSet;
import java.text.MessageFormat;
-import sun.misc.MessageUtils;
-
/**
* A parser for DTDs. This parser roughly corresponds to the
* rules specified in "The SGML Handbook" by Charles F. Goldfarb.
diff --git a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java
index 779257e87c0..d739bc411e1 100644
--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java
@@ -2135,7 +2135,7 @@ public class ObjectInputStream
* corresponding modifications to the above class.
*/
private static ClassLoader latestUserDefinedLoader() {
- return sun.misc.VM.latestUserDefinedLoader();
+ return jdk.internal.misc.VM.latestUserDefinedLoader();
}
/**
diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java
index 013b5843a1e..af75faf371a 100644
--- a/jdk/src/java.base/share/classes/java/lang/Class.java
+++ b/jdk/src/java.base/share/classes/java/lang/Class.java
@@ -56,6 +56,7 @@ import java.util.HashMap;
import java.util.Objects;
import java.util.StringJoiner;
import jdk.internal.misc.Unsafe;
+import jdk.internal.misc.VM;
import jdk.internal.HotSpotIntrinsicCandidate;
import sun.reflect.CallerSensitive;
import sun.reflect.ConstantPool;
@@ -360,9 +361,9 @@ public final class Class implements java.io.Serializable,
// Reflective call to get caller class is only needed if a security manager
// is present. Avoid the overhead of making this call otherwise.
caller = Reflection.getCallerClass();
- if (sun.misc.VM.isSystemDomainLoader(loader)) {
+ if (VM.isSystemDomainLoader(loader)) {
ClassLoader ccl = ClassLoader.getClassLoader(caller);
- if (!sun.misc.VM.isSystemDomainLoader(ccl)) {
+ if (!VM.isSystemDomainLoader(ccl)) {
sm.checkPermission(
SecurityConstants.GET_CLASSLOADER_PERMISSION);
}
diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
index 76cdd25dcd7..1bb15800454 100644
--- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
+++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java
@@ -50,6 +50,8 @@ import java.util.Vector;
import java.util.Hashtable;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
+
+import jdk.internal.perf.PerfCounter;
import sun.misc.Resource;
import sun.misc.URLClassPath;
import sun.reflect.CallerSensitive;
@@ -423,9 +425,9 @@ public abstract class ClassLoader {
c = findClass(name);
// this is the defining class loader; record the stats
- sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
- sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
- sun.misc.PerfCounter.getFindClasses().increment();
+ PerfCounter.getParentDelegationTime().addTime(t1 - t0);
+ PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
+ PerfCounter.getFindClasses().increment();
}
}
if (resolve) {
diff --git a/jdk/src/java.base/share/classes/java/lang/Integer.java b/jdk/src/java.base/share/classes/java/lang/Integer.java
index e34ae9d9395..11afbef0d47 100644
--- a/jdk/src/java.base/share/classes/java/lang/Integer.java
+++ b/jdk/src/java.base/share/classes/java/lang/Integer.java
@@ -28,6 +28,7 @@ package java.lang;
import java.lang.annotation.Native;
import java.util.Objects;
import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.VM;
import static java.lang.String.COMPACT_STRINGS;
import static java.lang.String.LATIN1;
@@ -1018,7 +1019,7 @@ public final class Integer extends Number implements Comparable {
* may be controlled by the {@code -XX:AutoBoxCacheMax=} option.
* During VM initialization, java.lang.Integer.IntegerCache.high property
* may be set and saved in the private system properties in the
- * sun.misc.VM class.
+ * jdk.internal.misc.VM class.
*/
private static class IntegerCache {
@@ -1030,7 +1031,7 @@ public final class Integer extends Number implements Comparable {
// high value may be configured by property
int h = 127;
String integerCacheHighPropValue =
- sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
+ VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
if (integerCacheHighPropValue != null) {
try {
int i = parseInt(integerCacheHighPropValue);
diff --git a/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java b/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java
index 1ef4a2aa041..5be48729d5a 100644
--- a/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java
+++ b/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java
@@ -61,6 +61,9 @@ interface LiveStackFrame extends StackFrame {
* local variable array is an {@link PrimitiveValue} object;
* otherwise, the element is an {@code Object}.
*
+ * The returned array may contain null entries if a local variable is not
+ * live.
+ *
* @return the local variable array of this stack frame.
*/
public Object[] getLocals();
diff --git a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
index 34c60a755d0..dcb471c4cc2 100644
--- a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
@@ -24,7 +24,7 @@
*/
package java.lang;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import java.io.PrintStream;
import java.lang.StackWalker.Option;
diff --git a/jdk/src/java.base/share/classes/java/lang/StringCoding.java b/jdk/src/java.base/share/classes/java/lang/StringCoding.java
index b1e25d5128f..fe875372218 100644
--- a/jdk/src/java.base/share/classes/java/lang/StringCoding.java
+++ b/jdk/src/java.base/share/classes/java/lang/StringCoding.java
@@ -39,7 +39,6 @@ import java.nio.charset.IllegalCharsetNameException;
import java.nio.charset.UnsupportedCharsetException;
import java.util.Arrays;
import jdk.internal.HotSpotIntrinsicCandidate;
-import sun.misc.MessageUtils;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.ArrayDecoder;
import sun.nio.cs.ArrayEncoder;
@@ -106,11 +105,11 @@ class StringCoding {
private static void warnUnsupportedCharset(String csn) {
if (warnUnsupportedCharset) {
- // Use sun.misc.MessageUtils rather than the Logging API or
- // System.err since this method may be called during VM
- // initialization before either is available.
- MessageUtils.err("WARNING: Default charset " + csn +
- " not supported, using ISO-8859-1 instead");
+ // Use err(String) rather than the Logging API or System.err
+ // since this method may be called during VM initialization
+ // before either is available.
+ err("WARNING: Default charset " + csn +
+ " not supported, using ISO-8859-1 instead\n");
warnUnsupportedCharset = false;
}
}
@@ -341,10 +340,9 @@ class StringCoding {
try {
return decode("ISO-8859-1", ba, off, len);
} catch (UnsupportedEncodingException x) {
- // If this code is hit during VM initialization, MessageUtils is
+ // If this code is hit during VM initialization, err(String) is
// the only way we will be able to get any kind of error message.
- MessageUtils.err("ISO-8859-1 charset not available: "
- + x.toString());
+ err("ISO-8859-1 charset not available: " + x.toString() + "\n");
// If we can not find ISO-8859-1 (a required encoding) then things
// are seriously wrong with the installation.
System.exit(1);
@@ -653,14 +651,20 @@ class StringCoding {
try {
return encode("ISO-8859-1", coder, val);
} catch (UnsupportedEncodingException x) {
- // If this code is hit during VM initialization, MessageUtils is
+ // If this code is hit during VM initialization, err(String) is
// the only way we will be able to get any kind of error message.
- MessageUtils.err("ISO-8859-1 charset not available: "
- + x.toString());
+ err("ISO-8859-1 charset not available: " + x.toString() + "\n");
// If we can not find ISO-8859-1 (a required encoding) then things
// are seriously wrong with the installation.
System.exit(1);
return null;
}
}
+
+ /**
+ * Print a message directly to stderr, bypassing all character conversion
+ * methods.
+ * @param msg message to print
+ */
+ private static native void err(String msg);
}
diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java
index ea3ad405cfc..16b1e6b57e3 100644
--- a/jdk/src/java.base/share/classes/java/lang/System.java
+++ b/jdk/src/java.base/share/classes/java/lang/System.java
@@ -46,6 +46,7 @@ import sun.reflect.annotation.AnnotationType;
import jdk.internal.HotSpotIntrinsicCandidate;
import jdk.internal.misc.JavaLangAccess;;
import jdk.internal.misc.SharedSecrets;;
+import jdk.internal.misc.VM;
import jdk.internal.logger.LoggerFinderLoader;
import jdk.internal.logger.LazyLoggers;
import jdk.internal.logger.LocalizedLoggerWrapper;
@@ -1534,6 +1535,8 @@ public final class System {
* @return an instance of {@link Logger} that can be used by the calling
* class.
* @throws NullPointerException if {@code name} is {@code null}.
+ *
+ * @since 9
*/
@CallerSensitive
public static Logger getLogger(String name) {
@@ -1571,6 +1574,8 @@ public final class System {
* resource bundle for message localization.
* @throws NullPointerException if {@code name} is {@code null} or
* {@code bundle} is {@code null}.
+ *
+ * @since 9
*/
@CallerSensitive
public static Logger getLogger(String name, ResourceBundle bundle) {
@@ -1817,12 +1822,12 @@ public final class System {
// removed from the system properties.
//
// See java.lang.Integer.IntegerCache and the
- // sun.misc.VM.saveAndRemoveProperties method for example.
+ // VM.saveAndRemoveProperties method for example.
//
// Save a private copy of the system properties object that
// can only be accessed by the internal implementation. Remove
// certain system properties that are not intended for public access.
- sun.misc.VM.saveAndRemoveProperties(props);
+ VM.saveAndRemoveProperties(props);
lineSeparator = props.getProperty("line.separator");
@@ -1846,7 +1851,7 @@ public final class System {
// set for the class libraries. Currently this is no-op everywhere except
// for Windows where the process-wide error mode is set before the java.io
// classes are used.
- sun.misc.VM.initializeOSEnvironment();
+ VM.initializeOSEnvironment();
// The main thread is not added to its thread group in the same
// way as other threads; we must do it ourselves here.
@@ -1857,10 +1862,10 @@ public final class System {
setJavaLangAccess();
// Subsystems that are invoked during initialization can invoke
- // sun.misc.VM.isBooted() in order to avoid doing things that should
+ // VM.isBooted() in order to avoid doing things that should
// wait until the application class loader has been set up.
// IMPORTANT: Ensure that this remains the last initialization action!
- sun.misc.VM.booted();
+ VM.booted();
}
private static void setJavaLangAccess() {
diff --git a/jdk/src/java.base/share/classes/java/lang/Thread.java b/jdk/src/java.base/share/classes/java/lang/Thread.java
index 56935eabd34..eb47a05427d 100644
--- a/jdk/src/java.base/share/classes/java/lang/Thread.java
+++ b/jdk/src/java.base/share/classes/java/lang/Thread.java
@@ -1869,7 +1869,7 @@ class Thread implements Runnable {
*/
public State getState() {
// get current thread state
- return sun.misc.VM.toThreadState(threadStatus);
+ return jdk.internal.misc.VM.toThreadState(threadStatus);
}
// Added in JSR-166
diff --git a/jdk/src/java.base/share/classes/java/lang/ThreadGroup.java b/jdk/src/java.base/share/classes/java/lang/ThreadGroup.java
index eda2e7d1ab8..e477800f61c 100644
--- a/jdk/src/java.base/share/classes/java/lang/ThreadGroup.java
+++ b/jdk/src/java.base/share/classes/java/lang/ThreadGroup.java
@@ -27,7 +27,7 @@ package java.lang;
import java.io.PrintStream;
import java.util.Arrays;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
/**
* A thread group represents a set of threads. In addition, a thread
diff --git a/jdk/src/java.base/share/classes/java/lang/Throwable.java b/jdk/src/java.base/share/classes/java/lang/Throwable.java
index 68dc204693b..9d5f547c2a5 100644
--- a/jdk/src/java.base/share/classes/java/lang/Throwable.java
+++ b/jdk/src/java.base/share/classes/java/lang/Throwable.java
@@ -24,7 +24,7 @@
*/
package java.lang;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import java.io.*;
import java.util.*;
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
index 0c8317db5c1..4925829a985 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -1836,7 +1836,7 @@ return mh1;
return false;
}
ClassLoader loader = defc.getClassLoader();
- if (!sun.misc.VM.isSystemDomainLoader(loader)) {
+ if (!jdk.internal.misc.VM.isSystemDomainLoader(loader)) {
ClassLoader sysl = ClassLoader.getSystemClassLoader();
boolean found = false;
while (sysl != null) {
@@ -3120,6 +3120,8 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum"));
MethodHandle handler) {
MethodType ttype = target.type();
MethodType htype = handler.type();
+ if (!Throwable.class.isAssignableFrom(exType))
+ throw new ClassCastException(exType.getName());
if (htype.parameterCount() < 1 ||
!htype.parameterType(0).isAssignableFrom(exType))
throw newIllegalArgumentException("handler does not accept exception type "+exType);
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java b/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java
index 2bb4fed781f..bee049ec8fe 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java
@@ -28,7 +28,7 @@ package java.lang.ref;
import java.util.Objects;
import java.util.concurrent.ThreadFactory;
-import jdk.internal.misc.CleanerImpl;
+import jdk.internal.ref.CleanerImpl;
/**
* {@code Cleaner} manages a set of object references and corresponding cleaning actions.
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
index 221d07e207b..ead17ef1c9f 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/Finalizer.java
@@ -29,7 +29,7 @@ import java.security.PrivilegedAction;
import java.security.AccessController;
import jdk.internal.misc.JavaLangAccess;
import jdk.internal.misc.SharedSecrets;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
final class Finalizer extends FinalReference { /* Package-private; must be in
same package as the Reference
diff --git a/jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java b/jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java
index dcd50ae8575..61f43791400 100644
--- a/jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java
+++ b/jdk/src/java.base/share/classes/java/lang/ref/ReferenceQueue.java
@@ -26,6 +26,7 @@
package java.lang.ref;
import java.util.function.Consumer;
+import jdk.internal.misc.VM;
/**
* Reference queues, to which registered reference objects are appended by the
@@ -73,7 +74,7 @@ public class ReferenceQueue {
// Volatiles ensure ordering.
r.queue = ENQUEUED;
if (r instanceof FinalReference) {
- sun.misc.VM.addFinalRefCount(1);
+ VM.addFinalRefCount(1);
}
lock.notifyAll();
return true;
@@ -93,7 +94,7 @@ public class ReferenceQueue {
r.next = r;
queueLength--;
if (r instanceof FinalReference) {
- sun.misc.VM.addFinalRefCount(-1);
+ VM.addFinalRefCount(-1);
}
return r;
}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
index 765713a4afd..f6c6ebd4d2f 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java
@@ -34,7 +34,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.BiFunction;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
import sun.reflect.misc.ReflectUtil;
diff --git a/jdk/src/java.base/share/classes/java/net/SocketImpl.java b/jdk/src/java.base/share/classes/java/net/SocketImpl.java
index 600c68457af..b4b9c1900c7 100644
--- a/jdk/src/java.base/share/classes/java/net/SocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/SocketImpl.java
@@ -376,19 +376,23 @@ public abstract class SocketImpl implements SocketOptions {
* @since 1.9
*/
protected void setOption(SocketOption name, T value) throws IOException {
- if (name == StandardSocketOptions.SO_KEEPALIVE) {
+ if (name == StandardSocketOptions.SO_KEEPALIVE &&
+ (getSocket() != null)) {
setOption(SocketOptions.SO_KEEPALIVE, value);
- } else if (name == StandardSocketOptions.SO_SNDBUF) {
+ } else if (name == StandardSocketOptions.SO_SNDBUF &&
+ (getSocket() != null)) {
setOption(SocketOptions.SO_SNDBUF, value);
} else if (name == StandardSocketOptions.SO_RCVBUF) {
setOption(SocketOptions.SO_RCVBUF, value);
} else if (name == StandardSocketOptions.SO_REUSEADDR) {
setOption(SocketOptions.SO_REUSEADDR, value);
- } else if (name == StandardSocketOptions.SO_LINGER) {
+ } else if (name == StandardSocketOptions.SO_LINGER &&
+ (getSocket() != null)) {
setOption(SocketOptions.SO_LINGER, value);
} else if (name == StandardSocketOptions.IP_TOS) {
setOption(SocketOptions.IP_TOS, value);
- } else if (name == StandardSocketOptions.TCP_NODELAY) {
+ } else if (name == StandardSocketOptions.TCP_NODELAY &&
+ (getSocket() != null)) {
setOption(SocketOptions.TCP_NODELAY, value);
} else {
throw new UnsupportedOperationException("unsupported option");
@@ -412,19 +416,23 @@ public abstract class SocketImpl implements SocketOptions {
*/
@SuppressWarnings("unchecked")
protected T getOption(SocketOption name) throws IOException {
- if (name == StandardSocketOptions.SO_KEEPALIVE) {
+ if (name == StandardSocketOptions.SO_KEEPALIVE &&
+ (getSocket() != null)) {
return (T)getOption(SocketOptions.SO_KEEPALIVE);
- } else if (name == StandardSocketOptions.SO_SNDBUF) {
+ } else if (name == StandardSocketOptions.SO_SNDBUF &&
+ (getSocket() != null)) {
return (T)getOption(SocketOptions.SO_SNDBUF);
} else if (name == StandardSocketOptions.SO_RCVBUF) {
return (T)getOption(SocketOptions.SO_RCVBUF);
} else if (name == StandardSocketOptions.SO_REUSEADDR) {
return (T)getOption(SocketOptions.SO_REUSEADDR);
- } else if (name == StandardSocketOptions.SO_LINGER) {
+ } else if (name == StandardSocketOptions.SO_LINGER &&
+ (getSocket() != null)) {
return (T)getOption(SocketOptions.SO_LINGER);
} else if (name == StandardSocketOptions.IP_TOS) {
return (T)getOption(SocketOptions.IP_TOS);
- } else if (name == StandardSocketOptions.TCP_NODELAY) {
+ } else if (name == StandardSocketOptions.TCP_NODELAY &&
+ (getSocket() != null)) {
return (T)getOption(SocketOptions.TCP_NODELAY);
} else {
throw new UnsupportedOperationException("unsupported option");
diff --git a/jdk/src/java.base/share/classes/java/net/URI.java b/jdk/src/java.base/share/classes/java/net/URI.java
index e896568c7a1..862588019fd 100644
--- a/jdk/src/java.base/share/classes/java/net/URI.java
+++ b/jdk/src/java.base/share/classes/java/net/URI.java
@@ -1146,13 +1146,30 @@ public final class URI
if (part != null) {
return part;
}
- StringBuilder sb = new StringBuilder();
- appendSchemeSpecificPart(sb, null, getAuthority(), getUserInfo(),
+
+ String s = string;
+ if (s != null) {
+ // if string is defined, components will have been parsed
+ int start = 0;
+ int end = s.length();
+ if (scheme != null) {
+ start = scheme.length() + 1;
+ }
+ if (fragment != null) {
+ end -= fragment.length() + 1;
+ }
+ if (path != null && path.length() == end - start) {
+ part = path;
+ } else {
+ part = s.substring(start, end);
+ }
+ } else {
+ StringBuilder sb = new StringBuilder();
+ appendSchemeSpecificPart(sb, null, getAuthority(), getUserInfo(),
host, port, getPath(), getQuery());
- if (sb.length() == 0) {
- return null;
+ part = sb.toString();
}
- return schemeSpecificPart = sb.toString();
+ return schemeSpecificPart = part;
}
/**
@@ -2059,7 +2076,7 @@ public final class URI
// 5.2 (2): Reference to current document (lone fragment)
if ((child.scheme == null) && (child.authority == null)
- && child.path.equals("") && (child.fragment != null)
+ && child.path.isEmpty() && (child.fragment != null)
&& (child.query == null)) {
if ((base.fragment != null)
&& child.fragment.equals(base.fragment)) {
@@ -2647,13 +2664,6 @@ public final class URI
private static final long L_SCHEME = L_ALPHA | L_DIGIT | lowMask("+-.");
private static final long H_SCHEME = H_ALPHA | H_DIGIT | highMask("+-.");
- // uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
- // "&" | "=" | "+" | "$" | ","
- private static final long L_URIC_NO_SLASH
- = L_UNRESERVED | L_ESCAPED | lowMask(";?:@&=+$,");
- private static final long H_URIC_NO_SLASH
- = H_UNRESERVED | H_ESCAPED | highMask(";?:@&=+$,");
-
// scope_id = alpha | digit | "_" | "."
private static final long L_SCOPE_ID
= L_ALPHANUM | lowMask("_.");
@@ -2884,23 +2894,10 @@ public final class URI
// -- Simple access to the input string --
- // Return a substring of the input string
- //
- private String substring(int start, int end) {
- return input.substring(start, end);
- }
-
- // Return the char at position p,
- // assuming that p < input.length()
- //
- private char charAt(int p) {
- return input.charAt(p);
- }
-
// Tells whether start < end and, if so, whether charAt(start) == c
//
private boolean at(int start, int end, char c) {
- return (start < end) && (charAt(start) == c);
+ return (start < end) && (input.charAt(start) == c);
}
// Tells whether start + s.length() < end and, if so,
@@ -2913,7 +2910,7 @@ public final class URI
return false;
int i = 0;
while (i < sn) {
- if (charAt(p++) != s.charAt(i)) {
+ if (input.charAt(p++) != s.charAt(i)) {
break;
}
i++;
@@ -2953,7 +2950,7 @@ public final class URI
// start position.
//
private int scan(int start, int end, char c) {
- if ((start < end) && (charAt(start) == c))
+ if ((start < end) && (input.charAt(start) == c))
return start + 1;
return start;
}
@@ -2968,7 +2965,7 @@ public final class URI
private int scan(int start, int end, String err, String stop) {
int p = start;
while (p < end) {
- char c = charAt(p);
+ char c = input.charAt(p);
if (err.indexOf(c) >= 0)
return -1;
if (stop.indexOf(c) >= 0)
@@ -2978,6 +2975,23 @@ public final class URI
return p;
}
+ // Scan forward from the given start position. Stop at the first char
+ // in the stop string (in which case the index of the preceding char is
+ // returned), or the end of the input string (in which case the length
+ // of the input string is returned). May return the start position if
+ // nothing matches.
+ //
+ private int scan(int start, int end, String stop) {
+ int p = start;
+ while (p < end) {
+ char c = input.charAt(p);
+ if (stop.indexOf(c) >= 0)
+ break;
+ p++;
+ }
+ return p;
+ }
+
// Scan a potential escape sequence, starting at the given position,
// with the given first char (i.e., charAt(start) == c).
//
@@ -2992,8 +3006,8 @@ public final class URI
if (c == '%') {
// Process escape pair
if ((p + 3 <= n)
- && match(charAt(p + 1), L_HEX, H_HEX)
- && match(charAt(p + 2), L_HEX, H_HEX)) {
+ && match(input.charAt(p + 1), L_HEX, H_HEX)
+ && match(input.charAt(p + 2), L_HEX, H_HEX)) {
return p + 3;
}
fail("Malformed escape pair", p);
@@ -3013,7 +3027,7 @@ public final class URI
{
int p = start;
while (p < n) {
- char c = charAt(p);
+ char c = input.charAt(p);
if (match(c, lowMask, highMask)) {
p++;
continue;
@@ -3059,7 +3073,6 @@ public final class URI
//
void parse(boolean rsa) throws URISyntaxException {
requireServerAuthority = rsa;
- int ssp; // Start of scheme-specific part
int n = input.length();
int p = scan(0, n, "/?#", ":");
if ((p >= 0) && at(p, n, ':')) {
@@ -3067,26 +3080,25 @@ public final class URI
failExpecting("scheme name", 0);
checkChar(0, L_ALPHA, H_ALPHA, "scheme name");
checkChars(1, p, L_SCHEME, H_SCHEME, "scheme name");
- scheme = substring(0, p);
+ scheme = input.substring(0, p);
p++; // Skip ':'
- ssp = p;
if (at(p, n, '/')) {
p = parseHierarchical(p, n);
} else {
- int q = scan(p, n, "", "#");
+ // opaque; need to create the schemeSpecificPart
+ int q = scan(p, n, "#");
if (q <= p)
failExpecting("scheme-specific part", p);
checkChars(p, q, L_URIC, H_URIC, "opaque part");
+ schemeSpecificPart = input.substring(p, q);
p = q;
}
} else {
- ssp = 0;
p = parseHierarchical(0, n);
}
- schemeSpecificPart = substring(ssp, p);
if (at(p, n, '#')) {
checkChars(p + 1, n, L_URIC, H_URIC, "fragment");
- fragment = substring(p + 1, n);
+ fragment = input.substring(p + 1, n);
p = n;
}
if (p < n)
@@ -3113,7 +3125,7 @@ public final class URI
int p = start;
if (at(p, n, '/') && at(p + 1, n, '/')) {
p += 2;
- int q = scan(p, n, "", "/?#");
+ int q = scan(p, n, "/?#");
if (q > p) {
p = parseAuthority(p, q);
} else if (q < n) {
@@ -3122,15 +3134,15 @@ public final class URI
} else
failExpecting("authority", p);
}
- int q = scan(p, n, "", "?#"); // DEVIATION: May be empty
+ int q = scan(p, n, "?#"); // DEVIATION: May be empty
checkChars(p, q, L_PATH, H_PATH, "path");
- path = substring(p, q);
+ path = input.substring(p, q);
p = q;
if (at(p, n, '?')) {
p++;
- q = scan(p, n, "", "#");
+ q = scan(p, n, "#");
checkChars(p, q, L_URIC, H_URIC, "query");
- query = substring(p, q);
+ query = input.substring(p, q);
p = q;
}
return p;
@@ -3154,7 +3166,7 @@ public final class URI
boolean serverChars;
boolean regChars;
- if (scan(p, n, "", "]") > p) {
+ if (scan(p, n, "]") > p) {
// contains a literal IPv6 address, therefore % is allowed
serverChars = (scan(p, n, L_SERVER_PERCENT, H_SERVER_PERCENT) == n);
} else {
@@ -3164,7 +3176,7 @@ public final class URI
if (regChars && !serverChars) {
// Must be a registry-based authority
- authority = substring(p, n);
+ authority = input.substring(p, n);
return n;
}
@@ -3176,7 +3188,7 @@ public final class URI
q = parseServer(p, n);
if (q < n)
failExpecting("end of authority", q);
- authority = substring(p, n);
+ authority = input.substring(p, n);
} catch (URISyntaxException x) {
// Undo results of failed parse
userInfo = null;
@@ -3198,7 +3210,7 @@ public final class URI
if (q < n) {
if (regChars) {
// Registry-based authority
- authority = substring(p, n);
+ authority = input.substring(p, n);
} else if (ex != null) {
// Re-throw exception; it was probably due to
// a malformed IPv6 address
@@ -3224,7 +3236,7 @@ public final class URI
q = scan(p, n, "/?#", "@");
if ((q >= p) && at(q, n, '@')) {
checkChars(p, q, L_USERINFO, H_USERINFO, "user info");
- userInfo = substring(p, q);
+ userInfo = input.substring(p, q);
p = q + 1; // Skip '@'
}
@@ -3235,7 +3247,7 @@ public final class URI
q = scan(p, n, "/?#", "]");
if ((q > p) && at(q, n, ']')) {
// look for a "%" scope id
- int r = scan (p, q, "", "%");
+ int r = scan (p, q, "%");
if (r > p) {
parseIPv6Reference(p, r);
if (r+1 == q) {
@@ -3246,7 +3258,7 @@ public final class URI
} else {
parseIPv6Reference(p, q);
}
- host = substring(p-1, q+1);
+ host = input.substring(p-1, q+1);
p = q + 1;
} else {
failExpecting("closing bracket for IPv6 address", q);
@@ -3261,7 +3273,7 @@ public final class URI
// port
if (at(p, n, ':')) {
p++;
- q = scan(p, n, "", "/");
+ q = scan(p, n, "/");
if (q > p) {
checkChars(p, q, L_DIGIT, H_DIGIT, "port number");
try {
@@ -3361,13 +3373,13 @@ public final class URI
// IPv4 address is followed by something - check that
// it's a ":" as this is the only valid character to
// follow an address.
- if (charAt(p) != ':') {
+ if (input.charAt(p) != ':') {
p = -1;
}
}
if (p > start)
- host = substring(start, p);
+ host = input.substring(start, p);
return p;
}
@@ -3393,7 +3405,7 @@ public final class URI
p = q;
q = scan(p, n, L_ALPHANUM | L_DASH, H_ALPHANUM | H_DASH);
if (q > p) {
- if (charAt(q - 1) == '-')
+ if (input.charAt(q - 1) == '-')
fail("Illegal character in hostname", q - 1);
p = q;
}
@@ -3412,11 +3424,11 @@ public final class URI
// for a fully qualified hostname check that the rightmost
// label starts with an alpha character.
- if (l > start && !match(charAt(l), L_ALPHA, H_ALPHA)) {
+ if (l > start && !match(input.charAt(l), L_ALPHA, H_ALPHA)) {
fail("Illegal character in hostname", l);
}
- host = substring(start, p);
+ host = input.substring(start, p);
return p;
}
diff --git a/jdk/src/java.base/share/classes/java/net/URL.java b/jdk/src/java.base/share/classes/java/net/URL.java
index 73e488831a5..e8a694116fd 100644
--- a/jdk/src/java.base/share/classes/java/net/URL.java
+++ b/jdk/src/java.base/share/classes/java/net/URL.java
@@ -1242,7 +1242,7 @@ public final class URL implements java.io.Serializable {
private static ThreadLocal gate = new ThreadLocal<>();
private static URLStreamHandler lookupViaProviders(final String protocol) {
- if (!sun.misc.VM.isBooted())
+ if (!jdk.internal.misc.VM.isBooted())
return null;
if (gate.get() != null)
diff --git a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java
index 05ebeed39a5..1cf064d1afa 100644
--- a/jdk/src/java.base/share/classes/java/net/URLClassLoader.java
+++ b/jdk/src/java.base/share/classes/java/net/URLClassLoader.java
@@ -52,6 +52,7 @@ import java.util.jar.Manifest;
import jdk.internal.misc.JavaNetAccess;
import jdk.internal.misc.SharedSecrets;
+import jdk.internal.perf.PerfCounter;
import sun.misc.Resource;
import sun.misc.URLClassPath;
import sun.net.www.ParseUtil;
@@ -459,14 +460,14 @@ public class URLClassLoader extends SecureClassLoader implements Closeable {
// Use (direct) ByteBuffer:
CodeSigner[] signers = res.getCodeSigners();
CodeSource cs = new CodeSource(url, signers);
- sun.misc.PerfCounter.getReadClassBytesTime().addElapsedTimeFrom(t0);
+ PerfCounter.getReadClassBytesTime().addElapsedTimeFrom(t0);
return defineClass(name, bb, cs);
} else {
byte[] b = res.getBytes();
// must read certificates AFTER reading bytes.
CodeSigner[] signers = res.getCodeSigners();
CodeSource cs = new CodeSource(url, signers);
- sun.misc.PerfCounter.getReadClassBytesTime().addElapsedTimeFrom(t0);
+ PerfCounter.getReadClassBytesTime().addElapsedTimeFrom(t0);
return defineClass(name, b, 0, b.length, cs);
}
}
diff --git a/jdk/src/java.base/share/classes/java/net/URLConnection.java b/jdk/src/java.base/share/classes/java/net/URLConnection.java
index 0fe18279b1b..87f4378b2ad 100644
--- a/jdk/src/java.base/share/classes/java/net/URLConnection.java
+++ b/jdk/src/java.base/share/classes/java/net/URLConnection.java
@@ -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
@@ -1567,6 +1567,11 @@ public abstract class URLConnection {
}
}
+ if ((c1 == 0x49 && c2 == 0x49 && c3 == 0x2a && c4 == 0x00)
+ || (c1 == 0x4d && c2 == 0x4d && c3 == 0x00 && c4 == 0x2a)) {
+ return "image/tiff";
+ }
+
if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 &&
c5 == 0xA1 && c6 == 0xB1 && c7 == 0x1A && c8 == 0xE1) {
diff --git a/jdk/src/java.base/share/classes/java/nio/Bits.java b/jdk/src/java.base/share/classes/java/nio/Bits.java
index 724fb0c01f5..09623eab845 100644
--- a/jdk/src/java.base/share/classes/java/nio/Bits.java
+++ b/jdk/src/java.base/share/classes/java/nio/Bits.java
@@ -31,7 +31,7 @@ import jdk.internal.misc.JavaNioAccess;
import jdk.internal.misc.JavaLangRefAccess;
import jdk.internal.misc.SharedSecrets;
import jdk.internal.misc.Unsafe;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
/**
* Access to bits, native and otherwise.
diff --git a/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template b/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
index c2d8d8ea12e..16e495a4fba 100644
--- a/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
+++ b/jdk/src/java.base/share/classes/java/nio/Direct-X-Buffer.java.template
@@ -30,7 +30,7 @@ package java.nio;
import java.io.FileDescriptor;
import sun.misc.Cleaner;
import jdk.internal.misc.Unsafe;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import sun.nio.ch.DirectBuffer;
diff --git a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java
index d48f5a972db..de85b2f525c 100644
--- a/jdk/src/java.base/share/classes/java/nio/charset/Charset.java
+++ b/jdk/src/java.base/share/classes/java/nio/charset/Charset.java
@@ -43,6 +43,7 @@ import java.util.ServiceLoader;
import java.util.ServiceConfigurationError;
import java.util.SortedMap;
import java.util.TreeMap;
+import jdk.internal.misc.VM;
import sun.misc.ASCIICaseInsensitiveComparator;
import sun.nio.cs.StandardCharsets;
import sun.nio.cs.ThreadLocalCoders;
@@ -281,7 +282,7 @@ public abstract class Charset
static boolean atBugLevel(String bl) { // package-private
String level = bugLevel;
if (level == null) {
- if (!sun.misc.VM.isBooted())
+ if (!VM.isBooted())
return false;
bugLevel = level = AccessController.doPrivileged(
new GetPropertyAction("sun.nio.cs.bugLevel", ""));
@@ -394,7 +395,7 @@ public abstract class Charset
// that loader to be prematurely initialized with incomplete
// information.
//
- if (!sun.misc.VM.isBooted())
+ if (!VM.isBooted())
return null;
if (gate.get() != null)
@@ -445,7 +446,7 @@ public abstract class Charset
}
private static Charset lookupExtendedCharset(String charsetName) {
- if (!sun.misc.VM.isBooted()) // see lookupViaProviders()
+ if (!VM.isBooted()) // see lookupViaProviders()
return null;
CharsetProvider[] ecps = ExtendedProviderHolder.extendedProviders;
for (CharsetProvider cp : ecps) {
diff --git a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
index 203ec8eed41..c7a0893b7d3 100644
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -27,12 +27,12 @@ package java.security;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
+import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
-import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
import jdk.internal.misc.JavaSecurityAccess;
import jdk.internal.misc.JavaSecurityProtectionDomainAccess;
@@ -472,11 +472,15 @@ public class ProtectionDomain {
*
* This class stores ProtectionDomains as weak keys in a ConcurrentHashMap
* with additional support for checking and removing weak keys that are no
- * longer in use.
+ * longer in use. There can be cases where the permission collection may
+ * have a chain of strong references back to the ProtectionDomain, which
+ * ordinarily would prevent the entry from being removed from the map. To
+ * address that, we wrap the permission collection in a SoftReference so
+ * that it can be reclaimed by the garbage collector due to memory demand.
*/
private static class PDCache implements ProtectionDomainCache {
private final ConcurrentHashMap
+ SoftReference>
pdMap = new ConcurrentHashMap<>();
private final ReferenceQueue queue = new ReferenceQueue<>();
@@ -485,15 +489,15 @@ public class ProtectionDomain {
processQueue(queue, pdMap);
WeakProtectionDomainKey weakPd =
new WeakProtectionDomainKey(pd, queue);
- pdMap.putIfAbsent(weakPd, pc);
+ pdMap.put(weakPd, new SoftReference<>(pc));
}
@Override
public PermissionCollection get(ProtectionDomain pd) {
processQueue(queue, pdMap);
- WeakProtectionDomainKey weakPd =
- new WeakProtectionDomainKey(pd, queue);
- return pdMap.get(weakPd);
+ WeakProtectionDomainKey weakPd = new WeakProtectionDomainKey(pd);
+ SoftReference sr = pdMap.get(weakPd);
+ return (sr == null) ? null : sr.get();
}
/**
@@ -533,11 +537,20 @@ public class ProtectionDomain {
this((pd == null ? NULL_KEY : pd.key), rq);
}
+ WeakProtectionDomainKey(ProtectionDomain pd) {
+ this(pd == null ? NULL_KEY : pd.key);
+ }
+
private WeakProtectionDomainKey(Key key, ReferenceQueue rq) {
super(key, rq);
hash = key.hashCode();
}
+ private WeakProtectionDomainKey(Key key) {
+ super(key);
+ hash = key.hashCode();
+ }
+
/**
* Returns the identity hash code of the original referent.
*/
diff --git a/jdk/src/java.base/share/classes/java/time/Clock.java b/jdk/src/java.base/share/classes/java/time/Clock.java
index 0d02c524dd0..121afa3730b 100644
--- a/jdk/src/java.base/share/classes/java/time/Clock.java
+++ b/jdk/src/java.base/share/classes/java/time/Clock.java
@@ -69,7 +69,7 @@ import static java.time.LocalTime.NANOS_PER_MILLI;
import java.io.Serializable;
import java.util.Objects;
import java.util.TimeZone;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
/**
* A clock providing access to the current instant, date and time using a time-zone.
diff --git a/jdk/src/java.base/share/classes/java/time/Duration.java b/jdk/src/java.base/share/classes/java/time/Duration.java
index 334bfa0227a..646d7109fd3 100644
--- a/jdk/src/java.base/share/classes/java/time/Duration.java
+++ b/jdk/src/java.base/share/classes/java/time/Duration.java
@@ -1194,6 +1194,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the whole seconds part of the length of the duration, positive or negative
+ * @since 9
*/
public long toSeconds() {
return seconds;
@@ -1243,6 +1244,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the number of days in the duration, may be negative
+ * @since 9
*/
public long toDaysPart(){
return seconds / SECONDS_PER_DAY;
@@ -1258,6 +1260,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the number of hours part in the duration, may be negative
+ * @since 9
*/
public int toHoursPart(){
return (int) (toHours() % 24);
@@ -1273,7 +1276,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the number of minutes parts in the duration, may be negative
- * may be negative
+ * @since 9
*/
public int toMinutesPart(){
return (int) (toMinutes() % MINUTES_PER_HOUR);
@@ -1289,6 +1292,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the number of seconds parts in the duration, may be negative
+ * @since 9
*/
public int toSecondsPart(){
return (int) (seconds % SECONDS_PER_MINUTE);
@@ -1306,6 +1310,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the number of milliseconds part of the duration.
+ * @since 9
*/
public int toMillisPart(){
return nanos / 1000_000;
@@ -1322,6 +1327,7 @@ public final class Duration
* This instance is immutable and unaffected by this method call.
*
* @return the nanoseconds within the second part of the length of the duration, from 0 to 999,999,999
+ * @since 9
*/
public int toNanosPart(){
return nanos;
@@ -1385,7 +1391,7 @@ public final class Duration
*
* The format of the returned string will be {@code PTnHnMnS}, where n is
* the relevant hours, minutes or seconds part of the duration.
- * Any fractional seconds are placed after a decimal point i the seconds section.
+ * Any fractional seconds are placed after a decimal point in the seconds section.
* If a section has a zero value, it is omitted.
* The hours, minutes and seconds will all have the same sign.
*
@@ -1406,9 +1412,13 @@ public final class Duration
if (this == ZERO) {
return "PT0S";
}
- long hours = seconds / SECONDS_PER_HOUR;
- int minutes = (int) ((seconds % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE);
- int secs = (int) (seconds % SECONDS_PER_MINUTE);
+ long effectiveTotalSecs = seconds;
+ if (seconds < 0 && nanos > 0) {
+ effectiveTotalSecs++;
+ }
+ long hours = effectiveTotalSecs / SECONDS_PER_HOUR;
+ int minutes = (int) ((effectiveTotalSecs % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE);
+ int secs = (int) (effectiveTotalSecs % SECONDS_PER_MINUTE);
StringBuilder buf = new StringBuilder(24);
buf.append("PT");
if (hours != 0) {
@@ -1420,18 +1430,18 @@ public final class Duration
if (secs == 0 && nanos == 0 && buf.length() > 2) {
return buf.toString();
}
- if (secs < 0 && nanos > 0) {
- if (secs == -1) {
+ if (seconds < 0 && nanos > 0) {
+ if (secs == 0) {
buf.append("-0");
} else {
- buf.append(secs + 1);
+ buf.append(secs);
}
} else {
buf.append(secs);
}
if (nanos > 0) {
int pos = buf.length();
- if (secs < 0) {
+ if (seconds < 0) {
buf.append(2 * NANOS_PER_SECOND - nanos);
} else {
buf.append(nanos + NANOS_PER_SECOND);
diff --git a/jdk/src/java.base/share/classes/java/time/LocalDate.java b/jdk/src/java.base/share/classes/java/time/LocalDate.java
index 0c6c755b813..3d8c034fa91 100644
--- a/jdk/src/java.base/share/classes/java/time/LocalDate.java
+++ b/jdk/src/java.base/share/classes/java/time/LocalDate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -1369,6 +1369,23 @@ public final class LocalDate
if (daysToAdd == 0) {
return this;
}
+ long dom = day + daysToAdd;
+ if (dom > 0) {
+ if (dom <= 28) {
+ return new LocalDate(year, month, (int) dom);
+ } else if (dom <= 59) { // 59th Jan is 28th Feb, 59th Feb is 31st Mar
+ long monthLen = lengthOfMonth();
+ if (dom <= monthLen) {
+ return new LocalDate(year, month, (int) dom);
+ } else if (month < 12) {
+ return new LocalDate(year, month + 1, (int) (dom - monthLen));
+ } else {
+ YEAR.checkValidValue(year + 1);
+ return new LocalDate(year + 1, 1, (int) (dom - monthLen));
+ }
+ }
+ }
+
long mjDay = Math.addExact(toEpochDay(), daysToAdd);
return LocalDate.ofEpochDay(mjDay);
}
diff --git a/jdk/src/java.base/share/classes/java/util/Calendar.java b/jdk/src/java.base/share/classes/java/util/Calendar.java
index 306362b203a..7665d84f3ce 100644
--- a/jdk/src/java.base/share/classes/java/util/Calendar.java
+++ b/jdk/src/java.base/share/classes/java/util/Calendar.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -2085,8 +2085,10 @@ public abstract class Calendar implements Serializable, Cloneable, Comparableoutside of the Java SE namespaces of {@code java.*} and
- * {@code javax.*} packages. For example, certain portions of {@code
- * com.sun.*} are official parts of the JDK meant to be generally
- * usable while other portions of {@code com.sun.*} are not. This
- * annotation type allows those portions to be easily and
- * programmatically distinguished.
- *
- * If in one release a type or package is
- * @Exported(true)
, in a subsequent major release such a
- * type or package can transition to @Exported(false)
.
- *
- *
If a type or package is @Exported(false)
in a
- * release, it may be removed in a subsequent major release.
- *
- *
If a top-level type has an @Exported
annotation,
- * any nested member types with the top-level type should have an
- * @Exported
annotation with the same value.
- *
- * (In exceptional cases, if a nested type is going to be removed
- * before its enclosing type, the nested type's could be
- * @Exported(false)
while its enclosing type was
- * @Exported(true)
.)
- *
- * Likewise, if a package has an @Exported
annotation,
- * top-level types within that package should also have an
- * @Exported
annotation.
- *
- * Sometimes a top-level type may have a different
- * @Exported
value than its package.
- *
- * @since 1.8
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.PACKAGE})
-@Exported
-public @interface Exported {
- /**
- * Whether or not the annotated type or package is an exported
- * part of the JDK.
- * @return whether or not the annotated type or package is an exported
- * part of the JDK
- */
- boolean value() default true;
-}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java b/jdk/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java
index 813c4787e86..bf2bccf9e1e 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java
@@ -48,7 +48,7 @@ import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import sun.misc.InnocuousThread;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import sun.util.logging.PlatformLogger;
import jdk.internal.logger.LazyLoggers.LazyLoggerAccessor;
diff --git a/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java b/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
index c54fc1a55ff..04b64ea98b1 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java
@@ -32,7 +32,7 @@ import java.lang.System.LoggerFinder;
import java.lang.System.Logger;
import java.lang.ref.WeakReference;
import java.util.Objects;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import sun.util.logging.PlatformLogger;
/**
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java b/jdk/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java
deleted file mode 100644
index 4ce835f9a39..00000000000
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/CleanerImpl.java
+++ /dev/null
@@ -1,788 +0,0 @@
-/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.internal.misc;
-
-import java.lang.ref.Cleaner;
-import java.lang.ref.Cleaner.Cleanable;
-import java.lang.ref.PhantomReference;
-import java.lang.ref.Reference;
-import java.lang.ref.ReferenceQueue;
-import java.lang.ref.SoftReference;
-import java.lang.ref.WeakReference;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Objects;
-import java.util.concurrent.ThreadFactory;
-import java.util.function.Function;
-
-import sun.misc.InnocuousThread;
-
-/**
- * CleanerImpl manages a set of object references and corresponding cleaning actions.
- * CleanerImpl provides the functionality of {@link java.lang.ref.Cleaner}.
- */
-public final class CleanerImpl implements Runnable {
-
- /**
- * An object to access the CleanerImpl from a Cleaner; set by Cleaner init.
- */
- private static Function cleanerImplAccess = null;
-
- /**
- * Heads of a CleanableList for each reference type.
- */
- final PhantomCleanable> phantomCleanableList;
-
- final WeakCleanable> weakCleanableList;
-
- final SoftCleanable> softCleanableList;
-
- // The ReferenceQueue of pending cleaning actions
- final ReferenceQueue queue;
-
- /**
- * Called by Cleaner static initialization to provide the function
- * to map from Cleaner to CleanerImpl.
- * @param access a function to map from Cleaner to CleanerImpl
- */
- public static void setCleanerImplAccess(Function access) {
- if (cleanerImplAccess == null) {
- cleanerImplAccess = access;
- }
- }
-
- /**
- * Called to get the CleanerImpl for a Cleaner.
- * @param cleaner the cleaner
- * @return the corresponding CleanerImpl
- */
- private static CleanerImpl getCleanerImpl(Cleaner cleaner) {
- return cleanerImplAccess.apply(cleaner);
- }
-
- /**
- * Constructor for CleanerImpl.
- */
- public CleanerImpl() {
- queue = new ReferenceQueue<>();
- phantomCleanableList = new PhantomCleanableRef(this);
- weakCleanableList = new WeakCleanableRef(this);
- softCleanableList = new SoftCleanableRef(this);
- }
-
- /**
- * Starts the Cleaner implementation.
- * When started waits for Cleanables to be queued.
- * @param service the cleaner
- * @param threadFactory the thread factory
- */
- public void start(Cleaner service, ThreadFactory threadFactory) {
- // schedule a nop cleaning action for the service, so the associated thread
- // will continue to run at least until the service is reclaimable.
- new PhantomCleanableRef(service, service, () -> {});
-
- if (threadFactory == null) {
- threadFactory = CleanerImpl.InnocuousThreadFactory.factory();
- }
-
- // now that there's at least one cleaning action, for the service,
- // we can start the associated thread, which runs until
- // all cleaning actions have been run.
- Thread thread = threadFactory.newThread(this);
- thread.setDaemon(true);
- thread.start();
- }
-
- /**
- * Process queued Cleanables as long as the cleanable lists are not empty.
- * A Cleanable is in one of the lists for each Object and for the Cleaner
- * itself.
- * Terminates when the Cleaner is no longer reachable and
- * has been cleaned and there are no more Cleanable instances
- * for which the object is reachable.
- *
- * If the thread is a ManagedLocalsThread, the threadlocals
- * are erased before each cleanup
- */
- public void run() {
- Thread t = Thread.currentThread();
- InnocuousThread mlThread = (t instanceof InnocuousThread)
- ? (InnocuousThread) t
- : null;
- while (!phantomCleanableList.isListEmpty() ||
- !weakCleanableList.isListEmpty() ||
- !softCleanableList.isListEmpty()) {
- if (mlThread != null) {
- // Clear the thread locals
- mlThread.eraseThreadLocals();
- }
- try {
- // Wait for a Ref, with a timeout to avoid getting hung
- // due to a race with clear/clean
- Cleanable ref = (Cleanable) queue.remove(60 * 1000L);
- if (ref != null) {
- ref.clean();
- }
- } catch (InterruptedException i) {
- continue; // ignore the interruption
- } catch (Throwable e) {
- // ignore exceptions from the cleanup action
- }
- }
- }
-
- /**
- * PhantomCleanable subclasses efficiently encapsulate cleanup state and
- * the cleaning action.
- * Subclasses implement the abstract {@link #performCleanup()} method
- * to provide the cleaning action.
- * When constructed, the object reference and the {@link Cleanable Cleanable}
- * are registered with the {@link Cleaner}.
- * The Cleaner invokes {@link Cleaner.Cleanable#clean() clean} after the
- * referent becomes phantom reachable.
- */
- public static abstract class PhantomCleanable extends PhantomReference
- implements Cleaner.Cleanable {
-
- /**
- * Links to previous and next in a doubly-linked list.
- */
- PhantomCleanable> prev = this, next = this;
-
- /**
- * The CleanerImpl for this Cleanable.
- */
- private final CleanerImpl cleanerImpl;
-
- /**
- * Constructs new {@code PhantomCleanable} with
- * {@code non-null referent} and {@code non-null cleaner}.
- * The {@code cleaner} is not retained; it is only used to
- * register the newly constructed {@link Cleaner.Cleanable Cleanable}.
- *
- * @param referent the referent to track
- * @param cleaner the {@code Cleaner} to register with
- */
- public PhantomCleanable(T referent, Cleaner cleaner) {
- super(Objects.requireNonNull(referent), getCleanerImpl(cleaner).queue);
- this.cleanerImpl = getCleanerImpl(cleaner);
- insert();
-
- // TODO: Replace getClass() with ReachabilityFence when it is available
- cleaner.getClass();
- referent.getClass();
- }
-
- /**
- * Construct a new root of the list; not inserted.
- */
- PhantomCleanable(CleanerImpl cleanerImpl) {
- super(null, null);
- this.cleanerImpl = cleanerImpl;
- }
-
- /**
- * Insert this PhantomCleanable after the list head.
- */
- private void insert() {
- final PhantomCleanable> list = cleanerImpl.phantomCleanableList;
- synchronized (list) {
- prev = list;
- next = list.next;
- next.prev = this;
- list.next = this;
- }
- }
-
- /**
- * Remove this PhantomCleanable from the list.
- *
- * @return true if Cleanable was removed or false if not because
- * it had already been removed before
- */
- private boolean remove() {
- PhantomCleanable> list = cleanerImpl.phantomCleanableList;
- synchronized (list) {
- if (next != this) {
- next.prev = prev;
- prev.next = next;
- prev = this;
- next = this;
- return true;
- }
- return false;
- }
- }
-
- /**
- * Returns true if the list's next reference refers to itself.
- *
- * @return true if the list is empty
- */
- boolean isListEmpty() {
- PhantomCleanable> list = cleanerImpl.phantomCleanableList;
- synchronized (list) {
- return list == list.next;
- }
- }
-
- /**
- * Unregister this PhantomCleanable and invoke {@link #performCleanup()},
- * ensuring at-most-once semantics.
- */
- @Override
- public final void clean() {
- if (remove()) {
- super.clear();
- performCleanup();
- }
- }
-
- /**
- * Unregister this PhantomCleanable and clear the reference.
- * Due to inherent concurrency, {@link #performCleanup()} may still be invoked.
- */
- @Override
- public void clear() {
- if (remove()) {
- super.clear();
- }
- }
-
- /**
- * The {@code performCleanup} abstract method is overridden
- * to implement the cleaning logic.
- * The {@code performCleanup} method should not be called except
- * by the {@link #clean} method which ensures at most once semantics.
- */
- protected abstract void performCleanup();
-
- /**
- * This method always throws {@link UnsupportedOperationException}.
- * Enqueuing details of {@link Cleaner.Cleanable}
- * are a private implementation detail.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public final boolean isEnqueued() {
- throw new UnsupportedOperationException("isEnqueued");
- }
-
- /**
- * This method always throws {@link UnsupportedOperationException}.
- * Enqueuing details of {@link Cleaner.Cleanable}
- * are a private implementation detail.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public final boolean enqueue() {
- throw new UnsupportedOperationException("enqueue");
- }
- }
-
- /**
- * WeakCleanable subclasses efficiently encapsulate cleanup state and
- * the cleaning action.
- * Subclasses implement the abstract {@link #performCleanup()} method
- * to provide the cleaning action.
- * When constructed, the object reference and the {@link Cleanable Cleanable}
- * are registered with the {@link Cleaner}.
- * The Cleaner invokes {@link Cleaner.Cleanable#clean() clean} after the
- * referent becomes weakly reachable.
- */
- public static abstract class WeakCleanable extends WeakReference
- implements Cleaner.Cleanable {
-
- /**
- * Links to previous and next in a doubly-linked list.
- */
- WeakCleanable> prev = this, next = this;
-
- /**
- * The CleanerImpl for this Cleanable.
- */
- private final CleanerImpl cleanerImpl;
-
- /**
- * Constructs new {@code WeakCleanableReference} with
- * {@code non-null referent} and {@code non-null cleaner}.
- * The {@code cleaner} is not retained by this reference; it is only used
- * to register the newly constructed {@link Cleaner.Cleanable Cleanable}.
- *
- * @param referent the referent to track
- * @param cleaner the {@code Cleaner} to register new reference with
- */
- public WeakCleanable(T referent, Cleaner cleaner) {
- super(Objects.requireNonNull(referent), getCleanerImpl(cleaner).queue);
- cleanerImpl = getCleanerImpl(cleaner);
- insert();
-
- // TODO: Replace getClass() with ReachabilityFence when it is available
- cleaner.getClass();
- referent.getClass();
- }
-
- /**
- * Construct a new root of the list; not inserted.
- */
- WeakCleanable(CleanerImpl cleanerImpl) {
- super(null, null);
- this.cleanerImpl = cleanerImpl;
- }
-
- /**
- * Insert this WeakCleanableReference after the list head.
- */
- private void insert() {
- final WeakCleanable> list = cleanerImpl.weakCleanableList;
- synchronized (list) {
- prev = list;
- next = list.next;
- next.prev = this;
- list.next = this;
- }
- }
-
- /**
- * Remove this WeakCleanableReference from the list.
- *
- * @return true if Cleanable was removed or false if not because
- * it had already been removed before
- */
- private boolean remove() {
- WeakCleanable> list = cleanerImpl.weakCleanableList;
- synchronized (list) {
- if (next != this) {
- next.prev = prev;
- prev.next = next;
- prev = this;
- next = this;
- return true;
- }
- return false;
- }
- }
-
- /**
- * Returns true if the list's next reference refers to itself.
- *
- * @return true if the list is empty
- */
- boolean isListEmpty() {
- WeakCleanable> list = cleanerImpl.weakCleanableList;
- synchronized (list) {
- return list == list.next;
- }
- }
-
- /**
- * Unregister this WeakCleanable reference and invoke {@link #performCleanup()},
- * ensuring at-most-once semantics.
- */
- @Override
- public final void clean() {
- if (remove()) {
- super.clear();
- performCleanup();
- }
- }
-
- /**
- * Unregister this WeakCleanable and clear the reference.
- * Due to inherent concurrency, {@link #performCleanup()} may still be invoked.
- */
- @Override
- public void clear() {
- if (remove()) {
- super.clear();
- }
- }
-
- /**
- * The {@code performCleanup} abstract method is overridden
- * to implement the cleaning logic.
- * The {@code performCleanup} method should not be called except
- * by the {@link #clean} method which ensures at most once semantics.
- */
- protected abstract void performCleanup();
-
- /**
- * This method always throws {@link UnsupportedOperationException}.
- * Enqueuing details of {@link java.lang.ref.Cleaner.Cleanable}
- * are a private implementation detail.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public final boolean isEnqueued() {
- throw new UnsupportedOperationException("isEnqueued");
- }
-
- /**
- * This method always throws {@link UnsupportedOperationException}.
- * Enqueuing details of {@link java.lang.ref.Cleaner.Cleanable}
- * are a private implementation detail.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public final boolean enqueue() {
- throw new UnsupportedOperationException("enqueue");
- }
- }
-
- /**
- * SoftCleanable subclasses efficiently encapsulate cleanup state and
- * the cleaning action.
- * Subclasses implement the abstract {@link #performCleanup()} method
- * to provide the cleaning action.
- * When constructed, the object reference and the {@link Cleanable Cleanable}
- * are registered with the {@link Cleaner}.
- * The Cleaner invokes {@link Cleaner.Cleanable#clean() clean} after the
- * referent becomes softly reachable.
- */
- public static abstract class SoftCleanable extends SoftReference
- implements Cleaner.Cleanable {
-
- /**
- * Links to previous and next in a doubly-linked list.
- */
- SoftCleanable> prev = this, next = this;
-
- /**
- * The CleanerImpl for this Cleanable.
- */
- private final CleanerImpl cleanerImpl;
-
- /**
- * Constructs new {@code SoftCleanableReference} with
- * {@code non-null referent} and {@code non-null cleaner}.
- * The {@code cleaner} is not retained by this reference; it is only used
- * to register the newly constructed {@link Cleaner.Cleanable Cleanable}.
- *
- * @param referent the referent to track
- * @param cleaner the {@code Cleaner} to register with
- */
- public SoftCleanable(T referent, Cleaner cleaner) {
- super(Objects.requireNonNull(referent), getCleanerImpl(cleaner).queue);
- cleanerImpl = getCleanerImpl(cleaner);
- insert();
-
- // TODO: Replace getClass() with ReachabilityFence when it is available
- cleaner.getClass();
- referent.getClass();
- }
-
- /**
- * Construct a new root of the list; not inserted.
- */
- SoftCleanable(CleanerImpl cleanerImpl) {
- super(null, null);
- this.cleanerImpl = cleanerImpl;
- }
-
- /**
- * Insert this SoftCleanableReference after the list head.
- */
- private void insert() {
- final SoftCleanable> list = cleanerImpl.softCleanableList;
- synchronized (list) {
- prev = list;
- next = list.next;
- next.prev = this;
- list.next = this;
- }
- }
-
- /**
- * Remove this SoftCleanableReference from the list.
- *
- * @return true if Cleanable was removed or false if not because
- * it had already been removed before
- */
- private boolean remove() {
- SoftCleanable> list = cleanerImpl.softCleanableList;
- synchronized (list) {
- if (next != this) {
- next.prev = prev;
- prev.next = next;
- prev = this;
- next = this;
- return true;
- }
- return false;
- }
- }
-
- /**
- * Returns true if the list's next reference refers to itself.
- *
- * @return true if the list is empty
- */
- boolean isListEmpty() {
- SoftCleanable> list = cleanerImpl.softCleanableList;
- synchronized (list) {
- return list == list.next;
- }
- }
-
- /**
- * Unregister this SoftCleanable reference and invoke {@link #performCleanup()},
- * ensuring at-most-once semantics.
- */
- @Override
- public final void clean() {
- if (remove()) {
- super.clear();
- performCleanup();
- }
- }
-
- /**
- * Unregister this SoftCleanable and clear the reference.
- * Due to inherent concurrency, {@link #performCleanup()} may still be invoked.
- */
- @Override
- public void clear() {
- if (remove()) {
- super.clear();
- }
- }
-
- /**
- * The {@code performCleanup} abstract method is overridden
- * to implement the cleaning logic.
- * The {@code performCleanup} method should not be called except
- * by the {@link #clean} method which ensures at most once semantics.
- */
- protected abstract void performCleanup();
-
- /**
- * This method always throws {@link UnsupportedOperationException}.
- * Enqueuing details of {@link Cleaner.Cleanable}
- * are a private implementation detail.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public final boolean isEnqueued() {
- throw new UnsupportedOperationException("isEnqueued");
- }
-
- /**
- * This method always throws {@link UnsupportedOperationException}.
- * Enqueuing details of {@link Cleaner.Cleanable}
- * are a private implementation detail.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public final boolean enqueue() {
- throw new UnsupportedOperationException("enqueue");
- }
- }
-
- /**
- * Perform cleaning on an unreachable PhantomReference.
- */
- public static final class PhantomCleanableRef extends PhantomCleanable {
- private final Runnable action;
-
- /**
- * Constructor for a phantom cleanable reference.
- * @param obj the object to monitor
- * @param cleaner the cleaner
- * @param action the action Runnable
- */
- public PhantomCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
- super(obj, cleaner);
- this.action = action;
- }
-
- /**
- * Constructor used only for root of phantom cleanable list.
- * @param cleanerImpl the cleanerImpl
- */
- PhantomCleanableRef(CleanerImpl cleanerImpl) {
- super(cleanerImpl);
- this.action = null;
- }
-
- @Override
- protected void performCleanup() {
- action.run();
- }
-
- /**
- * Prevent access to referent even when it is still alive.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public Object get() {
- throw new UnsupportedOperationException("get");
- }
-
- /**
- * Direct clearing of the referent is not supported.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public void clear() {
- throw new UnsupportedOperationException("clear");
- }
- }
-
- /**
- * Perform cleaning on an unreachable WeakReference.
- */
- public static final class WeakCleanableRef extends WeakCleanable {
- private final Runnable action;
-
- /**
- * Constructor for a weak cleanable reference.
- * @param obj the object to monitor
- * @param cleaner the cleaner
- * @param action the action Runnable
- */
- WeakCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
- super(obj, cleaner);
- this.action = action;
- }
-
- /**
- * Constructor used only for root of weak cleanable list.
- * @param cleanerImpl the cleanerImpl
- */
- WeakCleanableRef(CleanerImpl cleanerImpl) {
- super(cleanerImpl);
- this.action = null;
- }
-
- @Override
- protected void performCleanup() {
- action.run();
- }
-
- /**
- * Prevent access to referent even when it is still alive.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public Object get() {
- throw new UnsupportedOperationException("get");
- }
-
- /**
- * Direct clearing of the referent is not supported.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public void clear() {
- throw new UnsupportedOperationException("clear");
- }
- }
-
- /**
- * Perform cleaning on an unreachable SoftReference.
- */
- public static final class SoftCleanableRef extends SoftCleanable {
- private final Runnable action;
-
- /**
- * Constructor for a soft cleanable reference.
- * @param obj the object to monitor
- * @param cleaner the cleaner
- * @param action the action Runnable
- */
- SoftCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
- super(obj, cleaner);
- this.action = action;
- }
-
- /**
- * Constructor used only for root of soft cleanable list.
- * @param cleanerImpl the cleanerImpl
- */
- SoftCleanableRef(CleanerImpl cleanerImpl) {
- super(cleanerImpl);
- this.action = null;
- }
-
- @Override
- protected void performCleanup() {
- action.run();
- }
-
- /**
- * Prevent access to referent even when it is still alive.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public Object get() {
- throw new UnsupportedOperationException("get");
- }
-
- /**
- * Direct clearing of the referent is not supported.
- *
- * @throws UnsupportedOperationException always
- */
- @Override
- public void clear() {
- throw new UnsupportedOperationException("clear");
- }
-
- }
-
- /**
- * A ThreadFactory for InnocuousThreads.
- * The factory is a singleton.
- */
- static final class InnocuousThreadFactory implements ThreadFactory {
- final static ThreadFactory factory = new InnocuousThreadFactory();
-
- static ThreadFactory factory() {
- return factory;
- }
-
- public Thread newThread(Runnable r) {
- return AccessController.doPrivileged((PrivilegedAction) () -> {
- Thread t = new InnocuousThread(r);
- t.setPriority(Thread.MAX_PRIORITY - 2);
- t.setName("Cleaner-" + t.getId());
- return t;
- });
- }
- }
-
-}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
index 83bb4f34ff1..9176784def0 100644
--- a/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/Unsafe.java
@@ -30,7 +30,7 @@ import java.security.ProtectionDomain;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
import jdk.internal.HotSpotIntrinsicCandidate;
diff --git a/jdk/src/java.base/share/classes/sun/misc/VM.java b/jdk/src/java.base/share/classes/jdk/internal/misc/VM.java
similarity index 99%
rename from jdk/src/java.base/share/classes/sun/misc/VM.java
rename to jdk/src/java.base/share/classes/jdk/internal/misc/VM.java
index 4c83dfaf049..04af46a49f9 100644
--- a/jdk/src/java.base/share/classes/sun/misc/VM.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/VM.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.misc;
+package jdk.internal.misc;
import static java.lang.Thread.State.*;
import java.util.Properties;
diff --git a/jdk/src/java.base/share/classes/sun/misc/VMNotification.java b/jdk/src/java.base/share/classes/jdk/internal/misc/VMNotification.java
similarity index 98%
rename from jdk/src/java.base/share/classes/sun/misc/VMNotification.java
rename to jdk/src/java.base/share/classes/jdk/internal/misc/VMNotification.java
index bf4abef3432..3c7ad9b4891 100644
--- a/jdk/src/java.base/share/classes/sun/misc/VMNotification.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/misc/VMNotification.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.misc;
+package jdk.internal.misc;
/** @deprecated */
@Deprecated
diff --git a/jdk/src/java.base/share/classes/sun/misc/Perf.java b/jdk/src/java.base/share/classes/jdk/internal/perf/Perf.java
similarity index 94%
rename from jdk/src/java.base/share/classes/sun/misc/Perf.java
rename to jdk/src/java.base/share/classes/jdk/internal/perf/Perf.java
index 311e92c8f64..e660cdf3ebe 100644
--- a/jdk/src/java.base/share/classes/sun/misc/Perf.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/perf/Perf.java
@@ -22,13 +22,14 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-package sun.misc;
+package jdk.internal.perf;
import java.nio.ByteBuffer;
import java.security.Permission;
import java.security.PrivilegedAction;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import jdk.internal.ref.CleanerFactory;
/**
* The Perf class provides the ability to attach to an instrumentation
@@ -46,7 +47,7 @@ import java.io.UnsupportedEncodingException;
* @author Brian Doherty
* @since 1.4.2
* @see #getPerf
- * @see sun.misc.Perf$GetPerfAction
+ * @see jdk.internal.perf.Perf.GetPerfAction
* @see java.nio.ByteBuffer
*/
public final class Perf {
@@ -123,10 +124,10 @@ public final class Perf {
* Please note that the "sun.misc.Perf.getPerf" permission
* is not a JDK specified permission.
*
- * @return A reference to the singleton Perf instance.
- * @throws AccessControlException if a security manager exists and
- * its checkPermission
method doesn't allow
- * access to the "sun.misc.Perf.getPerf" target.
+ * @return A reference to the singleton Perf instance.
+ * @throws SecurityException if a security manager exists and its
+ * checkPermission
method doesn't allow access
+ * to the "jdk.internal.perf.Perf.getPerf"" target.
* @see java.lang.RuntimePermission
* @see #attach
*/
@@ -134,7 +135,7 @@ public final class Perf {
{
SecurityManager security = System.getSecurityManager();
if (security != null) {
- Permission perm = new RuntimePermission("sun.misc.Perf.getPerf");
+ Permission perm = new RuntimePermission("jdk.internal.perf.Perf.getPerf");
security.checkPermission(perm);
}
@@ -277,27 +278,35 @@ public final class Perf {
// This is an instrumentation buffer for another Java virtual
// machine with native resources that need to be managed. We
// create a duplicate of the native ByteBuffer and manage it
- // with a Cleaner object (PhantomReference). When the duplicate
- // becomes only phantomly reachable, the native resources will
- // be released.
+ // with a Cleaner. When the duplicate becomes phantom reachable,
+ // the native resources will be released.
final ByteBuffer dup = b.duplicate();
- Cleaner.create(dup, new Runnable() {
- public void run() {
- try {
- instance.detach(b);
- }
- catch (Throwable th) {
- // avoid crashing the reference handler thread,
- // but provide for some diagnosability
- assert false : th.toString();
- }
- }
- });
+
+ CleanerFactory.cleaner()
+ .register(dup, new CleanerAction(instance, b));
return dup;
}
}
+ private static class CleanerAction implements Runnable {
+ private final ByteBuffer bb;
+ private final Perf perf;
+ CleanerAction(Perf perf, ByteBuffer bb) {
+ this.perf = perf;
+ this.bb = bb;
+ }
+ public void run() {
+ try {
+ perf.detach(bb);
+ } catch (Throwable th) {
+ // avoid crashing the reference handler thread,
+ // but provide for some diagnosability
+ assert false : th.toString();
+ }
+ }
+ }
+
/**
* Native method to perform the implementation specific attach mechanism.
*
@@ -341,7 +350,7 @@ public final class Perf {
* machine running this method (lvmid=0, for example), then the detach
* request is silently ignored.
*
- * @param ByteBuffer A direct allocated byte buffer created by the
+ * @param bb A direct allocated byte buffer created by the
* attach
method.
* @see java.nio.ByteBuffer
* @see #attach
diff --git a/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java b/jdk/src/java.base/share/classes/jdk/internal/perf/PerfCounter.java
similarity index 99%
rename from jdk/src/java.base/share/classes/sun/misc/PerfCounter.java
rename to jdk/src/java.base/share/classes/jdk/internal/perf/PerfCounter.java
index aa054707937..1c0d0a1f341 100644
--- a/jdk/src/java.base/share/classes/sun/misc/PerfCounter.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/perf/PerfCounter.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.misc;
+package jdk.internal.perf;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
diff --git a/nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java b/jdk/src/java.base/share/classes/jdk/internal/ref/CleanerFactory.java
similarity index 65%
rename from nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java
rename to jdk/src/java.base/share/classes/jdk/internal/ref/CleanerFactory.java
index a23404bed0a..011eb1c53e3 100644
--- a/nashorn/test/src/jdk/internal/dynalink/beans/test/CallerSensitiveTest.java
+++ b/jdk/src/java.base/share/classes/jdk/internal/ref/CleanerFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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,16 +23,26 @@
* questions.
*/
-package jdk.internal.dynalink.beans.test;
+package jdk.internal.ref;
-import jdk.dynalink.beans.BeansLinker;
-import jdk.nashorn.test.models.ClassLoaderAware;
-import org.testng.annotations.Test;
+import java.lang.ref.Cleaner;
-@SuppressWarnings("javadoc")
-public class CallerSensitiveTest {
- @Test
- public void testCallerSensitive() {
- BeansLinker.getLinkerForClass(ClassLoaderAware.class);
+/**
+ * CleanerFactory provides a Cleaner for use within OpenJDK modules.
+ * The cleaner is created on the first reference to the CleanerFactory.
+ */
+public final class CleanerFactory {
+
+ /* The common Cleaner. */
+ private final static Cleaner commonCleaner = Cleaner.create();
+
+ /**
+ * Cleaner for use within OpenJDK modules.
+ *
+ * @return a Cleaner for use within OpenJDK modules
+ */
+ public static Cleaner cleaner() {
+ return commonCleaner;
}
+
}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java b/jdk/src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java
new file mode 100644
index 00000000000..7434467aa4c
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/ref/CleanerImpl.java
@@ -0,0 +1,333 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.ref;
+
+import java.lang.ref.Cleaner;
+import java.lang.ref.Cleaner.Cleanable;
+import java.lang.ref.ReferenceQueue;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.concurrent.ThreadFactory;
+import java.util.function.Function;
+
+import sun.misc.InnocuousThread;
+
+/**
+ * CleanerImpl manages a set of object references and corresponding cleaning actions.
+ * CleanerImpl provides the functionality of {@link java.lang.ref.Cleaner}.
+ */
+public final class CleanerImpl {
+
+ /**
+ * An object to access the CleanerImpl from a Cleaner; set by Cleaner init.
+ */
+ private static Function cleanerImplAccess = null;
+
+ /**
+ * Heads of a CleanableList for each reference type.
+ */
+ final PhantomCleanable> phantomCleanableList;
+
+ final WeakCleanable> weakCleanableList;
+
+ final SoftCleanable> softCleanableList;
+
+ // The ReferenceQueue of pending cleaning actions
+ final ReferenceQueue queue;
+
+ /**
+ * Called by Cleaner static initialization to provide the function
+ * to map from Cleaner to CleanerImpl.
+ * @param access a function to map from Cleaner to CleanerImpl
+ */
+ public static void setCleanerImplAccess(Function access) {
+ if (cleanerImplAccess == null) {
+ cleanerImplAccess = access;
+ } else {
+ throw new InternalError("cleanerImplAccess");
+ }
+ }
+
+ /**
+ * Called to get the CleanerImpl for a Cleaner.
+ * @param cleaner the cleaner
+ * @return the corresponding CleanerImpl
+ */
+ static CleanerImpl getCleanerImpl(Cleaner cleaner) {
+ return cleanerImplAccess.apply(cleaner);
+ }
+
+ /**
+ * Constructor for CleanerImpl.
+ */
+ public CleanerImpl() {
+ queue = new ReferenceQueue<>();
+ phantomCleanableList = new PhantomCleanableRef();
+ weakCleanableList = new WeakCleanableRef();
+ softCleanableList = new SoftCleanableRef();
+ }
+
+ /**
+ * Starts the Cleaner implementation.
+ * Ensure this is the CleanerImpl for the Cleaner.
+ * When started waits for Cleanables to be queued.
+ * @param cleaner the cleaner
+ * @param threadFactory the thread factory
+ */
+ public void start(Cleaner cleaner, ThreadFactory threadFactory) {
+ if (getCleanerImpl(cleaner) != this) {
+ throw new AssertionError("wrong cleaner");
+ }
+ // schedule a nop cleaning action for the cleaner, so the associated thread
+ // will continue to run at least until the cleaner is reclaimable.
+ new PhantomCleanableRef(cleaner, cleaner, () -> {});
+
+ if (threadFactory == null) {
+ threadFactory = CleanerImpl.InnocuousThreadFactory.factory();
+ }
+
+ // now that there's at least one cleaning action, for the cleaner,
+ // we can start the associated thread, which runs until
+ // all cleaning actions have been run.
+ Thread thread = threadFactory.newThread(this::run);
+ thread.setDaemon(true);
+ thread.start();
+ }
+
+ /**
+ * Process queued Cleanables as long as the cleanable lists are not empty.
+ * A Cleanable is in one of the lists for each Object and for the Cleaner
+ * itself.
+ * Terminates when the Cleaner is no longer reachable and
+ * has been cleaned and there are no more Cleanable instances
+ * for which the object is reachable.
+ *
+ * If the thread is a ManagedLocalsThread, the threadlocals
+ * are erased before each cleanup
+ */
+ private void run() {
+ Thread t = Thread.currentThread();
+ InnocuousThread mlThread = (t instanceof InnocuousThread)
+ ? (InnocuousThread) t
+ : null;
+ while (!phantomCleanableList.isListEmpty() ||
+ !weakCleanableList.isListEmpty() ||
+ !softCleanableList.isListEmpty()) {
+ if (mlThread != null) {
+ // Clear the thread locals
+ mlThread.eraseThreadLocals();
+ }
+ try {
+ // Wait for a Ref, with a timeout to avoid getting hung
+ // due to a race with clear/clean
+ Cleanable ref = (Cleanable) queue.remove(60 * 1000L);
+ if (ref != null) {
+ ref.clean();
+ }
+ } catch (InterruptedException i) {
+ continue; // ignore the interruption
+ } catch (Throwable e) {
+ // ignore exceptions from the cleanup action
+ }
+ }
+ }
+
+ /**
+ * Perform cleaning on an unreachable PhantomReference.
+ */
+ public static final class PhantomCleanableRef extends PhantomCleanable {
+ private final Runnable action;
+
+ /**
+ * Constructor for a phantom cleanable reference.
+ * @param obj the object to monitor
+ * @param cleaner the cleaner
+ * @param action the action Runnable
+ */
+ public PhantomCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
+ super(obj, cleaner);
+ this.action = action;
+ }
+
+ /**
+ * Constructor used only for root of phantom cleanable list.
+ */
+ PhantomCleanableRef() {
+ super();
+ this.action = null;
+ }
+
+ @Override
+ protected void performCleanup() {
+ action.run();
+ }
+
+ /**
+ * Prevent access to referent even when it is still alive.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public Object get() {
+ throw new UnsupportedOperationException("get");
+ }
+
+ /**
+ * Direct clearing of the referent is not supported.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException("clear");
+ }
+ }
+
+ /**
+ * Perform cleaning on an unreachable WeakReference.
+ */
+ public static final class WeakCleanableRef extends WeakCleanable {
+ private final Runnable action;
+
+ /**
+ * Constructor for a weak cleanable reference.
+ * @param obj the object to monitor
+ * @param cleaner the cleaner
+ * @param action the action Runnable
+ */
+ WeakCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
+ super(obj, cleaner);
+ this.action = action;
+ }
+
+ /**
+ * Constructor used only for root of weak cleanable list.
+ */
+ WeakCleanableRef() {
+ super();
+ this.action = null;
+ }
+
+ @Override
+ protected void performCleanup() {
+ action.run();
+ }
+
+ /**
+ * Prevent access to referent even when it is still alive.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public Object get() {
+ throw new UnsupportedOperationException("get");
+ }
+
+ /**
+ * Direct clearing of the referent is not supported.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException("clear");
+ }
+ }
+
+ /**
+ * Perform cleaning on an unreachable SoftReference.
+ */
+ public static final class SoftCleanableRef extends SoftCleanable {
+ private final Runnable action;
+
+ /**
+ * Constructor for a soft cleanable reference.
+ * @param obj the object to monitor
+ * @param cleaner the cleaner
+ * @param action the action Runnable
+ */
+ SoftCleanableRef(Object obj, Cleaner cleaner, Runnable action) {
+ super(obj, cleaner);
+ this.action = action;
+ }
+
+ /**
+ * Constructor used only for root of soft cleanable list.
+ */
+ SoftCleanableRef() {
+ super();
+ this.action = null;
+ }
+
+ @Override
+ protected void performCleanup() {
+ action.run();
+ }
+
+ /**
+ * Prevent access to referent even when it is still alive.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public Object get() {
+ throw new UnsupportedOperationException("get");
+ }
+
+ /**
+ * Direct clearing of the referent is not supported.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public void clear() {
+ throw new UnsupportedOperationException("clear");
+ }
+
+ }
+
+ /**
+ * A ThreadFactory for InnocuousThreads.
+ * The factory is a singleton.
+ */
+ static final class InnocuousThreadFactory implements ThreadFactory {
+ final static ThreadFactory factory = new InnocuousThreadFactory();
+
+ static ThreadFactory factory() {
+ return factory;
+ }
+
+ public Thread newThread(Runnable r) {
+ return AccessController.doPrivileged((PrivilegedAction) () -> {
+ Thread t = new InnocuousThread(r);
+ t.setPriority(Thread.MAX_PRIORITY - 2);
+ t.setName("Cleaner-" + t.getId());
+ return t;
+ });
+ }
+ }
+
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java b/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java
new file mode 100644
index 00000000000..7e177b1e4f4
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/ref/PhantomCleanable.java
@@ -0,0 +1,178 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.ref;
+
+import java.lang.ref.Cleaner;
+import java.lang.ref.PhantomReference;
+import java.util.Objects;
+
+/**
+ * PhantomCleanable subclasses efficiently encapsulate cleanup state and
+ * the cleaning action.
+ * Subclasses implement the abstract {@link #performCleanup()} method
+ * to provide the cleaning action.
+ * When constructed, the object reference and the {@link Cleaner.Cleanable Cleanable}
+ * are registered with the {@link Cleaner}.
+ * The Cleaner invokes {@link Cleaner.Cleanable#clean() clean} after the
+ * referent becomes phantom reachable.
+ */
+public abstract class PhantomCleanable extends PhantomReference
+ implements Cleaner.Cleanable {
+
+ /**
+ * Links to previous and next in a doubly-linked list.
+ */
+ PhantomCleanable> prev = this, next = this;
+
+ /**
+ * The list of PhantomCleanable; synchronizes insert and remove.
+ */
+ private final PhantomCleanable> list;
+
+ /**
+ * Constructs new {@code PhantomCleanable} with
+ * {@code non-null referent} and {@code non-null cleaner}.
+ * The {@code cleaner} is not retained; it is only used to
+ * register the newly constructed {@link Cleaner.Cleanable Cleanable}.
+ *
+ * @param referent the referent to track
+ * @param cleaner the {@code Cleaner} to register with
+ */
+ public PhantomCleanable(T referent, Cleaner cleaner) {
+ super(Objects.requireNonNull(referent), CleanerImpl.getCleanerImpl(cleaner).queue);
+ this.list = CleanerImpl.getCleanerImpl(cleaner).phantomCleanableList;
+ insert();
+
+ // TODO: Replace getClass() with ReachabilityFence when it is available
+ cleaner.getClass();
+ referent.getClass();
+ }
+
+ /**
+ * Construct a new root of the list; not inserted.
+ */
+ PhantomCleanable() {
+ super(null, null);
+ this.list = this;
+ }
+
+ /**
+ * Insert this PhantomCleanable after the list head.
+ */
+ private void insert() {
+ synchronized (list) {
+ prev = list;
+ next = list.next;
+ next.prev = this;
+ list.next = this;
+ }
+ }
+
+ /**
+ * Remove this PhantomCleanable from the list.
+ *
+ * @return true if Cleanable was removed or false if not because
+ * it had already been removed before
+ */
+ private boolean remove() {
+ synchronized (list) {
+ if (next != this) {
+ next.prev = prev;
+ prev.next = next;
+ prev = this;
+ next = this;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Returns true if the list's next reference refers to itself.
+ *
+ * @return true if the list is empty
+ */
+ boolean isListEmpty() {
+ synchronized (list) {
+ return list == list.next;
+ }
+ }
+
+ /**
+ * Unregister this PhantomCleanable and invoke {@link #performCleanup()},
+ * ensuring at-most-once semantics.
+ */
+ @Override
+ public final void clean() {
+ if (remove()) {
+ super.clear();
+ performCleanup();
+ }
+ }
+
+ /**
+ * Unregister this PhantomCleanable and clear the reference.
+ * Due to inherent concurrency, {@link #performCleanup()} may still be invoked.
+ */
+ @Override
+ public void clear() {
+ if (remove()) {
+ super.clear();
+ }
+ }
+
+ /**
+ * The {@code performCleanup} abstract method is overridden
+ * to implement the cleaning logic.
+ * The {@code performCleanup} method should not be called except
+ * by the {@link #clean} method which ensures at most once semantics.
+ */
+ protected abstract void performCleanup();
+
+ /**
+ * This method always throws {@link UnsupportedOperationException}.
+ * Enqueuing details of {@link Cleaner.Cleanable}
+ * are a private implementation detail.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public final boolean isEnqueued() {
+ throw new UnsupportedOperationException("isEnqueued");
+ }
+
+ /**
+ * This method always throws {@link UnsupportedOperationException}.
+ * Enqueuing details of {@link Cleaner.Cleanable}
+ * are a private implementation detail.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public final boolean enqueue() {
+ throw new UnsupportedOperationException("enqueue");
+ }
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java b/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java
new file mode 100644
index 00000000000..45ddf85863b
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/ref/SoftCleanable.java
@@ -0,0 +1,178 @@
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.internal.ref;
+
+import java.lang.ref.Cleaner;
+import java.lang.ref.SoftReference;
+import java.util.Objects;
+
+/**
+ * SoftCleanable subclasses efficiently encapsulate cleanup state and
+ * the cleaning action.
+ * Subclasses implement the abstract {@link #performCleanup()} method
+ * to provide the cleaning action.
+ * When constructed, the object reference and the {@link Cleaner.Cleanable Cleanable}
+ * are registered with the {@link Cleaner}.
+ * The Cleaner invokes {@link Cleaner.Cleanable#clean() clean} after the
+ * referent becomes softly reachable.
+ */
+public abstract class SoftCleanable extends SoftReference
+ implements Cleaner.Cleanable {
+
+ /**
+ * Links to previous and next in a doubly-linked list.
+ */
+ SoftCleanable> prev = this, next = this;
+
+ /**
+ * The list of SoftCleanable; synchronizes insert and remove.
+ */
+ private final SoftCleanable> list;
+
+ /**
+ * Constructs new {@code SoftCleanableReference} with
+ * {@code non-null referent} and {@code non-null cleaner}.
+ * The {@code cleaner} is not retained by this reference; it is only used
+ * to register the newly constructed {@link Cleaner.Cleanable Cleanable}.
+ *
+ * @param referent the referent to track
+ * @param cleaner the {@code Cleaner} to register with
+ */
+ public SoftCleanable(T referent, Cleaner cleaner) {
+ super(Objects.requireNonNull(referent), CleanerImpl.getCleanerImpl(cleaner).queue);
+ list = CleanerImpl.getCleanerImpl(cleaner).softCleanableList;
+ insert();
+
+ // TODO: Replace getClass() with ReachabilityFence when it is available
+ cleaner.getClass();
+ referent.getClass();
+ }
+
+ /**
+ * Construct a new root of the list; not inserted.
+ */
+ SoftCleanable() {
+ super(null, null);
+ this.list = this;
+ }
+
+ /**
+ * Insert this SoftCleanableReference after the list head.
+ */
+ private void insert() {
+ synchronized (list) {
+ prev = list;
+ next = list.next;
+ next.prev = this;
+ list.next = this;
+ }
+ }
+
+ /**
+ * Remove this SoftCleanableReference from the list.
+ *
+ * @return true if Cleanable was removed or false if not because
+ * it had already been removed before
+ */
+ private boolean remove() {
+ synchronized (list) {
+ if (next != this) {
+ next.prev = prev;
+ prev.next = next;
+ prev = this;
+ next = this;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Returns true if the list's next reference refers to itself.
+ *
+ * @return true if the list is empty
+ */
+ boolean isListEmpty() {
+ synchronized (list) {
+ return list == list.next;
+ }
+ }
+
+ /**
+ * Unregister this SoftCleanable reference and invoke {@link #performCleanup()},
+ * ensuring at-most-once semantics.
+ */
+ @Override
+ public final void clean() {
+ if (remove()) {
+ super.clear();
+ performCleanup();
+ }
+ }
+
+ /**
+ * Unregister this SoftCleanable and clear the reference.
+ * Due to inherent concurrency, {@link #performCleanup()} may still be invoked.
+ */
+ @Override
+ public void clear() {
+ if (remove()) {
+ super.clear();
+ }
+ }
+
+ /**
+ * The {@code performCleanup} abstract method is overridden
+ * to implement the cleaning logic.
+ * The {@code performCleanup} method should not be called except
+ * by the {@link #clean} method which ensures at most once semantics.
+ */
+ protected abstract void performCleanup();
+
+ /**
+ * This method always throws {@link UnsupportedOperationException}.
+ * Enqueuing details of {@link Cleaner.Cleanable}
+ * are a private implementation detail.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public final boolean isEnqueued() {
+ throw new UnsupportedOperationException("isEnqueued");
+ }
+
+ /**
+ * This method always throws {@link UnsupportedOperationException}.
+ * Enqueuing details of {@link Cleaner.Cleanable}
+ * are a private implementation detail.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public final boolean enqueue() {
+ throw new UnsupportedOperationException("enqueue");
+ }
+}
diff --git a/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java b/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java
new file mode 100644
index 00000000000..40dd22af25c
--- /dev/null
+++ b/jdk/src/java.base/share/classes/jdk/internal/ref/WeakCleanable.java
@@ -0,0 +1,178 @@
+package jdk.internal.ref;
+
+/*
+ * 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.ref.Cleaner;
+import java.lang.ref.WeakReference;
+import java.util.Objects;
+
+/**
+ * WeakCleanable subclasses efficiently encapsulate cleanup state and
+ * the cleaning action.
+ * Subclasses implement the abstract {@link #performCleanup()} method
+ * to provide the cleaning action.
+ * When constructed, the object reference and the {@link Cleaner.Cleanable Cleanable}
+ * are registered with the {@link Cleaner}.
+ * The Cleaner invokes {@link Cleaner.Cleanable#clean() clean} after the
+ * referent becomes weakly reachable.
+ */
+public abstract class WeakCleanable extends WeakReference
+ implements Cleaner.Cleanable {
+
+ /**
+ * Links to previous and next in a doubly-linked list.
+ */
+ WeakCleanable> prev = this, next = this;
+
+ /**
+ * The list of WeakCleanable; synchronizes insert and remove.
+ */
+ private final WeakCleanable> list;
+
+ /**
+ * Constructs new {@code WeakCleanableReference} with
+ * {@code non-null referent} and {@code non-null cleaner}.
+ * The {@code cleaner} is not retained by this reference; it is only used
+ * to register the newly constructed {@link Cleaner.Cleanable Cleanable}.
+ *
+ * @param referent the referent to track
+ * @param cleaner the {@code Cleaner} to register new reference with
+ */
+ public WeakCleanable(T referent, Cleaner cleaner) {
+ super(Objects.requireNonNull(referent), CleanerImpl.getCleanerImpl(cleaner).queue);
+ list = CleanerImpl.getCleanerImpl(cleaner).weakCleanableList;
+ insert();
+
+ // TODO: Replace getClass() with ReachabilityFence when it is available
+ cleaner.getClass();
+ referent.getClass();
+ }
+
+ /**
+ * Construct a new root of the list; not inserted.
+ */
+ WeakCleanable() {
+ super(null, null);
+ this.list = this;
+ }
+
+ /**
+ * Insert this WeakCleanableReference after the list head.
+ */
+ private void insert() {
+ synchronized (list) {
+ prev = list;
+ next = list.next;
+ next.prev = this;
+ list.next = this;
+ }
+ }
+
+ /**
+ * Remove this WeakCleanableReference from the list.
+ *
+ * @return true if Cleanable was removed or false if not because
+ * it had already been removed before
+ */
+ private boolean remove() {
+ synchronized (list) {
+ if (next != this) {
+ next.prev = prev;
+ prev.next = next;
+ prev = this;
+ next = this;
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Returns true if the list's next reference refers to itself.
+ *
+ * @return true if the list is empty
+ */
+ boolean isListEmpty() {
+ synchronized (list) {
+ return list == list.next;
+ }
+ }
+
+ /**
+ * Unregister this WeakCleanable reference and invoke {@link #performCleanup()},
+ * ensuring at-most-once semantics.
+ */
+ @Override
+ public final void clean() {
+ if (remove()) {
+ super.clear();
+ performCleanup();
+ }
+ }
+
+ /**
+ * Unregister this WeakCleanable and clear the reference.
+ * Due to inherent concurrency, {@link #performCleanup()} may still be invoked.
+ */
+ @Override
+ public void clear() {
+ if (remove()) {
+ super.clear();
+ }
+ }
+
+ /**
+ * The {@code performCleanup} abstract method is overridden
+ * to implement the cleaning logic.
+ * The {@code performCleanup} method should not be called except
+ * by the {@link #clean} method which ensures at most once semantics.
+ */
+ protected abstract void performCleanup();
+
+ /**
+ * This method always throws {@link UnsupportedOperationException}.
+ * Enqueuing details of {@link Cleaner.Cleanable}
+ * are a private implementation detail.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public final boolean isEnqueued() {
+ throw new UnsupportedOperationException("isEnqueued");
+ }
+
+ /**
+ * This method always throws {@link UnsupportedOperationException}.
+ * Enqueuing details of {@link Cleaner.Cleanable}
+ * are a private implementation detail.
+ *
+ * @throws UnsupportedOperationException always
+ */
+ @Override
+ public final boolean enqueue() {
+ throw new UnsupportedOperationException("enqueue");
+ }
+}
diff --git a/jdk/src/java.base/share/classes/jdk/net/ExtendedSocketOptions.java b/jdk/src/java.base/share/classes/jdk/net/ExtendedSocketOptions.java
index a44560b4597..12af5aff7ee 100644
--- a/jdk/src/java.base/share/classes/jdk/net/ExtendedSocketOptions.java
+++ b/jdk/src/java.base/share/classes/jdk/net/ExtendedSocketOptions.java
@@ -34,7 +34,6 @@ import java.net.SocketOption;
*
* @since 1.8
*/
-@jdk.Exported
public final class ExtendedSocketOptions {
private static class ExtSocketOption implements SocketOption {
diff --git a/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java b/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java
index df740da8488..285f305652f 100644
--- a/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java
+++ b/jdk/src/java.base/share/classes/jdk/net/NetworkPermission.java
@@ -61,7 +61,6 @@ import java.security.BasicPermission;
* @since 1.8
*/
-@jdk.Exported
public final class NetworkPermission extends BasicPermission {
private static final long serialVersionUID = -2012939586906722291L;
diff --git a/jdk/src/java.base/share/classes/jdk/net/SocketFlow.java b/jdk/src/java.base/share/classes/jdk/net/SocketFlow.java
index 3d673d1fc44..12d1ed386d1 100644
--- a/jdk/src/java.base/share/classes/jdk/net/SocketFlow.java
+++ b/jdk/src/java.base/share/classes/jdk/net/SocketFlow.java
@@ -45,7 +45,6 @@ import java.lang.annotation.Native;
*
* @since 1.8
*/
-@jdk.Exported
public class SocketFlow {
private static final int UNSET = -1;
@@ -68,7 +67,6 @@ public class SocketFlow {
*
* @since 1.8
*/
- @jdk.Exported
public enum Status {
/**
* Set or get socket option has not been called yet. Status
diff --git a/jdk/src/java.base/share/classes/jdk/net/Sockets.java b/jdk/src/java.base/share/classes/jdk/net/Sockets.java
index bf096c01bf4..1ba53f29a15 100644
--- a/jdk/src/java.base/share/classes/jdk/net/Sockets.java
+++ b/jdk/src/java.base/share/classes/jdk/net/Sockets.java
@@ -55,7 +55,6 @@ import sun.net.ExtendedOptionsImpl;
*
* @see java.nio.channels.NetworkChannel
*/
-@jdk.Exported
public class Sockets {
private static final HashMap,Set>>
diff --git a/jdk/src/java.base/share/classes/jdk/net/package-info.java b/jdk/src/java.base/share/classes/jdk/net/package-info.java
index fd824f6fd1d..97b3ef1bb82 100644
--- a/jdk/src/java.base/share/classes/jdk/net/package-info.java
+++ b/jdk/src/java.base/share/classes/jdk/net/package-info.java
@@ -30,5 +30,4 @@
* @since 1.8
*/
-@jdk.Exported
package jdk.net;
diff --git a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
index 5845979b1a5..3f9e3668e69 100644
--- a/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
+++ b/jdk/src/java.base/share/classes/sun/launcher/LauncherHelper.java
@@ -66,6 +66,7 @@ import java.util.TreeSet;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
+import jdk.internal.misc.VM;
public enum LauncherHelper {
INSTANCE;
@@ -86,9 +87,9 @@ public enum LauncherHelper {
private static final String PROP_SETTINGS = "Property settings:";
private static final String LOCALE_SETTINGS = "Locale settings:";
- // sync with java.c and sun.misc.VM
+ // sync with java.c and jdk.internal.misc.VM
private static final String diagprop = "sun.java.launcher.diag";
- static final boolean trace = sun.misc.VM.getSavedProperty(diagprop) != null;
+ static final boolean trace = VM.getSavedProperty(diagprop) != null;
private static final String defaultBundleName =
"sun.launcher.resources.launcher";
diff --git a/jdk/src/java.base/share/classes/sun/misc/MessageUtils.java b/jdk/src/java.base/share/classes/sun/misc/MessageUtils.java
deleted file mode 100644
index 75d5ee424dd..00000000000
--- a/jdk/src/java.base/share/classes/sun/misc/MessageUtils.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 1995, 2000, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.misc;
-
-/**
- * MessageUtils: miscellaneous utilities for handling error and status
- * properties and messages.
- *
- * @author Herb Jellinek
- */
-
-public class MessageUtils {
- // can instantiate it for to allow less verbose use - via instance
- // instead of classname
-
- public MessageUtils() { }
-
- public static String subst(String patt, String arg) {
- String args[] = { arg };
- return subst(patt, args);
- }
-
- public static String subst(String patt, String arg1, String arg2) {
- String args[] = { arg1, arg2 };
- return subst(patt, args);
- }
-
- public static String subst(String patt, String arg1, String arg2,
- String arg3) {
- String args[] = { arg1, arg2, arg3 };
- return subst(patt, args);
- }
-
- public static String subst(String patt, String args[]) {
- StringBuilder result = new StringBuilder();
- int len = patt.length();
- for (int i = 0; i >= 0 && i < len; i++) {
- char ch = patt.charAt(i);
- if (ch == '%') {
- if (i != len) {
- int index = Character.digit(patt.charAt(i + 1), 10);
- if (index == -1) {
- result.append(patt.charAt(i + 1));
- i++;
- } else if (index < args.length) {
- result.append(args[index]);
- i++;
- }
- }
- } else {
- result.append(ch);
- }
- }
- return result.toString();
- }
-
- public static String substProp(String propName, String arg) {
- return subst(System.getProperty(propName), arg);
- }
-
- public static String substProp(String propName, String arg1, String arg2) {
- return subst(System.getProperty(propName), arg1, arg2);
- }
-
- public static String substProp(String propName, String arg1, String arg2,
- String arg3) {
- return subst(System.getProperty(propName), arg1, arg2, arg3);
- }
-
- /**
- * Print a message directly to stderr, bypassing all the
- * character conversion methods.
- * @param msg message to print
- */
- public static native void toStderr(String msg);
-
- /**
- * Print a message directly to stdout, bypassing all the
- * character conversion methods.
- * @param msg message to print
- */
- public static native void toStdout(String msg);
-
-
- // Short forms of the above
-
- public static void err(String s) {
- toStderr(s + "\n");
- }
-
- public static void out(String s) {
- toStdout(s + "\n");
- }
-
- // Print a stack trace to stderr
- //
- public static void where() {
- Throwable t = new Throwable();
- StackTraceElement[] es = t.getStackTrace();
- for (int i = 1; i < es.length; i++)
- toStderr("\t" + es[i].toString() + "\n");
- }
-
-}
diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
index 6a4775a4c3a..e07dc31262f 100644
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
+++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
@@ -32,6 +32,7 @@ import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.VM;
/**
diff --git a/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java b/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java
index 920b48d4b64..02c9f98b7a6 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/http/HttpClient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -967,12 +967,6 @@ public class HttpClient extends NetworkClient {
return "";
}
- @Override
- protected void finalize() throws Throwable {
- // This should do nothing. The stream finalizer will
- // close the fd.
- }
-
public void setDoNotRetry(boolean value) {
// failedOnce is used to determine if a request should be retried.
failedOnce = value;
diff --git a/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java b/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java
index f78e1d28b19..1e8697ba237 100644
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/jar/URLJarFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -108,13 +108,6 @@ public class URLJarFile extends JarFile {
return false;
}
- /*
- * close the jar file.
- */
- protected void finalize() throws IOException {
- close();
- }
-
/**
* Returns the ZipEntry
for the given entry name or
* null
if not found.
diff --git a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java
index bb8df722927..3b8d814bcd1 100644
--- a/jdk/src/java.base/share/classes/sun/nio/ch/Util.java
+++ b/jdk/src/java.base/share/classes/sun/nio/ch/Util.java
@@ -389,7 +389,7 @@ public class Util {
static boolean atBugLevel(String bl) { // package-private
if (bugLevel == null) {
- if (!sun.misc.VM.isBooted())
+ if (!jdk.internal.misc.VM.isBooted())
return false;
String value = AccessController.doPrivileged(
new GetPropertyAction("sun.nio.ch.bugLevel"));
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
index 63a5dc62139..dd4d3994240 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
@@ -156,12 +156,12 @@ public class StandardCharsets extends CharsetProvider {
private boolean initialized = false;
- /* provider the sun.nio.cs.map property fir sjis/ms932 mapping hack
+ /* provider the sun.nio.cs.map property fir sjis/ms932 mapping hack
*/
private void init() {
if (initialized)
return;
- if (!sun.misc.VM.isBooted())
+ if (!jdk.internal.misc.VM.isBooted())
return;
initialized = true;
diff --git a/jdk/src/java.base/share/classes/sun/reflect/Reflection.java b/jdk/src/java.base/share/classes/sun/reflect/Reflection.java
index c7c8ded287d..07ff36493d2 100644
--- a/jdk/src/java.base/share/classes/sun/reflect/Reflection.java
+++ b/jdk/src/java.base/share/classes/sun/reflect/Reflection.java
@@ -29,6 +29,7 @@ import java.lang.reflect.*;
import java.util.HashMap;
import java.util.Map;
import jdk.internal.HotSpotIntrinsicCandidate;
+import jdk.internal.misc.VM;
/** Common utility routines used by both java.lang and
java.lang.reflect */
@@ -335,7 +336,7 @@ public class Reflection {
*/
public static boolean isCallerSensitive(Method m) {
final ClassLoader loader = m.getDeclaringClass().getClassLoader();
- if (sun.misc.VM.isSystemDomainLoader(loader) || isExtClassLoader(loader)) {
+ if (VM.isSystemDomainLoader(loader) || isExtClassLoader(loader)) {
return m.isAnnotationPresent(CallerSensitive.class);
}
return false;
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java
index b9b3937f2bd..e7cd2acf126 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java
@@ -2211,7 +2211,7 @@ public final class SSLEngineImpl extends SSLEngine {
@Override
public synchronized String getHandshakeApplicationProtocol() {
- if ((handshaker != null) && !handshaker.started()) {
+ if ((handshaker != null) && handshaker.started()) {
return handshaker.getHandshakeApplicationProtocol();
}
return null;
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
index 9b357d3b42f..86b772c09da 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
@@ -2598,7 +2598,7 @@ public final class SSLSocketImpl extends BaseSSLSocketImpl {
@Override
public synchronized String getHandshakeApplicationProtocol() {
- if ((handshaker != null) && !handshaker.started()) {
+ if ((handshaker != null) && handshaker.started()) {
return handshaker.getHandshakeApplicationProtocol();
}
return null;
diff --git a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java
index 1bc3a042ca6..6eb36e8ca84 100644
--- a/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java
+++ b/jdk/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -153,13 +153,11 @@ final class SignatureAndHashAlgorithm {
getSupportedAlgorithms(AlgorithmConstraints constraints) {
Collection supported = new ArrayList<>();
- synchronized (priorityMap) {
- for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) {
- if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
- constraints.permits(SIGNATURE_PRIMITIVE_SET,
- sigAlg.algorithm, null)) {
- supported.add(sigAlg);
- }
+ for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) {
+ if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
+ constraints.permits(SIGNATURE_PRIMITIVE_SET,
+ sigAlg.algorithm, null)) {
+ supported.add(sigAlg);
}
}
@@ -417,14 +415,12 @@ final class SignatureAndHashAlgorithm {
supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA,
"SHA1withECDSA", --p);
- if (Security.getProvider("SunMSCAPI") == null) {
supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA,
"SHA224withDSA", --p);
supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA,
"SHA224withRSA", --p);
supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA,
"SHA224withECDSA", --p);
- }
supports(HashAlgorithm.SHA256, SignatureAlgorithm.DSA,
"SHA256withDSA", --p);
diff --git a/jdk/src/java.base/share/conf/security/java.policy b/jdk/src/java.base/share/conf/security/java.policy
index b32e8cdfd7c..8ea368707a2 100644
--- a/jdk/src/java.base/share/conf/security/java.policy
+++ b/jdk/src/java.base/share/conf/security/java.policy
@@ -98,17 +98,6 @@ grant codeBase "jrt:/java.activation" {
// default permissions granted to all domains
grant {
- // Allows any thread to stop itself using the java.lang.Thread.stop()
- // method that takes no argument.
- // Note that this permission is granted by default only to remain
- // backwards compatible.
- // It is strongly recommended that you either remove this permission
- // from this policy file or further restrict it to code sources
- // that you specify, because Thread.stop() is potentially unsafe.
- // See the API specification of java.lang.Thread.stop() for more
- // information.
- permission java.lang.RuntimePermission "stopThread";
-
// allows anyone to listen on dynamic ports
permission java.net.SocketPermission "localhost:0", "listen";
diff --git a/jdk/src/java.base/share/native/libjava/RandomAccessFile.c b/jdk/src/java.base/share/native/libjava/RandomAccessFile.c
index a44d8f39681..4c02741f415 100644
--- a/jdk/src/java.base/share/native/libjava/RandomAccessFile.c
+++ b/jdk/src/java.base/share/native/libjava/RandomAccessFile.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -103,23 +103,19 @@ Java_java_io_RandomAccessFile_getFilePointer(JNIEnv *env, jobject this) {
JNIEXPORT jlong JNICALL
Java_java_io_RandomAccessFile_length(JNIEnv *env, jobject this) {
+
FD fd;
- jlong cur = jlong_zero;
- jlong end = jlong_zero;
+ jlong length = jlong_zero;
fd = GET_FD(this, raf_fd);
if (fd == -1) {
JNU_ThrowIOException(env, "Stream Closed");
return -1;
}
- if ((cur = IO_Lseek(fd, 0L, SEEK_CUR)) == -1) {
- JNU_ThrowIOExceptionWithLastError(env, "Seek failed");
- } else if ((end = IO_Lseek(fd, 0L, SEEK_END)) == -1) {
- JNU_ThrowIOExceptionWithLastError(env, "Seek failed");
- } else if (IO_Lseek(fd, cur, SEEK_SET) == -1) {
- JNU_ThrowIOExceptionWithLastError(env, "Seek failed");
+ if ((length = IO_GetLength(fd)) == -1) {
+ JNU_ThrowIOExceptionWithLastError(env, "GetLength failed");
}
- return end;
+ return length;
}
JNIEXPORT void JNICALL
diff --git a/jdk/src/java.base/share/native/libjava/MessageUtils.c b/jdk/src/java.base/share/native/libjava/StringCoding.c
similarity index 86%
rename from jdk/src/java.base/share/native/libjava/MessageUtils.c
rename to jdk/src/java.base/share/native/libjava/StringCoding.c
index 49315dc894d..9ca51cd7425 100644
--- a/jdk/src/java.base/share/native/libjava/MessageUtils.c
+++ b/jdk/src/java.base/share/native/libjava/StringCoding.c
@@ -26,11 +26,10 @@
#include
#include
#include
-#include
#include
#include
-#include "sun_misc_MessageUtils.h"
+#include "java_lang_StringCoding.h"
static void
printToFile(JNIEnv *env, jstring s, FILE *file)
@@ -41,8 +40,8 @@ printToFile(JNIEnv *env, jstring s, FILE *file)
const jchar *sAsArray;
if (s == NULL) {
- s = (*env)->NewStringUTF(env, "null");
- if (s == NULL) return;
+ JNU_ThrowNullPointerException(env, NULL);
+ return;
}
sAsArray = (*env)->GetStringChars(env, s, NULL);
@@ -70,13 +69,7 @@ printToFile(JNIEnv *env, jstring s, FILE *file)
}
JNIEXPORT void JNICALL
-Java_sun_misc_MessageUtils_toStderr(JNIEnv *env, jclass cls, jstring s)
+Java_java_lang_StringCoding_err(JNIEnv *env, jclass cls, jstring s)
{
printToFile(env, s, stderr);
}
-
-JNIEXPORT void JNICALL
-Java_sun_misc_MessageUtils_toStdout(JNIEnv *env, jclass cls, jstring s)
-{
- printToFile(env, s, stdout);
-}
diff --git a/jdk/src/java.base/share/native/libjava/VM.c b/jdk/src/java.base/share/native/libjava/VM.c
index 440ed456ada..61bae65f815 100644
--- a/jdk/src/java.base/share/native/libjava/VM.c
+++ b/jdk/src/java.base/share/native/libjava/VM.c
@@ -28,7 +28,7 @@
#include "jvm.h"
#include "jdk_util.h"
-#include "sun_misc_VM.h"
+#include "jdk_internal_misc_VM.h"
/* Only register the performance-critical methods */
static JNINativeMethod methods[] = {
@@ -36,12 +36,12 @@ static JNINativeMethod methods[] = {
};
JNIEXPORT jobject JNICALL
-Java_sun_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) {
+Java_jdk_internal_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) {
return JVM_LatestUserDefinedLoader(env);
}
JNIEXPORT void JNICALL
-Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
+Java_jdk_internal_misc_VM_initialize(JNIEnv *env, jclass cls) {
if (!JDK_InitJvmHandle()) {
JNU_ThrowInternalError(env, "Handle for JVM not found for symbol lookup");
return;
@@ -50,8 +50,8 @@ Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
// Registers implementations of native methods described in methods[]
// above.
// In particular, registers JVM_GetNanoTimeAdjustment as the implementation
- // of the native sun.misc.VM.getNanoTimeAdjustment - avoiding the cost of
- // introducing a Java_sun_misc_VM_getNanoTimeAdjustment wrapper
+ // of the native VM.getNanoTimeAdjustment - avoiding the cost of
+ // introducing a Java_jdk_internal_misc_VM_getNanoTimeAdjustment wrapper
(*env)->RegisterNatives(env, cls,
methods, sizeof(methods)/sizeof(methods[0]));
}
diff --git a/jdk/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java b/jdk/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java
index c8885841ada..31715d40c82 100644
--- a/jdk/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java
+++ b/jdk/src/java.base/unix/classes/java/net/PlainDatagramSocketImpl.java
@@ -47,6 +47,9 @@ class PlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl
if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
super.setOption(name, value);
} else {
+ if (!flowSupported()) {
+ throw new UnsupportedOperationException("unsupported option");
+ }
if (isClosed()) {
throw new SocketException("Socket closed");
}
@@ -61,6 +64,9 @@ class PlainDatagramSocketImpl extends AbstractPlainDatagramSocketImpl
if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
return super.getOption(name);
}
+ if (!flowSupported()) {
+ throw new UnsupportedOperationException("unsupported option");
+ }
if (isClosed()) {
throw new SocketException("Socket closed");
}
diff --git a/jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java b/jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java
index d07c90da5af..272130bd6b9 100644
--- a/jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java
+++ b/jdk/src/java.base/unix/classes/java/net/PlainSocketImpl.java
@@ -61,6 +61,9 @@ class PlainSocketImpl extends AbstractPlainSocketImpl
if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
super.setOption(name, value);
} else {
+ if (getSocket() == null || !flowSupported()) {
+ throw new UnsupportedOperationException("unsupported option");
+ }
if (isClosedOrPending()) {
throw new SocketException("Socket closed");
}
@@ -75,6 +78,9 @@ class PlainSocketImpl extends AbstractPlainSocketImpl
if (!name.equals(ExtendedSocketOptions.SO_FLOW_SLA)) {
return super.getOption(name);
}
+ if (getSocket() == null || !flowSupported()) {
+ throw new UnsupportedOperationException("unsupported option");
+ }
if (isClosedOrPending()) {
throw new SocketException("Socket closed");
}
diff --git a/jdk/src/java.base/unix/classes/sun/misc/OSEnvironment.java b/jdk/src/java.base/unix/classes/jdk/internal/misc/OSEnvironment.java
similarity index 92%
rename from jdk/src/java.base/unix/classes/sun/misc/OSEnvironment.java
rename to jdk/src/java.base/unix/classes/jdk/internal/misc/OSEnvironment.java
index 5004fd17739..506273a5762 100644
--- a/jdk/src/java.base/unix/classes/sun/misc/OSEnvironment.java
+++ b/jdk/src/java.base/unix/classes/jdk/internal/misc/OSEnvironment.java
@@ -23,12 +23,12 @@
* questions.
*/
-package sun.misc;
+package jdk.internal.misc;
public class OSEnvironment {
/*
- * Initialize any miscellenous operating system settings that need to be set
+ * Initialize any miscellaneous operating system settings that need to be set
* for the class libraries.
*/
public static void initialize() {
diff --git a/jdk/src/java.base/unix/native/libjava/VM_md.c b/jdk/src/java.base/unix/native/libjava/VM_md.c
index 48a8e4a954b..fc6edf04ce1 100644
--- a/jdk/src/java.base/unix/native/libjava/VM_md.c
+++ b/jdk/src/java.base/unix/native/libjava/VM_md.c
@@ -28,25 +28,25 @@
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
return getuid();
}
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
return geteuid();
}
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
return getgid();
}
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
return getegid();
}
diff --git a/jdk/src/java.base/unix/native/libjava/io_util_md.c b/jdk/src/java.base/unix/native/libjava/io_util_md.c
index ff7b9b83d46..0b2141b8356 100644
--- a/jdk/src/java.base/unix/native/libjava/io_util_md.c
+++ b/jdk/src/java.base/unix/native/libjava/io_util_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,7 +22,6 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
@@ -219,3 +218,14 @@ handleSetLength(FD fd, jlong length)
RESTARTABLE(ftruncate64(fd, length), result);
return result;
}
+
+jlong
+handleGetLength(FD fd)
+{
+ struct stat64 sb;
+ if (fstat64(fd, &sb) == 0) {
+ return sb.st_size;
+ } else {
+ return -1;
+ }
+}
diff --git a/jdk/src/java.base/unix/native/libjava/io_util_md.h b/jdk/src/java.base/unix/native/libjava/io_util_md.h
index b7b2573a02e..f99b4a3c009 100644
--- a/jdk/src/java.base/unix/native/libjava/io_util_md.h
+++ b/jdk/src/java.base/unix/native/libjava/io_util_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,7 +39,7 @@ ssize_t handleWrite(FD fd, const void *buf, jint len);
ssize_t handleRead(FD fd, void *buf, jint len);
jint handleAvailable(FD fd, jlong *pbytes);
jint handleSetLength(FD fd, jlong length);
-
+jlong handleGetLength(FD fd);
FD handleOpen(const char *path, int oflag, int mode);
/*
@@ -72,6 +72,7 @@ FD handleOpen(const char *path, int oflag, int mode);
#define IO_Append handleWrite
#define IO_Available handleAvailable
#define IO_SetLength handleSetLength
+#define IO_GetLength handleGetLength
#ifdef _ALLBSD_SOURCE
#define open64 open
diff --git a/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c b/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
index 5e2a78b7af3..fd20eeff79c 100644
--- a/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
+++ b/jdk/src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, 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
@@ -93,6 +93,10 @@ Java_sun_nio_ch_NativeThread_signal(JNIEnv *env, jclass cl, jlong thread)
#else
ret = pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL);
#endif
+#ifdef MACOSX
+ if (ret != 0 && ret != ESRCH)
+#else
if (ret != 0)
+#endif
JNU_ThrowIOExceptionWithLastError(env, "Thread signal failed");
}
diff --git a/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java b/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java
index 0d44a40002f..6abdce8d61a 100644
--- a/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java
+++ b/jdk/src/java.base/windows/classes/java/lang/ProcessImpl.java
@@ -42,8 +42,10 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+
import jdk.internal.misc.JavaIOFileDescriptorAccess;
import jdk.internal.misc.SharedSecrets;
+import jdk.internal.ref.CleanerFactory;
/* This class is for the exclusive use of ProcessBuilder.start() to
* create new processes.
@@ -417,6 +419,10 @@ final class ProcessImpl extends Process {
handle = create(cmdstr, envblock, path,
stdHandles, redirectErrorStream);
+ // Register a cleaning function to close the handle
+ final long local_handle = handle; // local to prevent capture of this
+ CleanerFactory.cleaner().register(this, () -> closeHandle(local_handle));
+
processHandle = ProcessHandleImpl.getInternal(getProcessId0(handle));
java.security.AccessController.doPrivileged(
@@ -463,10 +469,6 @@ final class ProcessImpl extends Process {
return stderr_stream;
}
- protected void finalize() {
- closeHandle(handle);
- }
-
private static final int STILL_ACTIVE = getStillActive();
private static native int getStillActive();
diff --git a/jdk/src/java.base/windows/classes/sun/misc/OSEnvironment.java b/jdk/src/java.base/windows/classes/jdk/internal/misc/OSEnvironment.java
similarity index 93%
rename from jdk/src/java.base/windows/classes/sun/misc/OSEnvironment.java
rename to jdk/src/java.base/windows/classes/jdk/internal/misc/OSEnvironment.java
index 0e3cc4f1425..ffc8cf41804 100644
--- a/jdk/src/java.base/windows/classes/sun/misc/OSEnvironment.java
+++ b/jdk/src/java.base/windows/classes/jdk/internal/misc/OSEnvironment.java
@@ -23,14 +23,14 @@
* questions.
*/
-package sun.misc;
+package jdk.internal.misc;
import sun.io.Win32ErrorMode;
public class OSEnvironment {
/*
- * Initialize any miscellenous operating system settings that need to be set
+ * Initialize any miscellaneous operating system settings that need to be set
* for the class libraries.
*
* At this time only the process-wide error mode needs to be set.
diff --git a/jdk/src/java.base/windows/classes/sun/io/Win32ErrorMode.java b/jdk/src/java.base/windows/classes/sun/io/Win32ErrorMode.java
index 18626a76462..324a04db8eb 100644
--- a/jdk/src/java.base/windows/classes/sun/io/Win32ErrorMode.java
+++ b/jdk/src/java.base/windows/classes/sun/io/Win32ErrorMode.java
@@ -66,7 +66,7 @@ public class Win32ErrorMode {
* has completed.
*/
public static void initialize() {
- if (!sun.misc.VM.isBooted()) {
+ if (!jdk.internal.misc.VM.isBooted()) {
String s = System.getProperty("sun.io.allowCriticalErrorMessageBox");
if (s == null || s.equals(Boolean.FALSE.toString())) {
long mode = setErrorMode(0);
diff --git a/jdk/src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java b/jdk/src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java
index 537885a2c8b..71e999f47bf 100644
--- a/jdk/src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java
+++ b/jdk/src/java.base/windows/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,8 +38,10 @@ import java.text.spi.NumberFormatProvider;
import java.util.Calendar;
import java.util.Collections;
import java.util.Currency;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
+import java.util.Map;
import java.util.ResourceBundle.Control;
import java.util.Set;
import java.util.TimeZone;
@@ -47,6 +49,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicReferenceArray;
import java.util.spi.CalendarDataProvider;
+import java.util.spi.CalendarNameProvider;
import java.util.spi.CurrencyNameProvider;
import java.util.spi.LocaleNameProvider;
import sun.util.spi.CalendarProvider;
@@ -81,6 +84,9 @@ public class HostLocaleProviderAdapterImpl {
private static final int DN_LOCALE_REGION = 4;
private static final int DN_LOCALE_VARIANT = 5;
+ // Windows Calendar IDs
+ private static final int CAL_JAPAN = 3;
+
// Native Calendar ID to LDML calendar type map
private static final String[] calIDToLDML = {
"",
@@ -95,7 +101,8 @@ public class HostLocaleProviderAdapterImpl {
"gregory_fr",
"gregory_ar",
"gregory_en",
- "gregory_fr",
+ "gregory_fr", "", "", "", "", "", "", "", "", "", "",
+ "islamic-umalqura",
};
// Caches
@@ -362,6 +369,50 @@ public class HostLocaleProviderAdapterImpl {
};
}
+ public static CalendarNameProvider getCalendarNameProvider() {
+ return new CalendarNameProvider() {
+ @Override
+ public Locale[] getAvailableLocales() {
+ return getSupportedCalendarLocales();
+ }
+
+ @Override
+ public boolean isSupportedLocale(Locale locale) {
+ return isSupportedCalendarLocale(locale);
+ }
+
+ @Override
+ public String getDisplayName(String calendarType, int field,
+ int value, int style, Locale locale) {
+ String[] names = getCalendarDisplayStrings(removeExtensions(locale).toLanguageTag(),
+ getCalendarIDFromLDMLType(calendarType), field, style);
+ if (names != null && value >= 0 && value < names.length) {
+ return names[value];
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public Map getDisplayNames(String calendarType,
+ int field, int style, Locale locale) {
+ Map map = null;
+ String[] names = getCalendarDisplayStrings(removeExtensions(locale).toLanguageTag(),
+ getCalendarIDFromLDMLType(calendarType), field, style);
+ if (names != null) {
+ map = new HashMap<>();
+ for (int value = 0; value < names.length; value++) {
+ if (names[value] != null) {
+ map.put(names[value], value);
+ }
+ }
+ map = map.isEmpty() ? null : map;
+ }
+ return map;
+ }
+ };
+ }
+
public static CalendarProvider getCalendarProvider() {
return new CalendarProvider() {
@Override
@@ -496,15 +547,7 @@ public class HostLocaleProviderAdapterImpl {
}
private static boolean isSupportedCalendarLocale(Locale locale) {
- Locale base = locale;
-
- if (base.hasExtensions() || base.getVariant() != "") {
- // strip off extensions and variant.
- base = new Locale.Builder()
- .setLocale(locale)
- .clearExtensions()
- .build();
- }
+ Locale base = stripVariantAndExtensions(locale);
if (!supportedLocaleSet.contains(base)) {
return false;
@@ -569,11 +612,23 @@ public class HostLocaleProviderAdapterImpl {
}
private static boolean isJapaneseCalendar() {
- return getCalendarID("ja-JP") == 3; // 3: CAL_JAPAN
+ return getCalendarID("ja-JP") == CAL_JAPAN;
+ }
+
+ private static Locale stripVariantAndExtensions(Locale locale) {
+ if (locale.hasExtensions() || locale.getVariant() != "") {
+ // strip off extensions and variant.
+ locale = new Locale.Builder()
+ .setLocale(locale)
+ .clearExtensions()
+ .build();
+ }
+
+ return locale;
}
private static Locale getCalendarLocale(Locale locale) {
- int calid = getCalendarID(locale.toLanguageTag());
+ int calid = getCalendarID(stripVariantAndExtensions(locale).toLanguageTag());
if (calid > 0 && calid < calIDToLDML.length) {
Locale.Builder lb = new Locale.Builder();
String[] caltype = calIDToLDML[calid].split("_");
@@ -589,6 +644,15 @@ public class HostLocaleProviderAdapterImpl {
return locale;
}
+ private static int getCalendarIDFromLDMLType(String ldmlType) {
+ for (int i = 0; i < calIDToLDML.length; i++) {
+ if (calIDToLDML[i].startsWith(ldmlType)) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
private static Locale getNumberLocale(Locale src) {
if (JRELocaleConstants.TH_TH.equals(src)) {
if (isNativeDigit("th-TH")) {
@@ -639,6 +703,9 @@ public class HostLocaleProviderAdapterImpl {
// For CalendarDataProvider
private static native int getCalendarDataValue(String langTag, int type);
+ // For CalendarNameProvider
+ private static native String[] getCalendarDisplayStrings(String langTag, int calid, int field, int style);
+
// For Locale/CurrencyNameProvider
private static native String getDisplayString(String langTag, int key, String value);
}
diff --git a/jdk/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c b/jdk/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c
index f5540d764f3..28663f768b5 100644
--- a/jdk/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c
+++ b/jdk/src/java.base/windows/native/libjava/HostLocaleProviderAdapter_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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,22 +31,33 @@
#define BUFLEN 256
+// java.util.Calendar constants
+#define CALENDAR_FIELD_ERA 0 // Calendar.ERA
+#define CALENDAR_FIELD_MONTH 2 // Calendar.MONTH
+#define CALENDAR_STYLE_SHORT_MASK 0x00000001 // Calendar.SHORT
+#define CALENDAR_STYLE_STANDALONE_MASK 0x00008000 // Calendar.STANDALONE
+
// global variables
typedef int (WINAPI *PGLIE)(const jchar *, LCTYPE, LPWSTR, int);
typedef int (WINAPI *PGCIE)(const jchar *, CALID, LPCWSTR, CALTYPE, LPWSTR, int, LPDWORD);
+typedef int (WINAPI *PECIEE)(CALINFO_ENUMPROCEXEX, const jchar *, CALID, LPCWSTR, CALTYPE, LPARAM);
PGLIE pGetLocaleInfoEx;
PGCIE pGetCalendarInfoEx;
+PECIEE pEnumCalendarInfoExEx;
BOOL initialized = FALSE;
// prototypes
int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen);
int getCalendarInfoWrapper(const jchar *langtag, CALID id, LPCWSTR reserved, CALTYPE type, LPWSTR data, int buflen, LPDWORD val);
jint getCalendarID(const jchar *langtag);
-void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jobjectArray jarray,
- CALTYPE* pCalTypes, int offset, int length);
+void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjectArray jarray,
+ CALTYPE* pCalTypes, int offset, int length, int style);
WCHAR * getNumberPattern(const jchar * langtag, const jint numberStyle);
void getNumberPart(const jchar * langtag, const jint numberStyle, WCHAR * number);
void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BOOL prefix, WCHAR * ret);
+int enumCalendarInfoWrapper(const jchar * langtag, CALID calid, CALTYPE type, LPWSTR buf, int buflen);
+BOOL CALLBACK EnumCalendarInfoProc(LPWSTR lpCalInfoStr, CALID calid, LPWSTR lpReserved, LPARAM lParam);
+jobjectArray getErasImpl(JNIEnv *env, jstring jlangtag, jint calid, jint style, jobjectArray eras);
// from java_props_md.c
extern __declspec(dllexport) const char * getJavaIDFromLangID(LANGID langID);
@@ -83,6 +94,8 @@ CALTYPE sMonthsType[] = {
CAL_SABBREVMONTHNAME13,
};
+#define MONTHTYPES (sizeof(monthsType) / sizeof(CALTYPE))
+
CALTYPE wDaysType[] = {
CAL_SDAYNAME7,
CAL_SDAYNAME1,
@@ -155,6 +168,11 @@ WCHAR * fixes[2][2][3][16] =
}
};
+
+// Localized region name for unknown regions (Windows 10)
+#define UNKNOWN_REGION L"Unknown Region ("
+#define UNKNOWN_REGION_SIZE wcslen(UNKNOWN_REGION)
+
/*
* Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl
* Method: initialize
@@ -169,11 +187,15 @@ JNIEXPORT jboolean JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapt
pGetCalendarInfoEx = (PGCIE)GetProcAddress(
GetModuleHandle("kernel32.dll"),
"GetCalendarInfoEx");
+ pEnumCalendarInfoExEx = (PECIEE)GetProcAddress(
+ GetModuleHandle("kernel32.dll"),
+ "EnumCalendarInfoExEx");
initialized =TRUE;
}
return pGetLocaleInfoEx != NULL &&
- pGetCalendarInfoEx != NULL;
+ pGetCalendarInfoEx != NULL &&
+ pEnumCalendarInfoExEx != NULL;
}
/*
@@ -300,23 +322,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getEras
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray eras) {
- WCHAR ad[BUFLEN];
- const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
- jstring tmp_string;
- CHECK_NULL_RETURN(langtag, eras);
-
- getCalendarInfoWrapper(langtag, getCalendarID(langtag), NULL,
- CAL_SERASTRING, ad, BUFLEN, NULL);
-
- // Windows does not provide B.C. era.
- tmp_string = (*env)->NewString(env, ad, (jsize)wcslen(ad));
- if (tmp_string != NULL) {
- (*env)->SetObjectArrayElement(env, eras, 1, tmp_string);
- }
-
- (*env)->ReleaseStringChars(env, jlangtag, langtag);
-
- return eras;
+ return getErasImpl(env, jlangtag, -1, 0, eras);
}
/*
@@ -326,8 +332,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getMonths
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray months) {
- replaceCalendarArrayElems(env, jlangtag, months, monthsType,
- 0, sizeof(monthsType)/sizeof(CALTYPE));
+ replaceCalendarArrayElems(env, jlangtag, -1, months, monthsType,
+ 0, MONTHTYPES, 0);
return months;
}
@@ -338,8 +344,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getShortMonths
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray smonths) {
- replaceCalendarArrayElems(env, jlangtag, smonths, sMonthsType,
- 0, sizeof(sMonthsType)/sizeof(CALTYPE));
+ replaceCalendarArrayElems(env, jlangtag, -1, smonths, sMonthsType,
+ 0, MONTHTYPES, 0);
return smonths;
}
@@ -350,8 +356,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getWeekdays
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray wdays) {
- replaceCalendarArrayElems(env, jlangtag, wdays, wDaysType,
- 1, sizeof(wDaysType)/sizeof(CALTYPE));
+ replaceCalendarArrayElems(env, jlangtag, -1, wdays, wDaysType,
+ 1, sizeof(wDaysType)/sizeof(CALTYPE), 0);
return wdays;
}
@@ -362,8 +368,8 @@ JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderA
*/
JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getShortWeekdays
(JNIEnv *env, jclass cls, jstring jlangtag, jobjectArray swdays) {
- replaceCalendarArrayElems(env, jlangtag, swdays, sWDaysType,
- 1, sizeof(sWDaysType)/sizeof(CALTYPE));
+ replaceCalendarArrayElems(env, jlangtag, -1, swdays, sWDaysType,
+ 1, sizeof(sWDaysType)/sizeof(CALTYPE), 0);
return swdays;
}
@@ -674,6 +680,41 @@ JNIEXPORT jint JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterIm
}
}
+/*
+ * Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl
+ * Method: getCalendarDisplayStrings
+ * Signature: (Ljava/lang/String;III)[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapterImpl_getCalendarDisplayStrings
+ (JNIEnv *env, jclass cls, jstring jlangtag, jint calid, jint field, jint style) {
+ jobjectArray ret = NULL;
+ CALTYPE * pCalType = NULL;
+
+ switch (field) {
+ case CALENDAR_FIELD_ERA:
+ return getErasImpl(env, jlangtag, calid, style, NULL);
+
+ case CALENDAR_FIELD_MONTH:
+ ret = (*env)->NewObjectArray(env, MONTHTYPES,
+ (*env)->FindClass(env, "java/lang/String"), NULL);
+ if (ret != NULL) {
+ if (style & CALENDAR_STYLE_SHORT_MASK) {
+ pCalType = sMonthsType;
+ } else {
+ pCalType = monthsType;
+ }
+
+ replaceCalendarArrayElems(env, jlangtag, calid, ret, pCalType,
+ 0, MONTHTYPES, style);
+ }
+ return ret;
+
+ default:
+ // not supported
+ return NULL;
+ }
+}
+
/*
* Class: sun_util_locale_provider_HostLocaleProviderAdapterImpl
* Method: getDisplayString
@@ -714,10 +755,15 @@ JNIEXPORT jstring JNICALL Java_sun_util_locale_provider_HostLocaleProviderAdapte
(*env)->ReleaseStringChars(env, jStr, pjChar);
if (got) {
- return (*env)->NewString(env, buf, (jsize)wcslen(buf));
- } else {
- return NULL;
+ // Hack: Windows 10 returns "Unknown Region (XX)" for localized XX region name.
+ // Take that as not known.
+ if (type != sun_util_locale_provider_HostLocaleProviderAdapterImpl_DN_LOCALE_REGION ||
+ wcsncmp(UNKNOWN_REGION, buf, UNKNOWN_REGION_SIZE) != 0) {
+ return (*env)->NewString(env, buf, (jsize)wcslen(buf));
+ }
}
+
+ return NULL;
}
int getLocaleInfoWrapper(const jchar *langtag, LCTYPE type, LPWSTR data, int buflen) {
@@ -753,35 +799,62 @@ int getCalendarInfoWrapper(const jchar *langtag, CALID id, LPCWSTR reserved, CAL
}
jint getCalendarID(const jchar *langtag) {
- DWORD type;
+ DWORD type = -1;
int got = getLocaleInfoWrapper(langtag,
LOCALE_ICALENDARTYPE | LOCALE_RETURN_NUMBER,
(LPWSTR)&type, sizeof(type));
if (got) {
- return type;
- } else {
- return 0;
+ switch (type) {
+ case CAL_GREGORIAN:
+ case CAL_GREGORIAN_US:
+ case CAL_JAPAN:
+ case CAL_TAIWAN:
+ case CAL_HIJRI:
+ case CAL_THAI:
+ case CAL_GREGORIAN_ME_FRENCH:
+ case CAL_GREGORIAN_ARABIC:
+ case CAL_GREGORIAN_XLIT_ENGLISH:
+ case CAL_GREGORIAN_XLIT_FRENCH:
+ case CAL_UMALQURA:
+ break;
+
+ default:
+ // non-supported calendars return -1
+ type = -1;
+ break;
+ }
}
+
+ return type;
}
-void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jobjectArray jarray, CALTYPE* pCalTypes, int offset, int length) {
+void replaceCalendarArrayElems(JNIEnv *env, jstring jlangtag, jint calid, jobjectArray jarray, CALTYPE* pCalTypes, int offset, int length, int style) {
WCHAR name[BUFLEN];
const jchar *langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
- int calid;
jstring tmp_string;
+ CALTYPE isGenitive;
CHECK_NULL(langtag);
- calid = getCalendarID(langtag);
+
+ if (calid < 0) {
+ calid = getCalendarID(langtag);
+ }
if (calid != -1) {
int i;
+
+ if (!(style & CALENDAR_STYLE_STANDALONE_MASK)) {
+ isGenitive = CAL_RETURN_GENITIVE_NAMES;
+ }
+
for (i = 0; i < length; i++) {
- getCalendarInfoWrapper(langtag, calid, NULL,
- pCalTypes[i], name, BUFLEN, NULL);
- tmp_string = (*env)->NewString(env, name, (jsize)wcslen(name));
- if (tmp_string != NULL) {
- (*env)->SetObjectArrayElement(env, jarray, i + offset, tmp_string);
+ if (getCalendarInfoWrapper(langtag, calid, NULL,
+ pCalTypes[i] | isGenitive, name, BUFLEN, NULL) != 0) {
+ tmp_string = (*env)->NewString(env, name, (jsize)wcslen(name));
+ if (tmp_string != NULL) {
+ (*env)->SetObjectArrayElement(env, jarray, i + offset, tmp_string);
+ }
}
}
}
@@ -924,3 +997,99 @@ void getFixPart(const jchar * langtag, const jint numberStyle, BOOL positive, BO
wcscpy(ret, fixes[!prefix][!positive][style][pattern]);
}
+
+int enumCalendarInfoWrapper(const jchar *langtag, CALID calid, CALTYPE type, LPWSTR buf, int buflen) {
+ if (pEnumCalendarInfoExEx) {
+ if (wcscmp(L"und", (LPWSTR)langtag) == 0) {
+ // defaults to "en"
+ return pEnumCalendarInfoExEx(&EnumCalendarInfoProc, L"en",
+ calid, NULL, type, (LPARAM)buf);
+ } else {
+ return pEnumCalendarInfoExEx(&EnumCalendarInfoProc, langtag,
+ calid, NULL, type, (LPARAM)buf);
+ }
+ } else {
+ return 0;
+ }
+}
+
+BOOL CALLBACK EnumCalendarInfoProc(LPWSTR lpCalInfoStr, CALID calid, LPWSTR lpReserved, LPARAM lParam) {
+ wcscat_s((LPWSTR)lParam, BUFLEN, lpCalInfoStr);
+ wcscat_s((LPWSTR)lParam, BUFLEN, L",");
+ return TRUE;
+}
+
+jobjectArray getErasImpl(JNIEnv *env, jstring jlangtag, jint calid, jint style, jobjectArray eras) {
+ const jchar * langtag = (*env)->GetStringChars(env, jlangtag, JNI_FALSE);
+ WCHAR buf[BUFLEN];
+ jobjectArray ret = eras;
+ CALTYPE type;
+
+ CHECK_NULL_RETURN(langtag, ret);
+
+ buf[0] = '\0';
+ if (style & CALENDAR_STYLE_SHORT_MASK) {
+ type = CAL_SABBREVERASTRING;
+ } else {
+ type = CAL_SERASTRING;
+ }
+
+ if (calid < 0) {
+ calid = getCalendarID(langtag);
+ }
+
+ if (calid != -1 && enumCalendarInfoWrapper(langtag, calid, type, buf, BUFLEN)) {
+ // format in buf: "era0,era1,era2," where era0 is the current one
+ int eraCount;
+ LPWSTR current;
+ jsize array_length;
+
+ for(eraCount = 0, current = buf; *current != '\0'; current++) {
+ if (*current == L',') {
+ eraCount ++;
+ }
+ }
+
+ if (eras != NULL) {
+ array_length = (*env)->GetArrayLength(env, eras);
+ } else {
+ // +1 for the "before" era, e.g., BC, which Windows does not return.
+ array_length = (jsize)eraCount + 1;
+ ret = (*env)->NewObjectArray(env, array_length,
+ (*env)->FindClass(env, "java/lang/String"), NULL);
+ }
+
+ if (ret != NULL) {
+ int eraIndex;
+ LPWSTR era;
+
+ for(eraIndex = 0, era = current = buf; eraIndex < eraCount; era = current, eraIndex++) {
+ while (*current != L',') {
+ current++;
+ }
+ *current++ = '\0';
+
+ if (eraCount - eraIndex < array_length &&
+ *era != '\0') {
+ (*env)->SetObjectArrayElement(env, ret,
+ (jsize)(eraCount - eraIndex),
+ (*env)->NewString(env, era, (jsize)wcslen(era)));
+ }
+ }
+
+ // Hack for the Japanese Imperial Calendar to insert Gregorian era for
+ // "Before Meiji"
+ if (calid == CAL_JAPAN) {
+ buf[0] = '\0';
+ if (enumCalendarInfoWrapper(langtag, CAL_GREGORIAN, type, buf, BUFLEN)) {
+ jsize len = (jsize)wcslen(buf);
+ buf[--len] = '\0'; // remove the last ','
+ (*env)->SetObjectArrayElement(env, ret, 0, (*env)->NewString(env, buf, len));
+ }
+ }
+ }
+ }
+
+ (*env)->ReleaseStringChars(env, jlangtag, langtag);
+ return ret;
+}
diff --git a/jdk/src/java.base/windows/native/libjava/VM_md.c b/jdk/src/java.base/windows/native/libjava/VM_md.c
index 2b13ffc4f37..73011d123dd 100644
--- a/jdk/src/java.base/windows/native/libjava/VM_md.c
+++ b/jdk/src/java.base/windows/native/libjava/VM_md.c
@@ -27,28 +27,28 @@
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_getuid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */
return -1;
}
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_geteuid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */
return -1;
}
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_getgid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */
return -1;
}
JNIEXPORT jlong JNICALL
-Java_sun_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
+Java_jdk_internal_misc_VM_getegid(JNIEnv *env, jclass thisclass) {
/* -1 means function not available. */
return -1;
diff --git a/jdk/src/java.base/windows/native/libjava/io_util_md.c b/jdk/src/java.base/windows/native/libjava/io_util_md.c
index a37ecb6e28b..b7626487a71 100644
--- a/jdk/src/java.base/windows/native/libjava/io_util_md.c
+++ b/jdk/src/java.base/windows/native/libjava/io_util_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -584,3 +584,14 @@ handleLseek(FD fd, jlong offset, jint whence)
}
return long_to_jlong(pos.QuadPart);
}
+
+jlong
+handleGetLength(FD fd) {
+ HANDLE h = (HANDLE) fd;
+ LARGE_INTEGER length;
+ if (GetFileSizeEx(h, &length) != 0) {
+ return long_to_jlong(length.QuadPart);
+ } else {
+ return -1;
+ }
+}
diff --git a/jdk/src/java.base/windows/native/libjava/io_util_md.h b/jdk/src/java.base/windows/native/libjava/io_util_md.h
index d85cdd3dead..59b2252ed09 100644
--- a/jdk/src/java.base/windows/native/libjava/io_util_md.h
+++ b/jdk/src/java.base/windows/native/libjava/io_util_md.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,6 +44,7 @@ int currentDirLength(const WCHAR* path, int pathlen);
int handleAvailable(FD fd, jlong *pbytes);
int handleSync(FD fd);
int handleSetLength(FD fd, jlong length);
+jlong handleGetLength(FD fd);
JNIEXPORT jint handleRead(FD fd, void *buf, jint len);
jint handleWrite(FD fd, const void *buf, jint len);
jint handleAppend(FD fd, const void *buf, jint len);
@@ -84,6 +85,7 @@ FD winFileHandleOpen(JNIEnv *env, jstring path, int flags);
#define IO_Lseek handleLseek
#define IO_Available handleAvailable
#define IO_SetLength handleSetLength
+#define IO_GetLength handleGetLength
/*
* Setting the handle field in Java_java_io_FileDescriptor_set for
diff --git a/jdk/src/java.base/windows/native/libjli/java_md.c b/jdk/src/java.base/windows/native/libjli/java_md.c
index 98f3e985c90..65422bc039f 100644
--- a/jdk/src/java.base/windows/native/libjli/java_md.c
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c
@@ -337,6 +337,15 @@ GetJREPath(char *path, jint pathsize)
}
}
+ /* Try getting path to JRE from path to JLI.DLL */
+ if (GetApplicationHomeFromDll(path, pathsize)) {
+ JLI_Snprintf(javadll, sizeof(javadll), "%s\\bin\\" JAVA_DLL, path);
+ if (stat(javadll, &s) == 0) {
+ JLI_TraceLauncher("JRE path is %s\n", path);
+ return JNI_TRUE;
+ }
+ }
+
JLI_ReportErrorMessage(JRE_ERROR8 JAVA_DLL);
return JNI_FALSE;
@@ -404,17 +413,17 @@ LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
}
/*
- * If app is "c:\foo\bin\javac", then put "c:\foo" into buf.
+ * Removes the trailing file name and one sub-folder from a path.
+ * If buf is "c:\foo\bin\javac", then put "c:\foo" into buf.
*/
jboolean
-GetApplicationHome(char *buf, jint bufsize)
+TruncatePath(char *buf)
{
char *cp;
- GetModuleFileName(0, buf, bufsize);
*JLI_StrRChr(buf, '\\') = '\0'; /* remove .exe file name */
if ((cp = JLI_StrRChr(buf, '\\')) == 0) {
/* This happens if the application is in a drive root, and
- * there is no bin directory. */
+ * there is no bin directory. */
buf[0] = '\0';
return JNI_FALSE;
}
@@ -422,6 +431,36 @@ GetApplicationHome(char *buf, jint bufsize)
return JNI_TRUE;
}
+/*
+ * Retrieves the path to the JRE home by locating the executable file
+ * of the current process and then truncating the path to the executable
+ */
+jboolean
+GetApplicationHome(char *buf, jint bufsize)
+{
+ GetModuleFileName(NULL, buf, bufsize);
+ return TruncatePath(buf);
+}
+
+/*
+ * Retrieves the path to the JRE home by locating JLI.DLL and
+ * then truncating the path to JLI.DLL
+ */
+jboolean
+GetApplicationHomeFromDll(char *buf, jint bufsize)
+{
+ HMODULE hModule;
+ DWORD dwFlags =
+ GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
+ GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
+
+ if (GetModuleHandleEx(dwFlags, (LPCSTR)&GetJREPath, &hModule) == 0) {
+ return JNI_FALSE;
+ };
+ GetModuleFileName(hModule, buf, bufsize);
+ return TruncatePath(buf);
+}
+
/*
* Support for doing cheap, accurate interval timing.
*/
diff --git a/jdk/src/java.base/windows/native/libjli/java_md.h b/jdk/src/java.base/windows/native/libjli/java_md.h
index 76c15ea8e32..ec3131f6b61 100644
--- a/jdk/src/java.base/windows/native/libjli/java_md.h
+++ b/jdk/src/java.base/windows/native/libjli/java_md.h
@@ -54,4 +54,7 @@ extern jlong Counter2Micros(jlong counts);
int UnsetEnv(char *name);
+jboolean
+GetApplicationHomeFromDll(char *buf, jint bufsize);
+
#endif /* JAVA_MD_H */
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java
index 5379d632230..d178ae4516c 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java
@@ -35,8 +35,6 @@ import java.util.Vector;
import java.util.Enumeration;
import java.net.URL;
-import sun.misc.MessageUtils;
-
/**
* A simple DTD-driven HTML parser. The parser reads an
* HTML file from an InputStream and calls various methods
diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
index a9bacd5c3f2..7ef9e111171 100644
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
@@ -43,9 +43,8 @@ import sun.awt.AWTAccessor;
import sun.awt.AppContext;
import sun.awt.EmbeddedFrame;
import sun.awt.SunToolkit;
+import sun.awt.util.PerformanceLogger;
import sun.misc.ManagedLocalsThread;
-import sun.misc.MessageUtils;
-import sun.misc.PerformanceLogger;
import sun.security.util.SecurityConstants;
/**
@@ -118,8 +117,6 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable {
*/
Dimension currentAppletSize = new Dimension(10, 10);
- MessageUtils mu = new MessageUtils();
-
/**
* The thread to use during applet loading
*/
diff --git a/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java b/jdk/src/java.desktop/share/classes/sun/awt/util/PerformanceLogger.java
similarity index 99%
rename from jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java
rename to jdk/src/java.desktop/share/classes/sun/awt/util/PerformanceLogger.java
index 6e8917b4545..b35727f4627 100644
--- a/jdk/src/java.base/share/classes/sun/misc/PerformanceLogger.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/util/PerformanceLogger.java
@@ -25,7 +25,7 @@
-package sun.misc;
+package sun.awt.util;
import java.util.Vector;
import java.io.FileWriter;
diff --git a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
index c7facaf62b6..3cb7207ad2b 100644
--- a/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
+++ b/jdk/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java
@@ -88,9 +88,9 @@ import java.awt.font.FontRenderContext;
import sun.java2d.loops.XORComposite;
import sun.awt.ConstrainableGraphics;
import sun.awt.SunHints;
+import sun.awt.util.PerformanceLogger;
import java.util.Map;
import java.util.Iterator;
-import sun.misc.PerformanceLogger;
import java.lang.annotation.Native;
import java.awt.image.MultiResolutionImage;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
index 3852193bd4a..7297ef72287 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java
@@ -52,6 +52,7 @@ import sun.awt.datatransfer.DataTransferer;
import sun.font.FontConfigManager;
import sun.java2d.SunGraphicsEnvironment;
import sun.misc.*;
+import sun.awt.util.PerformanceLogger;
import sun.awt.util.ThreadGroupUtils;
import sun.print.PrintJob2D;
import sun.security.action.GetPropertyAction;
diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
index 970ab07f843..fed3e231731 100644
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WToolkit.java
@@ -67,10 +67,10 @@ import java.util.Locale;
import java.util.Map;
import java.util.Properties;
+import sun.awt.util.PerformanceLogger;
import sun.font.FontManager;
import sun.font.FontManagerFactory;
import sun.font.SunFontManager;
-import sun.misc.PerformanceLogger;
import sun.util.logging.PlatformLogger;
public final class WToolkit extends SunToolkit implements Runnable {
diff --git a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java
index 794746c12a9..8f110fe8c72 100644
--- a/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java
+++ b/jdk/src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java
@@ -38,6 +38,7 @@ import java.awt.event.WindowListener;
import java.awt.peer.WindowPeer;
import java.util.ArrayList;
+import jdk.internal.perf.PerfCounter;
import sun.awt.AWTAccessor;
import sun.awt.AWTAccessor.ComponentAccessor;
import sun.awt.Win32GraphicsDevice;
@@ -69,9 +70,9 @@ public class D3DGraphicsDevice extends Win32GraphicsDevice {
if (d3dAvailable) {
// we don't use pixel formats for the d3d pipeline
pfDisabled = true;
- sun.misc.PerfCounter.getD3DAvailable().set(1);
+ PerfCounter.getD3DAvailable().set(1);
} else {
- sun.misc.PerfCounter.getD3DAvailable().set(0);
+ PerfCounter.getD3DAvailable().set(0);
}
}
diff --git a/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java b/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java
index 52a2b4e07e6..61b0c817818 100644
--- a/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java
+++ b/jdk/src/java.logging/share/classes/java/util/logging/FileHandler.java
@@ -639,7 +639,7 @@ public class FileHandler extends StreamHandler {
continue;
} else if (ch2 == 'h') {
file = new File(System.getProperty("user.home"));
- if (sun.misc.VM.isSetUID()) {
+ if (jdk.internal.misc.VM.isSetUID()) {
// Ok, we are in a set UID program. For safety's sake
// we disallow attempts to open files relative to %h.
throw new IOException("can't use %h in set UID program");
diff --git a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java
index 47b244910a4..24c848800fd 100644
--- a/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java
+++ b/jdk/src/java.management/share/classes/java/lang/management/ManagementFactory.java
@@ -583,7 +583,7 @@ public class ManagementFactory {
ClassLoader loader =
AccessController.doPrivileged(
(PrivilegedAction) () -> cls.getClassLoader());
- if (!sun.misc.VM.isSystemDomainLoader(loader)) {
+ if (!jdk.internal.misc.VM.isSystemDomainLoader(loader)) {
throw new IllegalArgumentException(mxbeanName +
" is not a platform MXBean");
}
diff --git a/jdk/src/java.management/share/classes/sun/management/ConnectorAddressLink.java b/jdk/src/java.management/share/classes/sun/management/ConnectorAddressLink.java
index 4ec5ec799cc..b1bd0f311d1 100644
--- a/jdk/src/java.management/share/classes/sun/management/ConnectorAddressLink.java
+++ b/jdk/src/java.management/share/classes/sun/management/ConnectorAddressLink.java
@@ -34,7 +34,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
-import sun.misc.Perf;
+import jdk.internal.perf.Perf;
import sun.management.counter.Units;
import sun.management.counter.Counter;
import sun.management.counter.perf.PerfInstrumentation;
diff --git a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
index 22b69401199..44682b29971 100644
--- a/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
+++ b/jdk/src/java.management/share/classes/sun/management/ManagementFactoryHelper.java
@@ -473,7 +473,7 @@ public class ManagementFactoryHelper {
public static Thread.State toThreadState(int state) {
// suspended and native bits may be set in state
int threadStatus = state & ~JMM_THREAD_STATE_FLAG_MASK;
- return sun.misc.VM.toThreadState(threadStatus);
+ return jdk.internal.misc.VM.toThreadState(threadStatus);
}
// These values are defined in jmm.h
diff --git a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java
index f64a0a5bcf4..00d68d4a022 100644
--- a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java
+++ b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java
@@ -59,7 +59,7 @@ class MemoryImpl extends NotificationEmitterSupport
}
public int getObjectPendingFinalizationCount() {
- return sun.misc.VM.getFinalRefCount();
+ return jdk.internal.misc.VM.getFinalRefCount();
}
public void gc() {
diff --git a/jdk/src/java.management/share/classes/sun/management/VMManagementImpl.java b/jdk/src/java.management/share/classes/sun/management/VMManagementImpl.java
index d9e8d64b9aa..0600a7aeee0 100644
--- a/jdk/src/java.management/share/classes/sun/management/VMManagementImpl.java
+++ b/jdk/src/java.management/share/classes/sun/management/VMManagementImpl.java
@@ -25,7 +25,7 @@
package sun.management;
-import sun.misc.Perf;
+import jdk.internal.perf.Perf;
import sun.management.counter.*;
import sun.management.counter.perf.*;
import java.nio.ByteBuffer;
diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/server/MarshalInputStream.java b/jdk/src/java.rmi/share/classes/sun/rmi/server/MarshalInputStream.java
index 20f8874a72a..3453e61f517 100644
--- a/jdk/src/java.rmi/share/classes/sun/rmi/server/MarshalInputStream.java
+++ b/jdk/src/java.rmi/share/classes/sun/rmi/server/MarshalInputStream.java
@@ -262,7 +262,7 @@ public class MarshalInputStream extends ObjectInputStream {
* if only code from the null class loader is on the stack.
*/
private static ClassLoader latestUserDefinedLoader() {
- return sun.misc.VM.latestUserDefinedLoader();
+ return jdk.internal.misc.VM.latestUserDefinedLoader();
}
/**
diff --git a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
index 2afe0c25769..f1071d760bd 100644
--- a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
+++ b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
@@ -31,12 +31,14 @@ import java.util.List;
* ScriptEngineFactory
is used to describe and instantiate
* ScriptEngines
.
*
- * Each class implementing ScriptEngine
has a corresponding factory
- * that exposes metadata describing the engine class.
+ * Each class implementing ScriptEngine
has a corresponding
+ * factory that exposes metadata describing the engine class.
* The ScriptEngineManager
- * uses the service provider mechanism described in the Jar File Specification to obtain
- * instances of all ScriptEngineFactories
available in
- * the current ClassLoader.
+ * uses the service-provider loader mechanism described in the
+ * {@link java.util.ServiceLoader} class to obtain
+ * instances of {@code ScriptEngineFactory} instances.
+ * See {@link ScriptEngineManager#ScriptEngineManager()} and
+ * {@link ScriptEngineManager#ScriptEngineManager(java.lang.ClassLoader)}.
*
* @since 1.6
*/
diff --git a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineManager.java b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineManager.java
index 9423bec47a6..9ff154d3210 100644
--- a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineManager.java
+++ b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineManager.java
@@ -33,7 +33,8 @@ import java.util.ServiceConfigurationError;
* The ScriptEngineManager
implements a discovery and instantiation
* mechanism for ScriptEngine
classes and also maintains a
* collection of key/value pairs storing state shared by all engines created
- * by the Manager. This class uses the service provider mechanism to enumerate all the
+ * by the Manager. This class uses the service provider mechanism described in the
+ * {@link java.util.ServiceLoader} class to enumerate all the
* implementations of ScriptEngineFactory
.
* The ScriptEngineManager
provides a method to return a list of all these factories
* as well as utility methods which look up factories on the basis of language name, file extension
@@ -64,7 +65,7 @@ public class ScriptEngineManager {
/**
* This constructor loads the implementations of
* ScriptEngineFactory
visible to the given
- * ClassLoader
using the service provider mechanism.
+ * ClassLoader
using the service provider mechanism.
* If loader is null
, the script engine factories that are
* bundled with the platform are loaded.
*
diff --git a/jdk/src/java.scripting/share/classes/javax/script/package-info.java b/jdk/src/java.scripting/share/classes/javax/script/package-info.java
new file mode 100644
index 00000000000..90cf6b5a1d2
--- /dev/null
+++ b/jdk/src/java.scripting/share/classes/javax/script/package-info.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+
+The scripting API consists of interfaces and classes that define
+Java™ Scripting Engines and provides
+a framework for their use in Java applications. This API is intended
+for use by application programmers who wish to execute programs
+written in scripting languages in their Java applications. The
+scripting language programs are usually provided by the end-users of
+the applications.
+
+The main areas of functionality of javax.script
+package include
+
+
+Script execution : Scripts
+are streams of characters used as sources for programs executed by
+script engines. Script execution uses
+{@link javax.script.ScriptEngine#eval eval} methods of
+{@link javax.script.ScriptEngine ScriptEngine} and methods of the
+{@link javax.script.Invocable Invocable} interface.
+
+Binding : This facility
+allows Java objects to be exposed to script programs as named
+variables. {@link javax.script.Bindings Bindings} and
+{@link javax.script.ScriptContext ScriptContext}
+classes are used for this purpose.
+
+Compilation : This
+functionality allows the intermediate code generated by the
+front-end of a script engine to be stored and executed repeatedly.
+This benefits applications that execute the same script multiple
+times. These applications can gain efficiency since the engines'
+front-ends only need to execute once per script rather than once per
+script execution. Note that this functionality is optional and
+script engines may choose not to implement it. Callers need to check
+for availability of the {@link javax.script.Compilable Compilable}
+interface using an instanceof check.
+
+Invocation : This
+functionality allows the reuse of intermediate code generated by a
+script engine's front-end. Whereas Compilation allows entire scripts
+represented by intermediate code to be re-executed, Invocation
+functionality allows individual procedures/methods in the scripts to
+be re-executed. As in the case with compilation, not all script
+engines are required to provide this facility. Caller has to check
+for {@link javax.script.Invocable Invocable} availability.
+
+Script engine discovery : Applications
+written to the Scripting API might have specific requirements on
+script engines. Some may require a specific scripting language
+and/or version while others may require a specific implementation
+engine and/or version. Script engines are packaged in a specified
+way so that engines can be discovered at runtime and queried for
+attributes. The Engine discovery mechanism is based on the service-provider
+loading facility described in the {@link java.util.ServiceLoader} class.
+{@link javax.script.ScriptEngineManager ScriptEngineManager}
+includes
+{@link javax.script.ScriptEngineManager#getEngineFactories getEngineFactories} method to get all
+{@link javax.script.ScriptEngineFactory ScriptEngineFactory} instances
+discovered using this mechanism. ScriptEngineFactory
has
+methods to query attributes about script engine.
+
+
+
+@since 1.6
+*/
+
+package javax.script;
+
diff --git a/jdk/src/java.scripting/share/classes/javax/script/package.html b/jdk/src/java.scripting/share/classes/javax/script/package.html
deleted file mode 100644
index dd83b6bd9dd..00000000000
--- a/jdk/src/java.scripting/share/classes/javax/script/package.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-The scripting API consists of interfaces and classes that define
-Java™ Scripting Engines and provides
-a framework for their use in Java applications. This API is intended
-for use by application programmers who wish to execute programs
-written in scripting languages in their Java applications. The
-scripting language programs are usually provided by the end-users of
-the applications.
-
-The main areas of functionality of javax.script
-package include
-
-
- Script execution : Scripts
- are streams of characters used as sources for programs executed by
- script engines. Script execution uses
- {@link javax.script.ScriptEngine#eval eval} methods of
- {@link javax.script.ScriptEngine ScriptEngine} and methods of the
- {@link javax.script.Invocable Invocable} interface.
-
- Binding : This facility
- allows Java objects to be exposed to script programs as named
- variables. {@link javax.script.Bindings Bindings} and
- {@link javax.script.ScriptContext ScriptContext}
- classes are used for this purpose.
-
- Compilation : This
- functionality allows the intermediate code generated by the
- front-end of a script engine to be stored and executed repeatedly.
- This benefits applications that execute the same script multiple
- times. These applications can gain efficiency since the engines'
- front-ends only need to execute once per script rather than once per
- script execution. Note that this functionality is optional and
- script engines may choose not to implement it. Callers need to check
- for availability of the {@link javax.script.Compilable Compilable}
- interface using an instanceof check.
-
- Invocation : This
- functionality allows the reuse of intermediate code generated by a
- script engine's front-end. Whereas Compilation allows entire scripts
- represented by intermediate code to be re-executed, Invocation
- functionality allows individual procedures/methods in the scripts to
- be re-executed. As in the case with compilation, not all script
- engines are required to provide this facility. Caller has to check
- for {@link javax.script.Invocable Invocable} availability.
-
- Script engine discovery and Metadata : Applications
- written to the Scripting API might have specific requirements on
- script engines. Some may require a specific scripting language
- and/or version while others may require a specific implementation
- engine and/or version. Script engines are packaged in a specified
- way so that engines can be discovered at runtime and queried for
- attributes. The Engine discovery mechanism is based on the Service
- discovery mechanism described in the Jar File Specification .
- Script engine implementing classes are packaged in jar files that
- include a text resource named
- META-INF/services/javax.script.ScriptEngineFactory . This
- resource must include a line for each
- {@link javax.script.ScriptEngineFactory ScriptEngineFactory}
- that is packaged in the jar file.
- {@link javax.script.ScriptEngineManager ScriptEngineManager}
- includes
- {@link javax.script.ScriptEngineManager#getEngineFactories getEngineFactories} method to get all
- {@link javax.script.ScriptEngineFactory ScriptEngineFactory} instances
- discovered using this mechanism. ScriptEngineFactory
has
- methods to query attributes about script engine.
-
-
-
-@since 1.6
-
-
-
diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
index 7d0e700d820..f22a1883c0b 100644
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
@@ -397,7 +397,7 @@ public class FileCredentialsCache extends CredentialsCache
*/
if (osname != null && !osname.startsWith("Windows")) {
- long uid = sun.misc.VM.getuid();
+ long uid = jdk.internal.misc.VM.getuid();
if (uid != -1) {
name = File.separator + "tmp" +
File.separator + stdCacheNameComponent + "_" + uid;
diff --git a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/rcache/DflCache.java b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/rcache/DflCache.java
index cbae7026cec..54fa34add04 100644
--- a/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/rcache/DflCache.java
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/krb5/internal/rcache/DflCache.java
@@ -60,7 +60,7 @@ import sun.security.krb5.internal.ReplayCache;
*
* service_euid
*
- * in which euid is available as sun.misc.VM.geteuid().
+ * in which euid is available as jdk.internal.misc.VM.geteuid().
*
* The file has a header:
*
@@ -107,7 +107,7 @@ public class DflCache extends ReplayCache {
private static long uid;
static {
// Available on Solaris, Linux and Mac. Otherwise, -1 and no _euid suffix
- uid = sun.misc.VM.geteuid();
+ uid = jdk.internal.misc.VM.geteuid();
}
public DflCache (String source) {
diff --git a/jdk/src/java.sql/share/classes/java/sql/Statement.java b/jdk/src/java.sql/share/classes/java/sql/Statement.java
index 3dd29c2a9c0..fe40a2f988e 100644
--- a/jdk/src/java.sql/share/classes/java/sql/Statement.java
+++ b/jdk/src/java.sql/share/classes/java/sql/Statement.java
@@ -1582,4 +1582,43 @@ public interface Statement extends Wrapper, AutoCloseable {
return len >= 1 && len <= 128
&& Pattern.compile("[\\p{Alpha}][\\p{Alnum}_]*").matcher(identifier).matches();
}
+
+ /**
+ * Returns a {@code String} representing a National Character Set Literal
+ * enclosed in single quotes and prefixed with a upper case letter N.
+ * Any occurrence of a single quote within the string will be replaced
+ * by two single quotes.
+ *
+ *
+ *
+ * Examples of the conversion:
+ *
+ * Value
+ * Result
+ *
+ * Hello N'Hello'
+ * G'Day N'G''Day'
+ * 'G''Day'
+ * N'''G''''Day'''
+ * I'''M N'I''''''M'
+ * N'Hello' N'N''Hello'''
+ *
+ *
+ *
+ * @implNote
+ * JDBC driver implementations may need to provide their own implementation
+ * of this method in order to meet the requirements of the underlying
+ * datasource. An implementation of enquoteNCharLiteral may accept a different
+ * set of characters than that accepted by the same drivers implementation of
+ * enquoteLiteral.
+ * @param val a character string
+ * @return the result of replacing every single quote character in the
+ * argument by two single quote characters where this entire result is
+ * then prefixed with 'N'.
+ * @throws NullPointerException if val is {@code null}
+ * @throws SQLException if a database access error occurs
+ */
+ default String enquoteNCharLiteral(String val) throws SQLException {
+ return "N'" + val.replace("'", "''") + "'";
+ }
}
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java
index 257bbb72953..cd3cf14164e 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java
@@ -45,7 +45,6 @@ import sun.awt.AWTPermissions;
* level support for capturing the top-level containers as they are created.
*/
-@jdk.Exported
public class AWTEventMonitor {
/**
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java
index 4719e7c12de..603ba035ae7 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java
@@ -43,7 +43,6 @@ import javax.accessibility.*;
*
*/
-@jdk.Exported
public class AccessibilityEventMonitor {
// listeners
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
index 76c7147ea09..0de59f95244 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityListenerList.java
@@ -37,7 +37,6 @@ import javax.accessibility.*;
*
*/
-@jdk.Exported
public class AccessibilityListenerList {
/* A null array to be shared by all empty listener lists */
private final static Object[] NULL_ARRAY = new Object[0];
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java
index bbd08f534e9..f984034b49f 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventID.java
@@ -35,7 +35,6 @@ package com.sun.java.accessibility.util;
* @see SwingEventMonitor
*
*/
-@jdk.Exported
public class EventID {
/**
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java
index aa87860bb48..4751ea0eba4 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/EventQueueMonitor.java
@@ -40,7 +40,6 @@ import java.security.PrivilegedAction;
* @see AWTEventMonitor
* @see SwingEventMonitor
*/
-@jdk.Exported
public class EventQueueMonitor
implements AWTEventListener {
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/GUIInitializedListener.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/GUIInitializedListener.java
index 9a4474d3e6b..02d706e3c0b 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/GUIInitializedListener.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/GUIInitializedListener.java
@@ -49,7 +49,6 @@ import javax.accessibility.*;
* @see EventQueueMonitor#removeGUIInitializedListener
*
*/
-@jdk.Exported
public interface GUIInitializedListener extends EventListener {
/**
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java
index c2150cd78f8..bbb0fcb18b3 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/SwingEventMonitor.java
@@ -56,7 +56,6 @@ import javax.accessibility.*;
* @see AWTEventMonitor
*
*/
-@jdk.Exported
public class SwingEventMonitor extends AWTEventMonitor {
/**
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/TopLevelWindowListener.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/TopLevelWindowListener.java
index 94d03307a7a..f24140c8668 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/TopLevelWindowListener.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/TopLevelWindowListener.java
@@ -43,7 +43,6 @@ import javax.accessibility.*;
* @see EventQueueMonitor#removeTopLevelWindowListener
*
*/
-@jdk.Exported
public interface TopLevelWindowListener extends EventListener {
/**
diff --git a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java
index 743777cbe72..177fbb4403c 100644
--- a/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java
+++ b/jdk/src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/Translator.java
@@ -58,7 +58,6 @@ import javax.accessibility.*;
* to implement accessibility features for a toolkit. Instead of relying upon this
* code, a toolkit's components should implement interface {@code Accessible} directly.
*/
-@jdk.Exported
public class Translator extends AccessibleContext
implements Accessible, AccessibleComponent {
diff --git a/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java b/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
index 47832a4455b..5ab82f3aa2c 100644
--- a/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
+++ b/jdk/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java
@@ -53,7 +53,6 @@ import java.util.concurrent.CountDownLatch;
* Note: This class has to be public. It's loaded from the VM like this:
* Class.forName(atName).newInstance();
*/
-@jdk.Exported(false)
final public class AccessBridge {
private static AccessBridge theAccessBridge;
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java
index 058b0f0048f..3ec14536f92 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentInitializationException.java
@@ -40,7 +40,6 @@ package com.sun.tools.attach;
* the error returned by the agent's {@code Agent_OnAttach} function.
* This error code can be obtained by invoking the {@link #returnValue() returnValue} method.
*/
-@jdk.Exported
public class AgentInitializationException extends Exception {
/** use serialVersionUID for interoperability */
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentLoadException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentLoadException.java
index 8b04c46c689..1f224105b25 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentLoadException.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AgentLoadException.java
@@ -36,7 +36,6 @@ package com.sun.tools.attach;
* com.sun.tools.attach.VirtualMachine#loadAgentPath loadAgentPath} methods
* if the agent, or agent library, cannot be loaded.
*/
-@jdk.Exported
public class AgentLoadException extends Exception {
/** use serialVersionUID for interoperability */
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java
index fb551866d2b..f9f7476883b 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachNotSupportedException.java
@@ -36,7 +36,6 @@ import com.sun.tools.attach.spi.AttachProvider; // for javadoc
* AttachProvider.attachVirtualMachine} if the provider attempts to
* attach to a Java virtual machine with which it not comptatible.
*/
-@jdk.Exported
public class AttachNotSupportedException extends Exception {
/** use serialVersionUID for interoperability */
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java
index fd37bb3f732..c245ec78716 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachOperationFailedException.java
@@ -37,7 +37,6 @@ import java.io.IOException;
*
* @since 1.9
*/
-@jdk.Exported
public class AttachOperationFailedException extends IOException {
private static final long serialVersionUID = 2140308168167478043L;
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java
index 0f573e8dff4..e5dc6afe32c 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/AttachPermission.java
@@ -79,7 +79,6 @@ package com.sun.tools.attach;
* @see com.sun.tools.attach.spi.AttachProvider
*/
-@jdk.Exported
public final class AttachPermission extends java.security.BasicPermission {
/** use serialVersionUID for interoperability */
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachine.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachine.java
index a9a9a56fdb5..345df5ee451 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachine.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachine.java
@@ -96,7 +96,6 @@ import java.io.IOException;
* @since 1.6
*/
-@jdk.Exported
public abstract class VirtualMachine {
private AttachProvider provider;
private String id;
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java
index b8d4ad6be3c..4f6e77cac52 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java
@@ -55,7 +55,6 @@ import com.sun.tools.attach.spi.AttachProvider;
*
* @since 1.6
*/
-@jdk.Exported
public class VirtualMachineDescriptor {
private AttachProvider provider;
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/package-info.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/package-info.java
index 465e3fd2ac5..38496385b05 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/package-info.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/package-info.java
@@ -38,5 +38,4 @@
* @since 1.6
*/
-@jdk.Exported
package com.sun.tools.attach;
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java
index 2d9aa9cfbc2..0ca0539f4ef 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/AttachProvider.java
@@ -74,7 +74,6 @@ import java.util.ServiceLoader;
* @since 1.6
*/
-@jdk.Exported
public abstract class AttachProvider {
private static final Object lock = new Object();
diff --git a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/package-info.java b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/package-info.java
index b2c68ebe5a0..9817b191be4 100644
--- a/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/package-info.java
+++ b/jdk/src/jdk.attach/share/classes/com/sun/tools/attach/spi/package-info.java
@@ -31,5 +31,4 @@
* @since 1.6
*/
-@jdk.Exported
package com.sun.tools.attach.spi;
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
index f654c778b81..4bca8abb83d 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
@@ -97,7 +97,7 @@ public class ExtendedCharsets extends AbstractCharsetProvider {
protected void init() {
if (initialized)
return;
- if (!sun.misc.VM.isBooted())
+ if (!jdk.internal.misc.VM.isBooted())
return;
String map = getProperty("sun.nio.cs.map");
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Authenticator.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Authenticator.java
index cdce078da59..5b7445da6de 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Authenticator.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Authenticator.java
@@ -36,7 +36,6 @@ import java.util.*;
* Note. This implies that any caching of credentials or other authentication
* information must be done outside of this class.
*/
-@jdk.Exported
public abstract class Authenticator {
/**
@@ -48,7 +47,6 @@ public abstract class Authenticator {
* Indicates an authentication failure. The authentication
* attempt has completed.
*/
- @jdk.Exported
public static class Failure extends Result {
private int responseCode;
@@ -70,7 +68,6 @@ public abstract class Authenticator {
* authenticated user principal can be acquired by calling
* getPrincipal().
*/
- @jdk.Exported
public static class Success extends Result {
private HttpPrincipal principal;
@@ -92,7 +89,6 @@ public abstract class Authenticator {
* set any necessary response headers in the given HttpExchange
* before returning this Retry object.
*/
- @jdk.Exported
public static class Retry extends Result {
private int responseCode;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java
index eb870310739..c9701c0c503 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/BasicAuthenticator.java
@@ -33,7 +33,6 @@ import java.util.Base64;
* to provide an implementation of {@link #checkCredentials(String,String)}
* which is called to verify each incoming request.
*/
-@jdk.Exported
public abstract class BasicAuthenticator extends Authenticator {
protected String realm;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java
index ac5d6fe718b..70ca21e4920 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java
@@ -39,7 +39,6 @@ import java.util.*;
* exchange handler.
* @since 1.6
*/
-@jdk.Exported
public abstract class Filter {
protected Filter () {}
@@ -49,7 +48,6 @@ public abstract class Filter {
* Each filter in the chain is given one of these
* so it can invoke the next filter in the chain
*/
- @jdk.Exported
public static class Chain {
/* the last element in the chain must invoke the users
* handler
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java
index 5c0608b84fa..2569060aa47 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/Headers.java
@@ -61,7 +61,6 @@ import java.util.*;
* as a header line containing the key but no associated value.
* @since 1.6
*/
-@jdk.Exported
public class Headers implements Map> {
HashMap> map;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpContext.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpContext.java
index 169e4a09f11..12ffdcce384 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpContext.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpContext.java
@@ -40,7 +40,6 @@ import java.util.*;
* context can be pre- and post-processed by each Filter in the chain.
* @since 1.6
*/
-@jdk.Exported
public abstract class HttpContext {
protected HttpContext () {
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java
index 0cf3623cf3d..0ce0b1220b1 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java
@@ -64,7 +64,6 @@ import java.util.*;
* @since 1.6
*/
-@jdk.Exported
public abstract class HttpExchange {
protected HttpExchange () {
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandler.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandler.java
index 62b621cd3a9..8ea7024e686 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandler.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpHandler.java
@@ -32,7 +32,6 @@ import java.io.IOException;
* HTTP exchange is handled by one of these handlers.
* @since 1.6
*/
-@jdk.Exported
public interface HttpHandler {
/**
* Handle the given request and generate an appropriate response.
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java
index df5e4228ac6..b0b6bdc84a8 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpPrincipal.java
@@ -33,7 +33,6 @@ import java.security.Principal;
* Represents a user authenticated by HTTP Basic or Digest
* authentication.
*/
-@jdk.Exported
public class HttpPrincipal implements Principal {
private String username, realm;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java
index f26dc1d65df..30ad5cec7f2 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpServer.java
@@ -87,7 +87,6 @@ import com.sun.net.httpserver.spi.HttpServerProvider;
* @since 1.6
*/
-@jdk.Exported
public abstract class HttpServer {
/**
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java
index 22bca16346d..6c4ddae65ad 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsConfigurator.java
@@ -67,7 +67,6 @@ import javax.net.ssl.*;
*
* @since 1.6
*/
-@jdk.Exported
public class HttpsConfigurator {
private SSLContext context;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsExchange.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsExchange.java
index 99a2733cf12..9bf9ed7d875 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsExchange.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsExchange.java
@@ -39,7 +39,6 @@ import java.util.*;
* @since 1.6
*/
-@jdk.Exported
public abstract class HttpsExchange extends HttpExchange {
protected HttpsExchange () {
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsParameters.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsParameters.java
index f3fd7a6e572..0aabee08be1 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsParameters.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsParameters.java
@@ -49,7 +49,6 @@ import javax.net.ssl.SSLParameters;
* are used, and any settings made in this object are ignored.
* @since 1.6
*/
-@jdk.Exported
public abstract class HttpsParameters {
private String[] cipherSuites;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsServer.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsServer.java
index f7eb542c9ba..ddf05472504 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsServer.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpsServer.java
@@ -45,7 +45,6 @@ import com.sun.net.httpserver.spi.*;
* @since 1.6
*/
-@jdk.Exported
public abstract class HttpsServer extends HttpServer {
/**
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java
index 84f13d61226..9737f97cca7 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/package-info.java
@@ -123,5 +123,4 @@
@since 1.6
*/
-@jdk.Exported
package com.sun.net.httpserver;
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java
index c838bd5a28d..df3efc92e63 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java
@@ -40,7 +40,6 @@ import com.sun.net.httpserver.*;
* {@link HttpServer} and associated classes. Applications do not normally use
* this class. See {@link #provider()} for how providers are found and loaded.
*/
-@jdk.Exported
public abstract class HttpServerProvider {
/**
diff --git a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/package-info.java b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/package-info.java
index 8c4d318a858..da8fecbd7c0 100644
--- a/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/package-info.java
+++ b/jdk/src/jdk.httpserver/share/classes/com/sun/net/httpserver/spi/package-info.java
@@ -27,5 +27,4 @@
* Provides a pluggable service provider interface, which allows the HTTP server
* implementation to be replaced with other implementations.
*/
-@jdk.Exported
package com.sun.net.httpserver.spi;
diff --git a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
index 4de54e95083..0976535946b 100644
--- a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
+++ b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSigner.java
@@ -38,7 +38,6 @@ import java.security.cert.CertificateException;
* @deprecated This class has been deprecated.
*/
-@jdk.Exported
@Deprecated
public abstract class ContentSigner {
diff --git a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
index 3a45318b316..e761a2c9205 100644
--- a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
+++ b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/ContentSignerParameters.java
@@ -36,7 +36,6 @@ import java.util.zip.ZipFile;
* @author Vincent Ryan
* @deprecated This class has been deprecated.
*/
-@jdk.Exported
@Deprecated
public interface ContentSignerParameters {
diff --git a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java
index cfed536a9eb..08197b5f6e6 100644
--- a/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java
+++ b/jdk/src/jdk.jartool/share/classes/com/sun/jarsigner/package-info.java
@@ -35,5 +35,4 @@
* to sign JAR files.
*/
-@jdk.Exported
package com.sun.jarsigner;
diff --git a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java
index b9ce4e30225..a25ff87513c 100644
--- a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java
+++ b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSigner.java
@@ -79,7 +79,6 @@ import java.util.zip.ZipOutputStream;
*
* @since 1.9
*/
-@jdk.Exported
public final class JarSigner {
/**
@@ -88,7 +87,6 @@ public final class JarSigner {
*
* @since 1.9
*/
- @jdk.Exported
public static class Builder {
// Signer materials:
diff --git a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java
index a6c73a68af4..d1b5449dbef 100644
--- a/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java
+++ b/jdk/src/jdk.jartool/share/classes/jdk/security/jarsigner/JarSignerException.java
@@ -30,7 +30,6 @@ package jdk.security.jarsigner;
*
* @since 1.9
*/
-@jdk.Exported
public class JarSignerException extends RuntimeException {
private static final long serialVersionUID = -4732217075689309530L;
diff --git a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsoleContext.java b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsoleContext.java
index fd941b87fea..e324109f05d 100644
--- a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsoleContext.java
+++ b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsoleContext.java
@@ -42,7 +42,6 @@ import javax.swing.event.SwingPropertyChangeSupport;
*
* @since 1.6
*/
-@jdk.Exported
public interface JConsoleContext {
/**
* The {@link ConnectionState ConnectionState} bound property name.
@@ -53,7 +52,6 @@ public interface JConsoleContext {
* Values for the {@linkplain #CONNECTION_STATE_PROPERTY
* ConnectionState } bound property.
*/
- @jdk.Exported
public enum ConnectionState {
/**
* The connection has been successfully established.
diff --git a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsolePlugin.java b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsolePlugin.java
index 48f43dc1ec8..04da16e4897 100644
--- a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsolePlugin.java
+++ b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/JConsolePlugin.java
@@ -72,7 +72,6 @@ import javax.swing.SwingWorker;
*
* @since 1.6
*/
-@jdk.Exported
public abstract class JConsolePlugin {
private volatile JConsoleContext context = null;
private List listeners = null;
diff --git a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/package-info.java b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/package-info.java
index 99b52aa3728..d9369d03a9b 100644
--- a/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/package-info.java
+++ b/jdk/src/jdk.jconsole/share/classes/com/sun/tools/jconsole/package-info.java
@@ -29,5 +29,4 @@
* @since 1.6
*/
-@jdk.Exported
package com.sun.tools.jconsole;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/AbsentInformationException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/AbsentInformationException.java
index 36ac31ede8f..6a2188ee191 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/AbsentInformationException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/AbsentInformationException.java
@@ -31,7 +31,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class AbsentInformationException extends Exception
{
private static final long serialVersionUID = 4988939309582416373L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java
index ba2463ad205..8d3ef267bfa 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Accessible.java
@@ -36,7 +36,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Accessible {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayReference.java
index d4cf64bf863..11b5bdbcf70 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayReference.java
@@ -39,7 +39,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ArrayReference extends ObjectReference {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayType.java
index 45c4f4d6406..d693c0e6195 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ArrayType.java
@@ -38,7 +38,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ArrayType extends ReferenceType {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanType.java
index 7bf98c8fd99..6e54580044d 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface BooleanType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanValue.java
index 73297fa7cfb..aca19cf130b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/BooleanValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface BooleanValue extends PrimitiveValue {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Bootstrap.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Bootstrap.java
index 623a7a4d5a9..2e639148d1e 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Bootstrap.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Bootstrap.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @since 1.3
*/
-@jdk.Exported
public class Bootstrap extends Object {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteType.java
index dc83cc3977a..6296aa51862 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ByteType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteValue.java
index a16ecd0ff8b..89074aab4b0 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ByteValue.java
@@ -33,7 +33,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ByteValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharType.java
index fab5a16ed6d..0710db0e462 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface CharType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharValue.java
index 2f9d630f1c8..e85348b67ea 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/CharValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface CharValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassLoaderReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassLoaderReference.java
index b8363aef870..9340bab4fe4 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassLoaderReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassLoaderReference.java
@@ -39,7 +39,6 @@ import java.util.List;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface ClassLoaderReference extends ObjectReference {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java
index ab516e06e50..790f8d0d1b8 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotLoadedException.java
@@ -67,7 +67,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class ClassNotLoadedException extends Exception
{
private static final long serialVersionUID = -6242978768444298722L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotPreparedException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotPreparedException.java
index 528b36e9648..f30e87f2474 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotPreparedException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassNotPreparedException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class ClassNotPreparedException extends RuntimeException {
private static final long serialVersionUID = -6120698967144079642L;
public ClassNotPreparedException()
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassObjectReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassObjectReference.java
index 79a306a075d..1670ceadd91 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassObjectReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassObjectReference.java
@@ -35,7 +35,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface ClassObjectReference extends ObjectReference {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassType.java
index 296f2e730fa..3286c73796f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ClassType.java
@@ -41,7 +41,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ClassType extends ReferenceType {
/**
* Gets the superclass of this class.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleType.java
index d40da78a745..41172bf808d 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface DoubleType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleValue.java
index e2f9cc2f25a..82e9eec1b07 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/DoubleValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface DoubleValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Field.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Field.java
index 6842a81fa78..206e9812bb7 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Field.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Field.java
@@ -38,7 +38,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Field extends TypeComponent, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatType.java
index 29cb99a6df3..a585eadb879 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface FloatType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatValue.java
index aa3be62a525..bb966bcdbf1 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/FloatValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface FloatValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IncompatibleThreadStateException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IncompatibleThreadStateException.java
index 11e110ff075..1fd8e713d52 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IncompatibleThreadStateException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IncompatibleThreadStateException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class IncompatibleThreadStateException extends Exception {
private static final long serialVersionUID = 6199174323414551389L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InconsistentDebugInfoException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InconsistentDebugInfoException.java
index 8fe3ae91392..305efa06e09 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InconsistentDebugInfoException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InconsistentDebugInfoException.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class InconsistentDebugInfoException extends RuntimeException {
private static final long serialVersionUID = 7964236415376861808L;
public InconsistentDebugInfoException() {
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerType.java
index f19b6de34fd..cf4edd0e587 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface IntegerType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerValue.java
index b8a10a89f92..d0bd44a26b8 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/IntegerValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface IntegerValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InterfaceType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InterfaceType.java
index 80250de8a5d..64a9fa48ee0 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InterfaceType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InterfaceType.java
@@ -43,7 +43,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface InterfaceType extends ReferenceType {
/**
* Gets the interfaces directly extended by this interface.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InternalException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InternalException.java
index b688ca54e11..a291ac196e5 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InternalException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InternalException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class InternalException extends RuntimeException {
private static final long serialVersionUID = -9171606393104480607L;
private int errorCode;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidCodeIndexException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidCodeIndexException.java
index 928f74198d6..3e62cf8df84 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidCodeIndexException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidCodeIndexException.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
@Deprecated
public class InvalidCodeIndexException extends RuntimeException {
private static final long serialVersionUID = 7416010225133747805L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidLineNumberException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidLineNumberException.java
index 0786d52ba00..bc40ea6e8b8 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidLineNumberException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidLineNumberException.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
@Deprecated
public class InvalidLineNumberException extends RuntimeException {
private static final long serialVersionUID = 4048709912372692875L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidStackFrameException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidStackFrameException.java
index 2f28d07ba22..e57bfa53454 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidStackFrameException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidStackFrameException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class InvalidStackFrameException extends RuntimeException {
private static final long serialVersionUID = -1919378296505827922L;
public InvalidStackFrameException() {
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidTypeException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidTypeException.java
index 299c4474322..904248ccb03 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidTypeException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvalidTypeException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public class InvalidTypeException extends Exception {
private static final long serialVersionUID = 2256667231949650806L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvocationException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvocationException.java
index 1f8179e1f0f..4e66f601b96 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvocationException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/InvocationException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class InvocationException extends Exception {
private static final long serialVersionUID = 6066780907971918568L;
ObjectReference exception;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java
index 0f4abb258a8..109500afc97 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/JDIPermission.java
@@ -78,7 +78,6 @@ package com.sun.jdi;
*
*/
-@jdk.Exported
public final class JDIPermission extends java.security.BasicPermission {
private static final long serialVersionUID = -6988461416938786271L;
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LocalVariable.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LocalVariable.java
index 4b15d91c604..09308015dfc 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LocalVariable.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LocalVariable.java
@@ -42,7 +42,6 @@ package com.sun.jdi;
* @since 1.3
*/
-@jdk.Exported
public interface LocalVariable extends Mirror, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java
index a0089436a78..16db7bff8ce 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Locatable.java
@@ -33,7 +33,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Locatable {
/**
* Returns the {@link Location} of this mirror, if there is
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Location.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Location.java
index e508781c274..b17f2418b9d 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Location.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Location.java
@@ -86,7 +86,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Location extends Mirror, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongType.java
index f3cc7364f44..3ce46a5660c 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface LongType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongValue.java
index 98e25c2a4a9..e3f33a7c65c 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/LongValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface LongValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Method.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Method.java
index 39cde3ea73c..02d6ae9bba6 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Method.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Method.java
@@ -39,7 +39,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Method extends TypeComponent, Locatable, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Mirror.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Mirror.java
index eb01abfb682..e9f88871409 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Mirror.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Mirror.java
@@ -56,7 +56,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/MonitorInfo.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/MonitorInfo.java
index ef72517b9b1..29aae2c2876 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/MonitorInfo.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/MonitorInfo.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @since 1.6
*/
-@jdk.Exported
public interface MonitorInfo extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/NativeMethodException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/NativeMethodException.java
index 63797014f70..2708c20deea 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/NativeMethodException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/NativeMethodException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class NativeMethodException extends RuntimeException {
private static final long serialVersionUID = 3924951669039469992L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectCollectedException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectCollectedException.java
index b88395e36b3..b088064e97c 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectCollectedException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectCollectedException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class ObjectCollectedException extends RuntimeException {
private static final long serialVersionUID = -1928428056197269588L;
public ObjectCollectedException() {
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectReference.java
index b6bf5a3eb19..629fdb86a45 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ObjectReference.java
@@ -55,7 +55,6 @@ import java.util.Map;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ObjectReference extends Value {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java
index 7a75fd614f0..adc6b76cc05 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java
@@ -33,7 +33,6 @@ import java.util.List;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface PathSearchingVirtualMachine extends VirtualMachine {
/**
* Get the class path for this virtual machine.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveType.java
index 9cc721f4b28..b4315b2286c 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveType.java
@@ -37,6 +37,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface PrimitiveType extends Type {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveValue.java
index 96014881007..e33be4788bc 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/PrimitiveValue.java
@@ -35,7 +35,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface PrimitiveValue extends Value {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ReferenceType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ReferenceType.java
index 43d1c023db6..30052d547bd 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ReferenceType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ReferenceType.java
@@ -77,7 +77,6 @@ import java.util.Map;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ReferenceType
extends Type, Comparable, Accessible
{
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortType.java
index 9e0a2a9c51a..cfff5407cc0 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ShortType extends PrimitiveType {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortValue.java
index 61e54ec24f2..6cedd8da48e 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ShortValue.java
@@ -34,7 +34,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ShortValue extends PrimitiveValue, Comparable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java
index 9d51d8adb77..7b330c76622 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StackFrame.java
@@ -58,7 +58,6 @@ import java.util.Map;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface StackFrame extends Mirror, Locatable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StringReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StringReference.java
index 92e7167852f..8a1053a27a1 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StringReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/StringReference.java
@@ -35,7 +35,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface StringReference extends ObjectReference {
/**
* Returns the StringReference as a String. The returned string
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadGroupReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadGroupReference.java
index 110504f5972..9c33180ee9b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadGroupReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadGroupReference.java
@@ -37,7 +37,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ThreadGroupReference extends ObjectReference {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java
index 2e09ec8c96b..ab537ee3f38 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/ThreadReference.java
@@ -36,7 +36,6 @@ import java.util.List;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface ThreadReference extends ObjectReference {
/** Thread status is unknown */
public final int THREAD_STATUS_UNKNOWN =-1;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java
index 852d714ce71..41b61fcba80 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Type.java
@@ -127,7 +127,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface Type extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/TypeComponent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/TypeComponent.java
index fa36d7bc978..5e077eaaa52 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/TypeComponent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/TypeComponent.java
@@ -44,7 +44,6 @@ package com.sun.jdi;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface TypeComponent extends Mirror, Accessible {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMCannotBeModifiedException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMCannotBeModifiedException.java
index 49f1c8860a3..0366425f66e 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMCannotBeModifiedException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMCannotBeModifiedException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Jim Holmlund
* @since 1.5
*/
-@jdk.Exported
public class VMCannotBeModifiedException extends UnsupportedOperationException {
private static final long serialVersionUID = -4063879815130164009L;
public VMCannotBeModifiedException() {
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMDisconnectedException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMDisconnectedException.java
index faeab609572..f6805f01c8a 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMDisconnectedException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMDisconnectedException.java
@@ -33,7 +33,6 @@ package com.sun.jdi;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public class VMDisconnectedException extends RuntimeException {
private static final long serialVersionUID = 2892975269768351637L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMMismatchException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMMismatchException.java
index b05a9aad48e..ff0c3db5213 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMMismatchException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMMismatchException.java
@@ -33,7 +33,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class VMMismatchException extends RuntimeException {
private static final long serialVersionUID = 289169358790459564L;
public VMMismatchException() {
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMOutOfMemoryException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMOutOfMemoryException.java
index cc64d929eda..2834d3403c3 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMOutOfMemoryException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VMOutOfMemoryException.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class VMOutOfMemoryException extends RuntimeException {
private static final long serialVersionUID = 71504228548910686L;
public VMOutOfMemoryException() {
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java
index 01d869b2ce3..75e5e410fa7 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/Value.java
@@ -168,7 +168,6 @@ package com.sun.jdi;
* @since 1.3
*/
-@jdk.Exported
public interface Value extends Mirror {
/**
* Returns the run-time type of this value.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java
index 0571a27d311..c54cc16b992 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java
@@ -70,7 +70,6 @@ import java.util.Map;
* @author James McIlree
* @since 1.3
*/
-@jdk.Exported
public interface VirtualMachine extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java
index dbde25bd19b..5a6fd8b596c 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachineManager.java
@@ -275,7 +275,6 @@ import java.io.IOException;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface VirtualMachineManager {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidType.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidType.java
index 9a9ee468a3c..460c452a4e4 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidType.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidType.java
@@ -35,6 +35,5 @@ package com.sun.jdi;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface VoidType extends Type {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidValue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidValue.java
index f3fb87e2ce3..6a60cb82978 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidValue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/VoidValue.java
@@ -32,7 +32,6 @@ package com.sun.jdi;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface VoidValue extends Value {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/AttachingConnector.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/AttachingConnector.java
index a4409c6ded4..ccb11c2b765 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/AttachingConnector.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/AttachingConnector.java
@@ -35,7 +35,6 @@ import java.io.IOException;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface AttachingConnector extends Connector {
/**
* Attaches to a running application and returns a
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Connector.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Connector.java
index 52aebbff5bf..a2b4b386b0a 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Connector.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Connector.java
@@ -45,7 +45,6 @@ import java.io.Serializable;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface Connector {
/**
* Returns a short identifier for the connector. Connector implementors
@@ -92,7 +91,6 @@ public interface Connector {
* {@link Connector.IntegerArgument},
* or {@link Connector.SelectedArgument}.
*/
- @jdk.Exported
public interface Argument extends Serializable {
/**
* Returns a short, unique identifier for the argument.
@@ -158,7 +156,6 @@ public interface Connector {
* whose value is Boolean. Boolean values are represented
* by the localized versions of the strings "true" and "false".
*/
- @jdk.Exported
public interface BooleanArgument extends Argument {
/**
* Sets the value of the argument.
@@ -199,7 +196,6 @@ public interface Connector {
* whose value is an integer. Integer values are represented
* by their corresponding strings.
*/
- @jdk.Exported
public interface IntegerArgument extends Argument {
/**
* Sets the value of the argument.
@@ -261,7 +257,6 @@ public interface Connector {
* Specification for and value of a Connector argument,
* whose value is a String.
*/
- @jdk.Exported
public interface StringArgument extends Argument {
/**
* Performs basic sanity check of argument.
@@ -274,7 +269,6 @@ public interface Connector {
* Specification for and value of a Connector argument,
* whose value is a String selected from a list of choices.
*/
- @jdk.Exported
public interface SelectedArgument extends Argument {
/**
* Return the possible values for the argument
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java
index b7f57c093ec..d122fa2b84b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java
@@ -36,7 +36,6 @@ import java.util.Collections;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class IllegalConnectorArgumentsException extends Exception {
private static final long serialVersionUID = -3042212603611350941L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/LaunchingConnector.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/LaunchingConnector.java
index af801e961ee..2ad3ba6abfb 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/LaunchingConnector.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/LaunchingConnector.java
@@ -35,7 +35,6 @@ import java.io.IOException;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface LaunchingConnector extends Connector {
/**
* Launches an application and connects to its VM. Properties
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/ListeningConnector.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/ListeningConnector.java
index 1048201d12b..0057299168f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/ListeningConnector.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/ListeningConnector.java
@@ -35,7 +35,6 @@ import com.sun.jdi.VirtualMachine;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface ListeningConnector extends Connector {
/**
* Indicates whether this listening connector supports multiple
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Transport.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Transport.java
index 102d64cd1c7..d185132ebfd 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Transport.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/Transport.java
@@ -42,7 +42,6 @@ import com.sun.jdi.connect.spi.TransportService; // for javadoc
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public interface Transport {
/**
* Returns a short identifier for the transport.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/TransportTimeoutException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/TransportTimeoutException.java
index 2a13567af76..d2a8e50089f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/TransportTimeoutException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/TransportTimeoutException.java
@@ -54,7 +54,6 @@ package com.sun.jdi.connect;
*
* @since 1.5
*/
-@jdk.Exported
public class TransportTimeoutException extends java.io.IOException {
private static final long serialVersionUID = 4107035242623365074L;
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/VMStartException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/VMStartException.java
index 04c06292180..0296e78a63f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/VMStartException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/VMStartException.java
@@ -34,7 +34,6 @@ package com.sun.jdi.connect;
* @author Gordon Hirsch
* @since 1.3
*/
-@jdk.Exported
public class VMStartException extends Exception {
private static final long serialVersionUID = 6408644824640801020L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/package-info.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/package-info.java
index c444b75137a..c7a240ef47d 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/package-info.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/package-info.java
@@ -35,5 +35,4 @@
* extension.
*/
-@jdk.Exported
package com.sun.jdi.connect;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java
index 009128b7214..88fc547d882 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java
@@ -45,7 +45,6 @@ package com.sun.jdi.connect.spi;
*
* @since 1.5
*/
-@jdk.Exported
public class ClosedConnectionException extends java.io.IOException {
private static final long serialVersionUID = 3877032124297204774L;
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java
index 31e1ca5870f..2067d714c4b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/Connection.java
@@ -56,7 +56,6 @@ import java.io.IOException;
* @since 1.5
*/
-@jdk.Exported
public abstract class Connection {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java
index f51c762911a..61eba8880cc 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/TransportService.java
@@ -77,7 +77,6 @@ import com.sun.jdi.connect.TransportTimeoutException;
* @since 1.5
*/
-@jdk.Exported
public abstract class TransportService {
/**
@@ -97,7 +96,6 @@ public abstract class TransportService {
/**
* The transport service capabilities.
*/
- @jdk.Exported
public static abstract class Capabilities {
/**
@@ -231,7 +229,6 @@ public abstract class TransportService {
* #stopListening stopListening} to stop the transport
* service from listening on an address.
*/
- @jdk.Exported
public static abstract class ListenKey {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/package-info.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/package-info.java
index 956e28dcff8..ad8a359817f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/package-info.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/connect/spi/package-info.java
@@ -29,5 +29,4 @@
* implementations.
*/
-@jdk.Exported
package com.sun.jdi.connect.spi;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java
index b04d4f71ac5..b56f0ca9e33 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java
@@ -37,6 +37,5 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface AccessWatchpointEvent extends WatchpointEvent {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/BreakpointEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/BreakpointEvent.java
index 565f4f05dd4..131a031ef72 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/BreakpointEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/BreakpointEvent.java
@@ -47,6 +47,5 @@ import java.util.List;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface BreakpointEvent extends LocatableEvent {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassPrepareEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassPrepareEvent.java
index 2f0bf5a353c..4812994a1b2 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassPrepareEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassPrepareEvent.java
@@ -39,7 +39,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ClassPrepareEvent extends Event {
/**
* Returns the thread in which this event has occurred.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassUnloadEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassUnloadEvent.java
index b900e6ad9df..357619563c8 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassUnloadEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ClassUnloadEvent.java
@@ -39,7 +39,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ClassUnloadEvent extends Event {
/**
* Returns the name of the class that has been unloaded.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/Event.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/Event.java
index 8e8185cf22a..b6f9653ef29 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/Event.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/Event.java
@@ -43,7 +43,6 @@ import com.sun.jdi.request.EventRequest;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface Event extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventIterator.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventIterator.java
index e16ccc5b2f6..0028d850e0b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventIterator.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventIterator.java
@@ -40,7 +40,6 @@ import java.util.Iterator;
* @since 1.3
*/
-@jdk.Exported
public interface EventIterator extends Iterator {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventQueue.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventQueue.java
index e7912ba68a4..f4c313abb31 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventQueue.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventQueue.java
@@ -57,7 +57,6 @@ import com.sun.jdi.*;
* @since 1.3
*/
-@jdk.Exported
public interface EventQueue extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventSet.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventSet.java
index 640dacd0113..1acef1ef0d2 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventSet.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/EventSet.java
@@ -126,7 +126,6 @@ import java.util.Set;
* @since 1.3
*/
-@jdk.Exported
public interface EventSet extends Mirror, Set {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ExceptionEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ExceptionEvent.java
index 91ed8e4a338..ba887e56cff 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ExceptionEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ExceptionEvent.java
@@ -44,7 +44,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ExceptionEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/LocatableEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/LocatableEvent.java
index ab4d7f587c9..489e6117a22 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/LocatableEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/LocatableEvent.java
@@ -36,7 +36,6 @@ import java.util.List;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface LocatableEvent extends Event, Locatable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodEntryEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodEntryEvent.java
index 29e4df6eb6f..29216ed5d28 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodEntryEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodEntryEvent.java
@@ -43,7 +43,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface MethodEntryEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodExitEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodExitEvent.java
index 6c7ad305b2a..67ef5287827 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodExitEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MethodExitEvent.java
@@ -40,7 +40,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface MethodExitEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java
index 965a6cd932a..b35a9f74875 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java
@@ -38,7 +38,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ModificationWatchpointEvent extends WatchpointEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java
index 8e7cbaac8ae..e3b3a8f76ed 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java
@@ -39,7 +39,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorContendedEnterEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java
index 8b4ca48a917..774e1b7732a 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java
@@ -38,7 +38,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorContendedEnteredEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitEvent.java
index 9a064356ba5..2e5c63ffb40 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitEvent.java
@@ -37,7 +37,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorWaitEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java
index f29bed152d9..93917b58f5f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java
@@ -37,7 +37,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorWaitedEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/StepEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/StepEvent.java
index 279078751f8..269ed38ce9a 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/StepEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/StepEvent.java
@@ -46,6 +46,5 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface StepEvent extends LocatableEvent {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadDeathEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadDeathEvent.java
index cd233808691..1277172c962 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadDeathEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadDeathEvent.java
@@ -45,7 +45,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ThreadDeathEvent extends Event {
/**
* Returns the thread which is terminating.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadStartEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadStartEvent.java
index 01e9e630e4d..e5fa0d25634 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadStartEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/ThreadStartEvent.java
@@ -52,7 +52,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ThreadStartEvent extends Event {
/**
* Returns the thread which has started.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDeathEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDeathEvent.java
index c96aa12ff79..21e0107df2e 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDeathEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDeathEvent.java
@@ -68,6 +68,5 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface VMDeathEvent extends Event {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDisconnectEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDisconnectEvent.java
index 82c49e2c8f7..a2cf66ea537 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDisconnectEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMDisconnectEvent.java
@@ -52,6 +52,5 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface VMDisconnectEvent extends Event {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMStartEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMStartEvent.java
index 586526ab713..37693ad7587 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMStartEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/VMStartEvent.java
@@ -43,7 +43,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface VMStartEvent extends Event {
/**
* Returns the initial thread of the VM which has started.
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/WatchpointEvent.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/WatchpointEvent.java
index 0246bff4d48..4573407580f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/WatchpointEvent.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/WatchpointEvent.java
@@ -37,7 +37,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface WatchpointEvent extends LocatableEvent {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/package-info.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/package-info.java
index fa9afe3346a..921df07a72d 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/package-info.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/event/package-info.java
@@ -43,5 +43,4 @@
* extension.
*/
-@jdk.Exported
package com.sun.jdi.event;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/package-info.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/package-info.java
index 00f422fd702..3b34bc24182 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/package-info.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/package-info.java
@@ -44,5 +44,4 @@
* extension.
*/
-@jdk.Exported
package com.sun.jdi;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java
index 9b6e71b8680..091cf44dccb 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java
@@ -55,6 +55,5 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface AccessWatchpointRequest extends WatchpointRequest {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/BreakpointRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/BreakpointRequest.java
index c6d937ed401..259aa547705 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/BreakpointRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/BreakpointRequest.java
@@ -46,7 +46,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface BreakpointRequest extends EventRequest, Locatable {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassPrepareRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassPrepareRequest.java
index 4bd1b787e3a..efaf237c7d0 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassPrepareRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassPrepareRequest.java
@@ -47,7 +47,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ClassPrepareRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassUnloadRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassUnloadRequest.java
index 4335c03029d..2f2758e5108 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassUnloadRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ClassUnloadRequest.java
@@ -46,7 +46,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ClassUnloadRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/DuplicateRequestException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/DuplicateRequestException.java
index 3412f23b59a..fa8c0783fb8 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/DuplicateRequestException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/DuplicateRequestException.java
@@ -31,7 +31,6 @@ package com.sun.jdi.request;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public class DuplicateRequestException extends RuntimeException {
private static final long serialVersionUID = -3719784920313411060L;
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequest.java
index 137fdbb1c3f..062fc53fe34 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequest.java
@@ -78,7 +78,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface EventRequest extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequestManager.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequestManager.java
index e3b421ab897..cfd53b7762f 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequestManager.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/EventRequestManager.java
@@ -44,7 +44,6 @@ import java.util.List;
* @since 1.3
*/
-@jdk.Exported
public interface EventRequestManager extends Mirror {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ExceptionRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ExceptionRequest.java
index 8de652fa794..5dad44e466b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ExceptionRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ExceptionRequest.java
@@ -43,7 +43,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ExceptionRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/InvalidRequestStateException.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/InvalidRequestStateException.java
index 6faab81d472..8bcd93e0a0b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/InvalidRequestStateException.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/InvalidRequestStateException.java
@@ -35,7 +35,6 @@ package com.sun.jdi.request;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public class InvalidRequestStateException extends RuntimeException {
private static final long serialVersionUID = -3774632428543322148L;
public InvalidRequestStateException()
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodEntryRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodEntryRequest.java
index c31a1e7eefb..8636b108a79 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodEntryRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodEntryRequest.java
@@ -44,7 +44,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface MethodEntryRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodExitRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodExitRequest.java
index 8c64b9f36a1..f8a852a13f0 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodExitRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MethodExitRequest.java
@@ -44,7 +44,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface MethodExitRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java
index 994658485d6..29247dfed23 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java
@@ -55,6 +55,5 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ModificationWatchpointRequest extends WatchpointRequest {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java
index 56c462592b0..2422dad489a 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java
@@ -45,7 +45,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorContendedEnterRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java
index cc36ea25dde..ad617722102 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java
@@ -45,7 +45,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorContendedEnteredRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitRequest.java
index 9cb162bd61e..81433ca6242 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitRequest.java
@@ -45,7 +45,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorWaitRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java
index 6cc41fb4598..1b278ef9300 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java
@@ -45,7 +45,6 @@ import com.sun.jdi.*;
* @author Swamy Venkataramanappa
* @since 1.6
*/
-@jdk.Exported
public interface MonitorWaitedRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/StepRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/StepRequest.java
index abcb249b71d..df3c899f2c0 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/StepRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/StepRequest.java
@@ -43,7 +43,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface StepRequest extends EventRequest {
/** Step into any newly pushed frames */
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadDeathRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadDeathRequest.java
index 916fff45bc7..f39eb3e7903 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadDeathRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadDeathRequest.java
@@ -44,7 +44,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ThreadDeathRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadStartRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadStartRequest.java
index c34d1710b68..0ee00a0201a 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadStartRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/ThreadStartRequest.java
@@ -44,7 +44,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface ThreadStartRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/VMDeathRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/VMDeathRequest.java
index 69a767fa18f..4aadcc9d827 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/VMDeathRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/VMDeathRequest.java
@@ -56,7 +56,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.4
*/
-@jdk.Exported
public interface VMDeathRequest extends EventRequest {
}
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/WatchpointRequest.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/WatchpointRequest.java
index 0b0de7e3592..9fb63ca117b 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/WatchpointRequest.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/WatchpointRequest.java
@@ -38,7 +38,6 @@ import com.sun.jdi.*;
* @author Robert Field
* @since 1.3
*/
-@jdk.Exported
public interface WatchpointRequest extends EventRequest {
/**
diff --git a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/package-info.java b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/package-info.java
index add151ddce0..1b430cae426 100644
--- a/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/package-info.java
+++ b/jdk/src/jdk.jdi/share/classes/com/sun/jdi/request/package-info.java
@@ -42,5 +42,4 @@
* extension.
*/
-@jdk.Exported
package com.sun.jdi.request;
diff --git a/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractMonitoredVm.java b/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractMonitoredVm.java
index 8df13ca7f30..fc93d5c678e 100644
--- a/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractMonitoredVm.java
+++ b/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractMonitoredVm.java
@@ -95,7 +95,7 @@ public abstract class AbstractMonitoredVm implements BufferedMonitoredVm {
public void detach() {
/*
* no default action required because the detach operation for the
- * native byte buffer is managed by the sun.misc.Perf class.
+ * native byte buffer is managed by the Perf class.
*/
}
diff --git a/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractPerfDataBuffer.java b/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractPerfDataBuffer.java
index 7a5e9998bc9..a2d3ad4c2a4 100644
--- a/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractPerfDataBuffer.java
+++ b/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/AbstractPerfDataBuffer.java
@@ -25,7 +25,6 @@
package sun.jvmstat.perfdata.monitor;
-import sun.misc.Perf;
import sun.jvmstat.monitor.*;
import java.util.*;
import java.io.*;
diff --git a/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataBuffer.java b/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataBuffer.java
index 5932312d1ab..0ab643e106a 100644
--- a/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataBuffer.java
+++ b/jdk/src/jdk.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataBuffer.java
@@ -25,7 +25,7 @@
package sun.jvmstat.perfdata.monitor.protocol.local;
-import sun.misc.Perf;
+import jdk.internal.perf.Perf;
import sun.jvmstat.monitor.*;
import sun.jvmstat.perfdata.monitor.*;
import java.util.*;
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java
index 8396a850202..20874867f76 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java
@@ -82,7 +82,6 @@ import com.sun.management.internal.GarbageCollectionNotifInfoCompositeData;
*
**/
-@jdk.Exported
public class GarbageCollectionNotificationInfo implements CompositeDataView {
private final String gcName;
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectorMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectorMXBean.java
index 4963eac61c4..0ee508d536b 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectorMXBean.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/GarbageCollectorMXBean.java
@@ -37,7 +37,6 @@ import javax.management.openmbean.CompositeType;
* @author Mandy Chung
* @since 1.5
*/
-@jdk.Exported
public interface GarbageCollectorMXBean
extends java.lang.management.GarbageCollectorMXBean {
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java b/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java
index f256b086a88..ffb25e40670 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/GcInfo.java
@@ -63,7 +63,6 @@ import com.sun.management.internal.GcInfoBuilder;
* @author Mandy Chung
* @since 1.5
*/
-@jdk.Exported
public class GcInfo implements CompositeData, CompositeDataView {
private final long index;
private final long startTime;
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java
index 1d64ae0b452..40d79a2800c 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java
@@ -47,7 +47,6 @@ import java.lang.management.PlatformManagedObject;
*
* @see java.lang.management.ManagementFactory#getPlatformMXBeans(Class)
*/
-@jdk.Exported
public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
/**
* Dumps the heap to the {@code outputFile} file in the same
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java
index edee07f1d21..feb8e9481c6 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java
@@ -39,7 +39,6 @@ package com.sun.management;
* @author Mandy Chung
* @since 1.5
*/
-@jdk.Exported
public interface OperatingSystemMXBean extends
java.lang.management.OperatingSystemMXBean {
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java
index 4801bbadebf..c45e49ef5f8 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/ThreadMXBean.java
@@ -38,7 +38,6 @@ import java.util.Map;
* @since 6u25
*/
-@jdk.Exported
public interface ThreadMXBean extends java.lang.management.ThreadMXBean {
/**
* Returns the total CPU time for each thread whose ID is
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java b/jdk/src/jdk.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java
index f094f5cb891..d0b64f01574 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/UnixOperatingSystemMXBean.java
@@ -32,7 +32,6 @@ package com.sun.management;
* @author Mandy Chung
* @since 1.5
*/
-@jdk.Exported
public interface UnixOperatingSystemMXBean extends
com.sun.management.OperatingSystemMXBean {
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java
index bebe1974010..4d9290035ef 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/VMOption.java
@@ -52,7 +52,6 @@ import javax.management.openmbean.CompositeData;
* @author Mandy Chung
* @since 1.6
*/
-@jdk.Exported
public class VMOption {
private String name;
private String value;
@@ -65,7 +64,6 @@ public class VMOption {
*
* @since 1.6
*/
- @jdk.Exported
public enum Origin {
/**
* The VM option has not been set and its value
diff --git a/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java b/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java
index 75808f5c96f..92b200f19b4 100644
--- a/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java
+++ b/jdk/src/jdk.management/share/classes/com/sun/management/package-info.java
@@ -40,5 +40,4 @@
* @since 1.5
*/
-@jdk.Exported
package com.sun.management;
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java
index 498897f2d10..5cf4f80ab35 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java
@@ -39,7 +39,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public class AbstractNotificationHandler
implements NotificationHandler
{
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Association.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Association.java
index 9d48b1f311f..79170ddf831 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Association.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Association.java
@@ -51,7 +51,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public class Association {
private final int associationID;
private final int maxInStreams;
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java
index 7aefc787eb6..6799f3f6418 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java
@@ -29,7 +29,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class AssociationChangeNotification
implements Notification
{
@@ -38,7 +37,6 @@ public abstract class AssociationChangeNotification
*
* @since 1.7
*/
- @jdk.Exported
public enum AssocChangeEvent
{
/**
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java
index b884f823ba9..c4ca0a3de0d 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/HandlerResult.java
@@ -34,7 +34,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public enum HandlerResult {
/**
* Try to receieve another message or notification.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalReceiveException.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalReceiveException.java
index 7665817791e..a007c9ecebd 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalReceiveException.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalReceiveException.java
@@ -31,7 +31,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public class IllegalReceiveException extends IllegalStateException {
private static final long serialVersionUID = 2296619040988576224L;
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalUnbindException.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalUnbindException.java
index 5ba86161ab2..3d4a3de5fbf 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalUnbindException.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/IllegalUnbindException.java
@@ -31,7 +31,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public class IllegalUnbindException extends IllegalStateException {
private static final long serialVersionUID = -310540883995532224L;
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/InvalidStreamException.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/InvalidStreamException.java
index 0c0c93c3f4b..9c0437228dd 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/InvalidStreamException.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/InvalidStreamException.java
@@ -30,7 +30,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public class InvalidStreamException extends IllegalArgumentException {
private static final long serialVersionUID = -9172703378046665558L;
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/MessageInfo.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/MessageInfo.java
index e3208f2b9f9..8fdd4e31bd9 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/MessageInfo.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/MessageInfo.java
@@ -56,7 +56,6 @@ import java.net.SocketAddress;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class MessageInfo {
/**
* Initializes a new instance of this class.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Notification.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Notification.java
index 7b15b2301fa..e71b88e3608 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Notification.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/Notification.java
@@ -37,7 +37,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public interface Notification {
/**
* Returns the association that this notification is applicable to.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/NotificationHandler.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/NotificationHandler.java
index 27b357fc27b..9e5f239f297 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/NotificationHandler.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/NotificationHandler.java
@@ -49,7 +49,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public interface NotificationHandler {
/**
* Invoked when a notification is received from the SCTP stack.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java
index 4eab3cb1e33..f6f895ebc58 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java
@@ -32,7 +32,6 @@ import java.net.SocketAddress;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class PeerAddressChangeNotification
implements Notification
{
@@ -47,7 +46,6 @@ public abstract class PeerAddressChangeNotification
*
* @since 1.7
*/
- @jdk.Exported
public enum AddressChangeEvent {
/**
* This address is now reachable.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java
index 065b13036e5..c70433277a8 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpChannel.java
@@ -134,7 +134,6 @@ import java.nio.channels.SelectionKey;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class SctpChannel
extends AbstractSelectableChannel
{
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
index aa32a7468a2..529414389e1 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpMultiChannel.java
@@ -134,7 +134,6 @@ import java.nio.channels.SelectionKey;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class SctpMultiChannel
extends AbstractSelectableChannel
{
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java
index 0e9b9c35f68..4a2ced93462 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpServerChannel.java
@@ -68,7 +68,6 @@ import java.nio.channels.spi.AbstractSelectableChannel;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class SctpServerChannel
extends AbstractSelectableChannel
{
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpSocketOption.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpSocketOption.java
index 72c92f53773..2b4d0abd079 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpSocketOption.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpSocketOption.java
@@ -35,5 +35,4 @@ import java.net.SocketOption;
*
* @see SctpStandardSocketOptions
*/
-@jdk.Exported
public interface SctpSocketOption extends SocketOption { }
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java
index 75e5c0c05ea..27f175c1d98 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java
@@ -34,7 +34,6 @@ import sun.nio.ch.sctp.SctpStdSocketOption;
*
* @since 1.7
*/
-@jdk.Exported
public class SctpStandardSocketOptions {
private SctpStandardSocketOptions() {}
/**
@@ -316,7 +315,6 @@ public class SctpStandardSocketOptions {
*
* @since 1.7
*/
- @jdk.Exported
public static class InitMaxStreams {
private int maxInStreams;
private int maxOutStreams;
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SendFailedNotification.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SendFailedNotification.java
index d69a666b907..22abe888612 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SendFailedNotification.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/SendFailedNotification.java
@@ -37,7 +37,6 @@ import java.net.SocketAddress;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class SendFailedNotification implements Notification {
/**
* Initializes a new instance of this class.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/ShutdownNotification.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/ShutdownNotification.java
index 90f66b92c2e..2a8d7ba1c43 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/ShutdownNotification.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/ShutdownNotification.java
@@ -32,7 +32,6 @@ package com.sun.nio.sctp;
*
* @since 1.7
*/
-@jdk.Exported
public abstract class ShutdownNotification implements Notification {
/**
* Initializes a new instance of this class.
diff --git a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/package-info.java b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/package-info.java
index ac9cca923db..0cf19db8ee9 100644
--- a/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/package-info.java
+++ b/jdk/src/jdk.sctp/share/classes/com/sun/nio/sctp/package-info.java
@@ -72,5 +72,4 @@
* @since 1.7
*/
-@jdk.Exported
package com.sun.nio.sctp;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/LdapPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/LdapPrincipal.java
index 6a324eeaccc..6af39422d5f 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/LdapPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/LdapPrincipal.java
@@ -45,7 +45,6 @@ import javax.naming.ldap.LdapName;
*
* @since 1.6
*/
-@jdk.Exported
public final class LdapPrincipal implements Principal, java.io.Serializable {
private static final long serialVersionUID = 6820120005580754861L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java
index 995732efa16..2b15a509e4c 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTDomainPrincipal.java
@@ -45,7 +45,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class NTDomainPrincipal implements Principal, java.io.Serializable {
private static final long serialVersionUID = -4408637351440771220L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java
index eca81587468..480e400ceb1 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTNumericCredential.java
@@ -30,7 +30,6 @@ package com.sun.security.auth;
* and provides a mechanism to do same-process security impersonation.
*/
-@jdk.Exported
public class NTNumericCredential {
private long impersonationToken;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java
index a304eeb148d..602e817ea72 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSid.java
@@ -47,7 +47,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class NTSid implements Principal, java.io.Serializable {
private static final long serialVersionUID = 4412290580770249885L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java
index 0911f797efe..2b033bbbc66 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java
@@ -43,7 +43,6 @@ package com.sun.security.auth;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class NTSidDomainPrincipal extends NTSid {
private static final long serialVersionUID = 5247810785821650912L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java
index 9bdc87b9dc5..d63451e992a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java
@@ -40,7 +40,6 @@ package com.sun.security.auth;
* @see javax.security.auth.Subject
* @see com.sun.security.auth.NTSid
*/
-@jdk.Exported
public class NTSidGroupPrincipal extends NTSid {
private static final long serialVersionUID = -1373347438636198229L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java
index 1d33ee3909a..7a482a70c9a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java
@@ -39,7 +39,6 @@ package com.sun.security.auth;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class NTSidPrimaryGroupPrincipal extends NTSid {
private static final long serialVersionUID = 8011978367305190527L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java
index c95d82a4d0a..b2e583d816c 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTSidUserPrincipal.java
@@ -39,7 +39,6 @@ package com.sun.security.auth;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class NTSidUserPrincipal extends NTSid {
private static final long serialVersionUID = -5573239889517749525L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java
index 1005793f737..687682b56e1 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/NTUserPrincipal.java
@@ -41,7 +41,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class NTUserPrincipal implements Principal, java.io.Serializable {
private static final long serialVersionUID = -8737649811939033735L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java
index e61e821eca0..38a9709b5e1 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PolicyFile.java
@@ -215,7 +215,6 @@ import javax.security.auth.Subject;
* @see java.security.ProtectionDomain
* @see java.security.Security security properties
*/
-@jdk.Exported(false)
@Deprecated
public class PolicyFile extends javax.security.auth.Policy {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java
index bb0aab1f2f2..db90f097f1a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/PrincipalComparator.java
@@ -50,7 +50,6 @@ package com.sun.security.auth;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public interface PrincipalComparator {
/**
* Check if the specified {@code Subject} is implied by
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java
index 377e6165fcd..983e987cfc7 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java
@@ -45,7 +45,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported(false)
@Deprecated
public class SolarisNumericGroupPrincipal implements
Principal,
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java
index 5497856f28a..506852619bc 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java
@@ -44,7 +44,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported(false)
@Deprecated
public class SolarisNumericUserPrincipal implements
Principal,
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java
index 4aef765e813..3350e08e160 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/SolarisPrincipal.java
@@ -44,7 +44,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported(false)
@Deprecated
public class SolarisPrincipal implements Principal, java.io.Serializable {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java
index 4a96480db01..f71aa128c95 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java
@@ -41,7 +41,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class UnixNumericGroupPrincipal implements
Principal,
java.io.Serializable {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java
index cb252a8966e..e07cb8ad39f 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java
@@ -41,7 +41,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class UnixNumericUserPrincipal implements
Principal,
java.io.Serializable {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java
index 9694bc7a443..1215015330a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixPrincipal.java
@@ -41,7 +41,6 @@ import java.security.Principal;
* @see java.security.Principal
* @see javax.security.auth.Subject
*/
-@jdk.Exported
public class UnixPrincipal implements Principal, java.io.Serializable {
private static final long serialVersionUID = -2951667807323493631L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UserPrincipal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UserPrincipal.java
index f4e7555ab1a..04b133e4004 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UserPrincipal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/UserPrincipal.java
@@ -42,7 +42,6 @@ import java.security.Principal;
*
* @since 1.6
*/
-@jdk.Exported
public final class UserPrincipal implements Principal, java.io.Serializable {
private static final long serialVersionUID = 892106070870210969L;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java
index 52fdcf868c9..736309fdbea 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/X500Principal.java
@@ -49,7 +49,6 @@ import sun.security.x509.X500Name;
* class.
* @see javax.security.auth.x500.X500Principal
*/
-@jdk.Exported(false)
@Deprecated
public class X500Principal implements Principal, java.io.Serializable {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java
index 4d6f7b68ab1..9170f75bdd6 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java
@@ -46,7 +46,6 @@ import sun.security.util.ConsoleCallbackHandler;
* @see javax.security.auth.callback
*/
-@jdk.Exported
public class TextCallbackHandler implements CallbackHandler {
private final CallbackHandler consoleHandler;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/package-info.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/package-info.java
index 61d65688798..8786680ce4a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/package-info.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/callback/package-info.java
@@ -23,5 +23,4 @@
* questions.
*/
-@jdk.Exported
package com.sun.security.auth.callback;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/ConfigFile.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/ConfigFile.java
index 53058177ac2..3e6dc7da579 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/ConfigFile.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/ConfigFile.java
@@ -83,7 +83,6 @@ import java.net.URI;
* @see javax.security.auth.login.LoginContext
* @see java.security.Security security properties
*/
-@jdk.Exported
public class ConfigFile extends Configuration {
private final sun.security.provider.ConfigFile.Spi spi;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/package-info.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/package-info.java
index a0b207c5578..45a01ea28c3 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/package-info.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/login/package-info.java
@@ -23,5 +23,4 @@
* questions.
*/
-@jdk.Exported
package com.sun.security.auth.login;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java
index bc7a1a911cd..1642e435934 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/JndiLoginModule.java
@@ -151,7 +151,6 @@ import com.sun.security.auth.UnixNumericGroupPrincipal;
*
*
*/
-@jdk.Exported
public class JndiLoginModule implements LoginModule {
private static final ResourceBundle rb = AccessController.doPrivileged(
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java
index ece0d3f8afb..92ec5bcda57 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java
@@ -110,7 +110,6 @@ import sun.security.util.Password;
*
*
*/
-@jdk.Exported
public class KeyStoreLoginModule implements LoginModule {
private static final ResourceBundle rb = AccessController.doPrivileged(
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
index b4360c79d61..8f0943620f6 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/Krb5LoginModule.java
@@ -367,7 +367,6 @@ import sun.security.util.HexDumpEncoder;
* @author Ram Marti
*/
-@jdk.Exported
public class Krb5LoginModule implements LoginModule {
// initial state
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java
index 167530a4b79..7c2da1847a4 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/LdapLoginModule.java
@@ -303,7 +303,6 @@ import com.sun.security.auth.UserPrincipal;
*
* @since 1.6
*/
-@jdk.Exported
public class LdapLoginModule implements LoginModule {
// Use the default classloader for this class to load the prompt strings.
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java
index 98d1f1319d9..c251d54eb58 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTLoginModule.java
@@ -57,7 +57,6 @@ import com.sun.security.auth.NTNumericCredential;
*
* @see javax.security.auth.spi.LoginModule
*/
-@jdk.Exported
public class NTLoginModule implements LoginModule {
private NTSystem ntSystem;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java
index d15636955a6..9dbd69325fc 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/NTSystem.java
@@ -30,7 +30,6 @@ package com.sun.security.auth.module;
* security information for the current user.
*
*/
-@jdk.Exported
public class NTSystem {
private native void getCurrent(boolean debug);
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java
index 9b5adb0c3cf..f5666ff9b5e 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisLoginModule.java
@@ -52,7 +52,6 @@ import com.sun.security.auth.SolarisNumericGroupPrincipal;
* UnixLoginModule.
*
*/
-@jdk.Exported(false)
@Deprecated
public class SolarisLoginModule implements LoginModule {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java
index 98f6f4c70a0..ea4842aa10a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/SolarisSystem.java
@@ -31,7 +31,6 @@ package com.sun.security.auth.module;
*
* @deprecated replaced by {@link UnixSystem}.
*/
-@jdk.Exported(false)
@Deprecated
public class SolarisSystem {
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java
index 704b11dc33c..a2acf7a9742 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixLoginModule.java
@@ -47,7 +47,6 @@ import com.sun.security.auth.UnixNumericGroupPrincipal;
* debug messages will be output to the output stream, System.out.
*
*/
-@jdk.Exported
public class UnixLoginModule implements LoginModule {
// initial state
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java
index 43f93f78e82..46b1c946c51 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java
@@ -29,7 +29,6 @@ package com.sun.security.auth.module;
* This class implementation retrieves and makes available Unix
* UID/GID/groups information for the current user.
*/
-@jdk.Exported
public class UnixSystem {
private native void getUnixInfo();
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/package-info.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/package-info.java
index 21569670ffe..9056324f49a 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/package-info.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/module/package-info.java
@@ -23,5 +23,4 @@
* questions.
*/
-@jdk.Exported
package com.sun.security.auth.module;
diff --git a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/package-info.java b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/package-info.java
index 3fe7e206fa7..c0397bfd2f1 100644
--- a/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/package-info.java
+++ b/jdk/src/jdk.security.auth/share/classes/com/sun/security/auth/package-info.java
@@ -23,5 +23,4 @@
* questions.
*/
-@jdk.Exported
package com.sun.security.auth;
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java
index 5ec9e615ebb..eabaac94ad5 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java
@@ -28,7 +28,6 @@ package com.sun.security.jgss;
/**
* Kerberos 5 AuthorizationData entry.
*/
-@jdk.Exported
public final class AuthorizationDataEntry {
private final int type;
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSContext.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSContext.java
index 32e6b0412e2..3496a5f0c4c 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSContext.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSContext.java
@@ -34,7 +34,6 @@ import sun.security.krb5.internal.AuthorizationData;
* functionalities not defined by {@code org.ietf.jgss.GSSContext},
* such as querying context-specific attributes.
*/
-@jdk.Exported
public interface ExtendedGSSContext extends GSSContext {
// The impl is almost identical to GSSContextImpl with only 2 differences:
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java
index 56fe1030744..0e9582769d6 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java
@@ -33,7 +33,6 @@ import sun.security.jgss.GSSCredentialImpl;
* functionalities not defined by {@code org.ietf.jgss.GSSCredential}.
* @since 1.8
*/
-@jdk.Exported
public interface ExtendedGSSCredential extends GSSCredential {
static class ExtendedGSSCredentialImpl extends GSSCredentialImpl
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/GSSUtil.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/GSSUtil.java
index 2358c5829b7..e1f63c28ab5 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/GSSUtil.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/GSSUtil.java
@@ -33,7 +33,6 @@ import org.ietf.jgss.GSSCredential;
* GSS-API Utilities for using in conjunction with Sun Microsystem's
* implementation of Java GSS-API.
*/
-@jdk.Exported
public class GSSUtil {
/**
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java
index f8e850c0ee0..618d3c74752 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireSecContextPermission.java
@@ -35,7 +35,6 @@ import java.security.BasicPermission;
*
* The target name is the {@link InquireType} allowed.
*/
-@jdk.Exported
public final class InquireSecContextPermission extends BasicPermission {
private static final long serialVersionUID = -7131173349668647297L;
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java
index 09d407aca6f..5ba482dbd6e 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/InquireType.java
@@ -29,7 +29,6 @@ package com.sun.security.jgss;
* Attribute types that can be specified as an argument of
* {@link com.sun.security.jgss.ExtendedGSSContext#inquireSecContext}
*/
-@jdk.Exported
public enum InquireType {
/**
* Attribute type for retrieving the session key of an established
diff --git a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java
index b1c82d77387..5bd43c874a3 100644
--- a/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java
+++ b/jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/package-info.java
@@ -23,5 +23,4 @@
* questions.
*/
-@jdk.Exported
package com.sun.security.jgss;
diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt
index 2a18c6adef2..87f567f2e49 100644
--- a/jdk/test/ProblemList.txt
+++ b/jdk/test/ProblemList.txt
@@ -1,6 +1,6 @@
###########################################################################
#
-# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 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
@@ -299,6 +299,9 @@ sun/security/provider/SecureRandom/StrongSecureRandom.java macosx-10.10
# 8074580
sun/security/pkcs11/rsa/TestKeyPairGenerator.java generic-all
+# 8146387
+javax/net/ssl/SSLSession/SessionCacheSizeTests.java windows-all,solaris-all
+
############################################################################
# jdk_sound
diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups
index 15fdbbb67e3..769e9ab7f7e 100644
--- a/jdk/test/TEST.groups
+++ b/jdk/test/TEST.groups
@@ -1,4 +1,4 @@
-# Copyright (c) 2013, 2015, 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
@@ -31,8 +31,8 @@ tier1 = \
-java/util/zip/TestLocalTime.java \
:jdk_util \
-java/util/WeakHashMap/GCDuringIteration.java \
- -java/util/concurrent/Phaser/Basic.java \
-java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java
+ -java/util/concurrent/forkjoin/FJExceptionTableLeak.java
sun/nio/cs/ISO8859x.java \
java/nio/Buffer \
com/sun/crypto/provider/Cipher \
@@ -41,9 +41,9 @@ tier1 = \
tier2 = \
java/lang/ProcessHandle/TreeTest.java \
java/util/zip/TestLocalTime.java \
- java/util/concurrent/Phaser/Basic.java \
java/util/WeakHashMap/GCDuringIteration.java \
java/util/concurrent/ThreadPoolExecutor/ConfigChanges.java \
+ java/util/concurrent/forkjoin/FJExceptionTableLeak.java
:jdk_io \
:jdk_nio \
-sun/nio/cs/ISO8859x.java \
@@ -77,7 +77,6 @@ jdk_lang = \
sun/misc \
sun/reflect \
jdk/lambda \
- jdk/internal/jimage \
vm
# All of the java.util package
diff --git a/jdk/test/java/io/RandomAccessFile/FileLengthTest.java b/jdk/test/java/io/RandomAccessFile/FileLengthTest.java
new file mode 100644
index 00000000000..3f5bff1a46e
--- /dev/null
+++ b/jdk/test/java/io/RandomAccessFile/FileLengthTest.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE randomAccessFile that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 4823133
+ * @summary optimize RandomAccessFile.length() and length() is thread safe now.
+ */
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+
+/**
+ *
+ * @author vyom.tewari@oracle.com
+ */
+public class FileLengthTest {
+
+ private static final int BUF_SIZE = 4096;
+ private static RandomAccessFile randomAccessFile;
+ private static Thread fileLengthCaller;
+ private static Thread fileContentReader;
+ private static StringBuilder fileContents;
+ private static volatile boolean isFailed = false;
+
+ /**
+ * this thread will call length() in loop
+ */
+ private static void startLengthThread() {
+ if (randomAccessFile == null) {
+ return;
+ }
+ fileLengthCaller = new Thread(() -> {
+ while (true) {
+ try {
+ long length = randomAccessFile.length();
+ if (length < 0) {
+ return;
+ }
+ } catch (IOException ex) {
+ return;
+ }
+ }
+ });
+ fileLengthCaller.setName("RandomAccessFile-length-caller");
+ fileLengthCaller.setDaemon(true);
+ fileLengthCaller.start();
+ }
+
+ /**
+ * this thread will call read() and store the content in internal buffer.
+ */
+ private static void startReaderThread() {
+ if (randomAccessFile == null) {
+ return;
+ }
+ fileContentReader = new Thread(() -> {
+ StringBuilder sb = new StringBuilder(BUF_SIZE);
+ int i;
+ byte arr[] = new byte[8];
+ try {
+ while ((i = randomAccessFile.read(arr)) != -1) {
+ sb.append(new String(arr, 0, i));
+ }
+ if (!sb.toString().equals(fileContents.toString())) {
+ isFailed = true;
+ }
+ } catch (IOException ex) {
+ }
+ });
+ fileContentReader.setName("RandomAccessFile-content-reader");
+ fileContentReader.setDaemon(true);
+ fileContentReader.start();
+ }
+
+ public static void main(String args[]) {
+ byte arr[] = new byte[BUF_SIZE];
+ String testFile = "testfile.txt";
+ try {
+ createDummyFile(testFile);
+ File file = new File(testFile);
+ file.deleteOnExit();
+ randomAccessFile = new RandomAccessFile(file, "r");
+ int count = randomAccessFile.read(arr);
+ randomAccessFile.seek(0);
+ fileContents = new StringBuilder(BUF_SIZE);
+ fileContents.append(new String(arr, 0, count));
+ startLengthThread();
+ startReaderThread();
+ fileContentReader.join();
+ } catch (FileNotFoundException | InterruptedException ex) {
+ } catch (IOException ex) {
+ } finally {
+ try {
+ randomAccessFile.close();
+ } catch (IOException ex) {
+ }
+ }
+ if (isFailed) {
+ throw new RuntimeException("RandomAccessFile.length() changed the underlying file pointer.");
+ }
+ }
+
+ private static void createDummyFile(String fileName) throws FileNotFoundException, IOException {
+ try (FileOutputStream outputStream = new FileOutputStream(new File(fileName))) {
+ String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
+ int count = 0;
+ while ((count + str.length()) < BUF_SIZE) {
+ outputStream.write(str.getBytes());
+ count += str.length();
+ }
+ outputStream.flush();
+ }
+ }
+}
diff --git a/jdk/test/java/lang/ProcessHandle/Basic.java b/jdk/test/java/lang/ProcessHandle/Basic.java
index 3df63e945ee..dae37952c65 100644
--- a/jdk/test/java/lang/ProcessHandle/Basic.java
+++ b/jdk/test/java/lang/ProcessHandle/Basic.java
@@ -27,8 +27,8 @@ import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import java.io.IOException;
-import java.util.Optional;
import java.util.List;
+import java.util.Optional;
import java.util.stream.Collectors;
import org.testng.TestNG;
@@ -36,6 +36,8 @@ import org.testng.annotations.Test;
/*
* @test
+ * @library /test/lib/share/classes
+ * @run testng InfoTest
* @summary Basic tests for ProcessHandler
* @author Roger Riggs
*/
diff --git a/jdk/test/java/lang/ProcessHandle/InfoTest.java b/jdk/test/java/lang/ProcessHandle/InfoTest.java
index 38b1546acc0..bca423b67c3 100644
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java
@@ -21,11 +21,10 @@
* questions.
*/
-import java.io.File;
import java.io.BufferedReader;
+import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
-import java.lang.ProcessBuilder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -40,18 +39,18 @@ import java.util.Optional;
import java.util.Random;
import java.util.concurrent.TimeUnit;
-import jdk.testlibrary.Platform;
-import jdk.testlibrary.Utils;
-
+import jdk.test.lib.Platform;
+import jdk.test.lib.Utils;
import org.testng.Assert;
-import org.testng.annotations.Test;
import org.testng.TestNG;
+import org.testng.annotations.Test;
/*
* @test
* @bug 8077350 8081566 8081567 8098852 8136597
- * @build jdk.testlibrary.*
- * @library /lib/testlibrary
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @run testng InfoTest
* @summary Functions of ProcessHandle.Info
* @author Roger Riggs
* @key intermittent
diff --git a/jdk/test/java/lang/ProcessHandle/OnExitTest.java b/jdk/test/java/lang/ProcessHandle/OnExitTest.java
index 9c7a5193db6..3ec997db342 100644
--- a/jdk/test/java/lang/ProcessHandle/OnExitTest.java
+++ b/jdk/test/java/lang/ProcessHandle/OnExitTest.java
@@ -22,7 +22,6 @@
*/
import java.io.IOException;
-import java.lang.InterruptedException;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
@@ -31,7 +30,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
-import jdk.testlibrary.Utils;
+import jdk.test.lib.Utils;
import org.testng.annotations.Test;
import org.testng.Assert;
@@ -39,7 +38,9 @@ import org.testng.TestNG;
/*
* @test
- * @build jdk.testlibrary.Utils
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Platform jdk.test.lib.Utils
+ * @run testng OnExitTest
* @summary Functions of Process.onExit and ProcessHandle.onExit
* @author Roger Riggs
*/
diff --git a/jdk/test/java/lang/ProcessHandle/PermissionTest.java b/jdk/test/java/lang/ProcessHandle/PermissionTest.java
index 042b9d1e818..7d596c26959 100644
--- a/jdk/test/java/lang/ProcessHandle/PermissionTest.java
+++ b/jdk/test/java/lang/ProcessHandle/PermissionTest.java
@@ -31,7 +31,6 @@ import java.security.Policy;
import java.security.ProtectionDomain;
import java.security.SecurityPermission;
import java.util.Arrays;
-import java.util.Optional;
import java.util.PropertyPermission;
import org.testng.Assert;
@@ -39,6 +38,12 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Test;
+/*
+ * @test
+ * @run testng/othervm PermissionTest
+ * @summary Test Permissions to access Info
+ */
+
public class PermissionTest {
/**
* Backing up policy.
diff --git a/jdk/test/java/lang/ProcessHandle/ProcessUtil.java b/jdk/test/java/lang/ProcessHandle/ProcessUtil.java
index c0c6916f971..48654ea5f49 100644
--- a/jdk/test/java/lang/ProcessHandle/ProcessUtil.java
+++ b/jdk/test/java/lang/ProcessHandle/ProcessUtil.java
@@ -23,19 +23,14 @@
import java.io.IOException;
import java.lang.management.ManagementFactory;
-import java.lang.ProcessBuilder;
import java.time.Duration;
import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-import com.sun.management.OperatingSystemMXBean;
-
-import jdk.testlibrary.Platform;
-
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import com.sun.management.OperatingSystemMXBean;
+import jdk.test.lib.Platform;
+
/**
* Useful utilities for testing Process and ProcessHandle.
*/
diff --git a/jdk/test/java/lang/ProcessHandle/TEST.properties b/jdk/test/java/lang/ProcessHandle/TEST.properties
deleted file mode 100644
index ca156321e8a..00000000000
--- a/jdk/test/java/lang/ProcessHandle/TEST.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-# ProcessHandle tests use TestNG
-TestNG.dirs = .
-lib.dirs = /lib/testlibrary
-modules = jdk.management
diff --git a/jdk/test/java/lang/ProcessHandle/TreeTest.java b/jdk/test/java/lang/ProcessHandle/TreeTest.java
index 45acc6fc205..85b752a6602 100644
--- a/jdk/test/java/lang/ProcessHandle/TreeTest.java
+++ b/jdk/test/java/lang/ProcessHandle/TreeTest.java
@@ -23,30 +23,31 @@
import java.io.IOException;
-import java.util.ArrayList;
import java.time.Duration;
import java.time.Instant;
+import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import java.util.concurrent.ExecutionException;
-import jdk.testlibrary.Utils;
+
+import jdk.test.lib.Utils;
import org.testng.Assert;
import org.testng.TestNG;
import org.testng.annotations.Test;
/*
* @test
- * @library /lib/testlibrary
- * Test counting and JavaChild.spawning and counting of Processes.
- * @run testng/othervm InfoTest
+ * @library /test/lib/share/classes
+ * @build jdk.test.lib.Utils
+ * @run testng/othervm TreeTest
+ * @summary Test counting and JavaChild.spawning and counting of Processes.
* @key intermittent
* @author Roger Riggs
*/
diff --git a/jdk/test/java/lang/StackWalker/LocalsAndOperands.java b/jdk/test/java/lang/StackWalker/LocalsAndOperands.java
index a296c788259..63a6731a164 100644
--- a/jdk/test/java/lang/StackWalker/LocalsAndOperands.java
+++ b/jdk/test/java/lang/StackWalker/LocalsAndOperands.java
@@ -86,29 +86,43 @@ public class LocalsAndOperands {
System.out.println("frame: " + f);
Object[] locals = (Object[]) getLocals.invoke(f);
for (int i = 0; i < locals.length; i++) {
- System.out.format("local %d: %s type %s%n", i, locals[i], type(locals[i]));
+ System.out.format(" local %d: %s type %s\n", i, locals[i], type(locals[i]));
+
+ // check for non-null locals in LocalsAndOperands.test()
+ if (f.getClassName().equals("LocalsAndOperands") &&
+ f.getMethodName().equals("test")) {
+ if (locals[i] == null) {
+ throw new RuntimeException("kept-alive locals should not be null");
+ }
+ }
}
Object[] operands = (Object[]) getOperands.invoke(f);
for (int i = 0; i < operands.length; i++) {
- System.out.format("operand %d: %s type %s%n", i, operands[i], type(operands[i]));
+ System.out.format(" operand %d: %s type %s%n", i, operands[i],
+ type(operands[i]));
}
Object[] monitors = (Object[]) getMonitors.invoke(f);
for (int i = 0; i < monitors.length; i++) {
- System.out.format("monitor %d: %s%n", i, monitors[i]);
+ System.out.format(" monitor %d: %s%n", i, monitors[i]);
}
}
} else {
for (StackFrame f : frames) {
- if (liveStackFrameClass.isInstance(f))
+ if (liveStackFrameClass.isInstance(f)) {
throw new RuntimeException("should not be LiveStackFrame");
+ }
}
}
+ // Use local variables so they stay alive
+ System.out.println("Stayin' alive: "+x+" "+c+" "+hi+" "+l+" "+d);
}
String type(Object o) throws Exception {
- if (primitiveValueClass.isInstance(o)) {
+ if (o == null) {
+ return "null";
+ } else if (primitiveValueClass.isInstance(o)) {
char c = (char)primitiveType.invoke(o);
return String.valueOf(c);
} else {
diff --git a/jdk/src/java.base/share/classes/sun/misc/JarFilter.java b/jdk/test/java/lang/invoke/8076596/Test8076596.java
similarity index 61%
rename from jdk/src/java.base/share/classes/sun/misc/JarFilter.java
rename to jdk/test/java/lang/invoke/8076596/Test8076596.java
index 9036ecaed87..7d3cde0f869 100644
--- a/jdk/src/java.base/share/classes/sun/misc/JarFilter.java
+++ b/jdk/test/java/lang/invoke/8076596/Test8076596.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2006, 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,23 +23,28 @@
* questions.
*/
-package sun.misc;
-
-import java.io.File;
-import java.io.FilenameFilter;
-
-/**
- * This class checks that only jar and zip files are included in the file list.
- * This class is used in extension installation support (ExtensionDependency).
- *
- * @deprecated this class will be removed in a future release.
- * @author Michael Colburn
+/* @test
+ * @bug 8076596
+ * @run main/othervm/policy=Test8076596.security.policy/secure=Test8076596 -ea -esa Test8076596
*/
-@Deprecated
-public class JarFilter implements FilenameFilter {
- public boolean accept(File dir, String name) {
- String lower = name.toLowerCase();
- return lower.endsWith(".jar") || lower.endsWith(".zip");
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+public class Test8076596 extends SecurityManager {
+ public Test8076596() {
+ // 1. Using lambda
+ AccessController.doPrivileged((PrivilegedAction) () -> null);
+ // 2. Using inner class
+ AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Void run() {
+ return null;
+ }
+ });
+ }
+
+ public static void main(String[] args) {
+ // empty
}
}
diff --git a/jdk/test/java/lang/invoke/8076596/Test8076596.security.policy b/jdk/test/java/lang/invoke/8076596/Test8076596.security.policy
new file mode 100644
index 00000000000..a7cd67a94c5
--- /dev/null
+++ b/jdk/test/java/lang/invoke/8076596/Test8076596.security.policy
@@ -0,0 +1,8 @@
+/*
+ * Security policy used by the Test8076596.
+ * Must allow file reads so that jtreg itself can run.
+ */
+
+grant {
+ permission java.io.FilePermission "*", "read";
+};
diff --git a/jdk/test/java/lang/invoke/8147078/Test8147078.java b/jdk/test/java/lang/invoke/8147078/Test8147078.java
new file mode 100644
index 00000000000..6814b2ff73a
--- /dev/null
+++ b/jdk/test/java/lang/invoke/8147078/Test8147078.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8147078
+ * @run testng/othervm -ea -esa Test8147078
+ */
+
+import org.testng.annotations.Test;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+
+import static java.lang.invoke.MethodType.methodType;
+
+import static org.testng.AssertJUnit.*;
+
+public class Test8147078 {
+
+ static int target(int x) {
+ throw new RuntimeException("ieps");
+ }
+
+ static int handler(String s, int x) {
+ return 4*x;
+ }
+
+ static final MethodHandle MH_target;
+ static final MethodHandle MH_handler;
+ static final MethodHandle MH_catchException;
+
+ static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
+
+ static {
+ try {
+ Class C = Test8147078.class;
+ MH_target = LOOKUP.findStatic(C, "target", methodType(int.class, int.class));
+ MH_handler = LOOKUP.findStatic(C, "handler", methodType(int.class, String.class, int.class));
+ MH_catchException = LOOKUP.findStatic(MethodHandles.class, "catchException",
+ methodType(MethodHandle.class, MethodHandle.class, Class.class, MethodHandle.class));
+ } catch (Exception e) {
+ throw new ExceptionInInitializerError(e);
+ }
+ }
+
+ @Test
+ public void testNoExceptionType() {
+ boolean caught = false;
+ try {
+ MethodHandle eek = (MethodHandle) MH_catchException.invoke(MH_target, String.class, MH_handler);
+ } catch (ClassCastException cce) {
+ assertEquals("java.lang.String", cce.getMessage());
+ caught = true;
+ } catch (Throwable t) {
+ fail("unexpected exception caught: " + t);
+ }
+ assertTrue(caught);
+ }
+
+}
\ No newline at end of file
diff --git a/jdk/test/java/lang/invoke/FindClassSecurityManager.java b/jdk/test/java/lang/invoke/FindClassSecurityManager.java
index b877e885364..026c8ba5cbf 100644
--- a/jdk/test/java/lang/invoke/FindClassSecurityManager.java
+++ b/jdk/test/java/lang/invoke/FindClassSecurityManager.java
@@ -24,6 +24,7 @@
*/
/* @test
+ * @bug 8139885
* @run main/othervm/policy=findclass.security.policy/secure=java.lang.SecurityManager -ea -esa test.java.lang.invoke.FindClassSecurityManager
*/
diff --git a/jdk/test/java/lang/invoke/T8139885.java b/jdk/test/java/lang/invoke/T8139885.java
index fb6ba77301b..d9bcb6b3a61 100644
--- a/jdk/test/java/lang/invoke/T8139885.java
+++ b/jdk/test/java/lang/invoke/T8139885.java
@@ -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
@@ -24,6 +24,8 @@
*/
/* @test
+ * @bug 8139885
+ * @bug 8143798
* @run testng/othervm -ea -esa test.java.lang.invoke.T8139885
*/
diff --git a/jdk/test/java/lang/management/MemoryMXBean/Pending.java b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
index 728ff15a5b9..156708249d5 100644
--- a/jdk/test/java/lang/management/MemoryMXBean/Pending.java
+++ b/jdk/test/java/lang/management/MemoryMXBean/Pending.java
@@ -24,7 +24,7 @@
/*
* @test
* @bug 4530538
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
* java.management
* @summary Basic unit test of
* RuntimeMXBean.getObjectPendingFinalizationCount()
@@ -50,10 +50,10 @@ public class Pending {
private static void printFinalizerInstanceCount() {
if (!trace) return;
- int count = sun.misc.VM.getFinalRefCount();
+ int count = jdk.internal.misc.VM.getFinalRefCount();
System.out.println(INDENT + "Finalizable object Count = " + count);
- count = sun.misc.VM.getPeakFinalRefCount();
+ count = jdk.internal.misc.VM.getPeakFinalRefCount();
System.out.println(INDENT + "Peak Finalizable object Count = " + count);
}
diff --git a/jdk/test/java/lang/ref/CleanerTest.java b/jdk/test/java/lang/ref/CleanerTest.java
index deaadbdc2f2..fedcaf88713 100644
--- a/jdk/test/java/lang/ref/CleanerTest.java
+++ b/jdk/test/java/lang/ref/CleanerTest.java
@@ -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,9 +34,10 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import java.util.function.Supplier;
-import jdk.internal.misc.CleanerImpl.PhantomCleanable;
-import jdk.internal.misc.CleanerImpl.WeakCleanable;
-import jdk.internal.misc.CleanerImpl.SoftCleanable;
+import jdk.internal.ref.PhantomCleanable;
+import jdk.internal.ref.WeakCleanable;
+import jdk.internal.ref.SoftCleanable;
+import jdk.internal.ref.CleanerFactory;
import sun.hotspot.WhiteBox;
@@ -48,17 +49,17 @@ import org.testng.annotations.Test;
* @test
* @library /lib/testlibrary /test/lib
* @build sun.hotspot.WhiteBox
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.misc java.base/jdk.internal.ref
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run testng/othervm
* -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:.
- * -verbose:gc -Xmx4m CleanerTest
+ * -verbose:gc CleanerTest
*/
@Test
public class CleanerTest {
// A common CleaningService used by the test for notifications
- static final Cleaner COMMON = Cleaner.create();
+ static final Cleaner COMMON = CleanerFactory.cleaner();
// Access to WhiteBox utilities
static final WhiteBox whitebox = WhiteBox.getWhiteBox();
@@ -702,4 +703,17 @@ public class CleanerTest {
cleaner = null;
}
+ /**
+ * Test the Cleaner from the CleanerFactory.
+ */
+ @Test
+ void testCleanerFactory() {
+ Cleaner cleaner = CleanerFactory.cleaner();
+
+ Object obj = new Object();
+ CleanableCase s = setupPhantom(cleaner, obj);
+ obj = null;
+ Assert.assertTrue(checkCleaned(s.getSemaphore()),
+ "Object cleaning should have occurred using CleanerFactor.cleaner()");
+ }
}
diff --git a/jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java b/jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java
index 0f7b008d472..df4d9b0b5e7 100644
--- a/jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java
+++ b/jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 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
@@ -41,7 +41,11 @@ public class ADatagramSocket {
} catch (Exception ex) {
throw new RuntimeException("Setting DatagramSocketImplFactory failed!");
}
- new QuoteServerThread().start();
+
+ QuoteServerThread server = new QuoteServerThread();
+ int port = server.getPort();
+ System.out.println("Server port is " + port);
+ server.start();
// get a datagram socket
DatagramSocket socket = new DatagramSocket();
@@ -49,7 +53,7 @@ public class ADatagramSocket {
// send request
byte[] buf = new byte[256];
InetAddress address = InetAddress.getLocalHost();
- DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 4445);
+ DatagramPacket packet = new DatagramPacket(buf, buf.length, address, port);
socket.send(packet);
// get response
@@ -67,6 +71,7 @@ public class ADatagramSocket {
class QuoteServerThread extends Thread {
protected DatagramSocket socket = null;
+ private final int port;
public QuoteServerThread() throws IOException {
this("QuoteServerThread");
@@ -74,7 +79,11 @@ class QuoteServerThread extends Thread {
public QuoteServerThread(String name) throws IOException {
super(name);
- socket = new DatagramSocket(4445);
+ socket = new DatagramSocket(0);
+ port = socket.getLocalPort();
+ }
+ public int getPort(){
+ return port;
}
public void run() {
@@ -101,3 +110,4 @@ class QuoteServerThread extends Thread {
socket.close();
}
}
+
diff --git a/jdk/test/java/net/SocketOption/OptionsTest.java b/jdk/test/java/net/SocketOption/OptionsTest.java
index 5493c2cae6e..947d784aa9d 100644
--- a/jdk/test/java/net/SocketOption/OptionsTest.java
+++ b/jdk/test/java/net/SocketOption/OptionsTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 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
@@ -80,8 +80,11 @@ public class OptionsTest {
static NetworkInterface getNetworkInterface() {
try {
Enumeration nifs = NetworkInterface.getNetworkInterfaces();
- if (nifs.hasMoreElements()) {
- return (NetworkInterface)nifs.nextElement();
+ while (nifs.hasMoreElements()) {
+ NetworkInterface ni = (NetworkInterface)nifs.nextElement();
+ if (ni.supportsMulticast()) {
+ return ni;
+ }
}
} catch (Exception e) {
}
diff --git a/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java b/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java
new file mode 100644
index 00000000000..074f7644b9d
--- /dev/null
+++ b/jdk/test/java/net/SocketOption/UnsupportedOptionsTest.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.net.ExtendedSocketOptions;
+
+import java.io.IOException;
+import java.net.*;
+
+/*
+ * @test
+ * @bug 8143554
+ * @run main UnsupportedOptionsTest
+ * @summary Test checks that UnsupportedOperationException for unsupported
+ * SOCKET_OPTIONS is thrown by both getOption() and setOption() methods.
+ */
+public class UnsupportedOptionsTest {
+
+ private static final SocketOption[] SOCKET_OPTIONS = {
+ StandardSocketOptions.IP_MULTICAST_IF,
+ StandardSocketOptions.IP_MULTICAST_LOOP,
+ StandardSocketOptions.IP_MULTICAST_TTL,
+ StandardSocketOptions.IP_TOS,
+ StandardSocketOptions.SO_BROADCAST,
+ StandardSocketOptions.SO_KEEPALIVE,
+ StandardSocketOptions.SO_LINGER,
+ StandardSocketOptions.SO_RCVBUF,
+ StandardSocketOptions.SO_REUSEADDR,
+ StandardSocketOptions.SO_SNDBUF,
+ StandardSocketOptions.TCP_NODELAY,
+ ExtendedSocketOptions.SO_FLOW_SLA
+ };
+
+ public static void main(String[] args) throws IOException {
+ Socket s = new Socket();
+ ServerSocket ss = new ServerSocket();
+ DatagramSocket ds = new DatagramSocket();
+ MulticastSocket ms = new MulticastSocket();
+
+ for (SocketOption option : SOCKET_OPTIONS) {
+ if (!s.supportedOptions().contains(option)) {
+ testUnsupportedSocketOption(s, option);
+ }
+
+ if (!ss.supportedOptions().contains(option)) {
+ testUnsupportedSocketOption(ss, option);
+ }
+
+ if (!ms.supportedOptions().contains(option)) {
+ testUnsupportedSocketOption(ms, option);
+ }
+
+ if (!ds.supportedOptions().contains(option)) {
+ testUnsupportedSocketOption(ds, option);
+ }
+ }
+ }
+
+ /*
+ * Check that UnsupportedOperationException for unsupported option is
+ * thrown from both getOption() and setOption() methods.
+ */
+ private static void testUnsupportedSocketOption(Object socket,
+ SocketOption option) {
+ testSet(socket, option);
+ testGet(socket, option);
+ }
+
+ private static void testSet(Object socket, SocketOption option) {
+ try {
+ setOption(socket, option);
+ } catch (UnsupportedOperationException e) {
+ System.out.println("UnsupportedOperationException was throw " +
+ "as expected. Socket: " + socket + " Option: " + option);
+ return;
+ } catch (Exception e) {
+ throw new RuntimeException("FAIL. Unexpected exception.", e);
+ }
+ throw new RuntimeException("FAIL. UnsupportedOperationException " +
+ "hasn't been thrown. Socket: " + socket + " Option: " + option);
+ }
+
+ private static void testGet(Object socket, SocketOption option) {
+ try {
+ getOption(socket, option);
+ } catch (UnsupportedOperationException e) {
+ System.out.println("UnsupportedOperationException was throw " +
+ "as expected. Socket: " + socket + " Option: " + option);
+ return;
+ } catch (Exception e) {
+ throw new RuntimeException("FAIL. Unexpected exception.", e);
+ }
+ throw new RuntimeException("FAIL. UnsupportedOperationException " +
+ "hasn't been thrown. Socket: " + socket + " Option: " + option);
+ }
+
+ private static void getOption(Object socket,
+ SocketOption option) throws IOException {
+ if (socket instanceof Socket) {
+ ((Socket) socket).getOption(option);
+ } else if (socket instanceof ServerSocket) {
+ ((ServerSocket) socket).getOption(option);
+ } else if (socket instanceof DatagramSocket) {
+ ((DatagramSocket) socket).getOption(option);
+ } else {
+ throw new RuntimeException("Unsupported socket type");
+ }
+ }
+
+ private static void setOption(Object socket,
+ SocketOption option) throws IOException {
+ if (socket instanceof Socket) {
+ ((Socket) socket).setOption(option, null);
+ } else if (socket instanceof ServerSocket) {
+ ((ServerSocket) socket).setOption(option, null);
+ } else if (socket instanceof DatagramSocket) {
+ ((DatagramSocket) socket).setOption(option, null);
+ } else {
+ throw new RuntimeException("Unsupported socket type");
+ }
+ }
+}
diff --git a/jdk/test/java/net/URLConnection/TIFFContentGuesser.java b/jdk/test/java/net/URLConnection/TIFFContentGuesser.java
new file mode 100644
index 00000000000..c996b7a7a63
--- /dev/null
+++ b/jdk/test/java/net/URLConnection/TIFFContentGuesser.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8146041
+ * @summary java.net.URLConnection.guessContentTypeFromStream() does not
+ * recognize TIFF streams
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.net.URLConnection;
+
+public class TIFFContentGuesser {
+ private static final byte[] LITTLE_ENDIAN_MAGIC =
+ new byte[] {(byte)0x49, (byte)0x49, (byte)0x2a, (byte)0};
+ private static final byte[] BIG_ENDIAN_MAGIC =
+ new byte[] {(byte)0x4d, (byte)0x4d, (byte)0, (byte)0x2a};
+
+ private static final String TIFF_MIME_TYPE = "image/tiff";
+
+ public static void main(String[] args) throws Throwable {
+ int failures = 0;
+
+ InputStream stream = new ByteArrayInputStream(LITTLE_ENDIAN_MAGIC);
+ String contentType = URLConnection.guessContentTypeFromStream(stream);
+ if (contentType == null || !contentType.equals(TIFF_MIME_TYPE)) {
+ failures++;
+ System.err.println("Test failed for little endian magic");
+ }
+
+ stream = new ByteArrayInputStream(BIG_ENDIAN_MAGIC);
+ contentType = URLConnection.guessContentTypeFromStream(stream);
+ if (contentType == null || !contentType.equals(TIFF_MIME_TYPE)) {
+ failures++;
+ System.err.println("Test failed for big endian magic");
+ }
+
+ if (failures != 0) {
+ throw new RuntimeException
+ ("Test failed with " + failures + " error(s)");
+ }
+ }
+}
+
diff --git a/jdk/test/java/net/ipv6tests/TcpTest.java b/jdk/test/java/net/ipv6tests/TcpTest.java
index 5f72553da82..63008acddba 100644
--- a/jdk/test/java/net/ipv6tests/TcpTest.java
+++ b/jdk/test/java/net/ipv6tests/TcpTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, 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
@@ -60,8 +60,7 @@ public class TcpTest extends Tests {
dprintln ("Local Addresses");
dprintln (ia4addr.toString());
dprintln (ia6addr.toString());
- test1 (0);
- test1 (5100);
+ test1();
test2();
test3();
test4();
@@ -69,11 +68,9 @@ public class TcpTest extends Tests {
/* basic TCP connectivity test using IPv6 only and IPv4/IPv6 together */
- static void test1 (int port) throws Exception {
- server = new ServerSocket (port);
- if (port == 0) {
- port = server.getLocalPort();
- }
+ static void test1 () throws Exception {
+ server = new ServerSocket (0);
+ int port = server.getLocalPort();
// try Ipv6 only
c1 = new Socket ("::1", port);
s1 = server.accept ();
@@ -107,9 +104,7 @@ public class TcpTest extends Tests {
/** bind tests:
* 1. bind to specific address IPv4 only (any port)
* 2. bind to specific address IPv6 only (any port)
- * 3. bind to specific address IPv4 only (specific port)
- * 4. bind to specific address IPv4 only (specific port)
- * 5. bind to any address IPv4 (test collision)
+ * 3. bind to any address IPv4 (test collision)
*/
static void test2 () throws Exception {
@@ -147,39 +142,6 @@ public class TcpTest extends Tests {
server.close ();
c1.close ();
- /* now try IPv6 specific port only */
-
- server = new ServerSocket ();
- sadr = new InetSocketAddress (ia6addr, 5200);
- server.bind (sadr);
- port = server.getLocalPort();
- t_assert (port == 5200);
-
- c1 = new Socket (ia6addr, port);
- try {
- c2 = new Socket (ia4addr, port);
- throw new RuntimeException ("connect to IPv4 address should be refused");
- } catch (IOException e) { }
- server.close ();
- c1.close ();
-
- /* now try IPv4 specific port only */
-
- server = new ServerSocket ();
- sadr = new InetSocketAddress (ia4addr, 5200);
- server.bind (sadr);
- port = server.getLocalPort();
- t_assert (port == 5200);
-
- c1 = new Socket (ia4addr, port);
-
- try {
- c2 = new Socket (ia6addr, port);
- throw new RuntimeException ("connect to IPv6 address should be refused");
- } catch (IOException e) { }
- server.accept().close();
- c1.close ();
- server.close();
System.out.println ("Test2: OK");
}
@@ -242,3 +204,4 @@ public class TcpTest extends Tests {
System.out.println ("Test4: OK");
}
}
+
diff --git a/jdk/test/java/nio/channels/DatagramChannel/StressNativeSignal.java b/jdk/test/java/nio/channels/DatagramChannel/StressNativeSignal.java
new file mode 100644
index 00000000000..b21d68ab1a9
--- /dev/null
+++ b/jdk/test/java/nio/channels/DatagramChannel/StressNativeSignal.java
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8050499
+ * @summary Attempt to provoke error 316 on OS X in NativeSignal.signal()
+ */
+
+import java.io.*;
+import java.net.*;
+import java.nio.ByteBuffer;
+import java.nio.channels.DatagramChannel;
+
+public class StressNativeSignal {
+ private UDPThread udpThread;
+ private ServerSocketThread serverSocketThread;
+
+ StressNativeSignal() {
+ try {
+ serverSocketThread = new ServerSocketThread();
+ serverSocketThread.start();
+
+ udpThread = new UDPThread();
+ udpThread.start();
+ } catch (Exception z) {
+ z.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args) throws Throwable {
+ StressNativeSignal test = new StressNativeSignal();
+ try {
+ Thread.sleep(3000);
+ } catch (Exception z) {
+ z.printStackTrace(System.err);
+ }
+
+ test.shutdown();
+ }
+
+ public void shutdown() {
+ udpThread.terminate();
+ try {
+ udpThread.join();
+ } catch (Exception z) {
+ z.printStackTrace(System.err);
+ }
+
+ serverSocketThread.terminate();
+ try {
+ serverSocketThread.join();
+ } catch (Exception z) {
+ z.printStackTrace(System.err);
+ }
+ }
+
+ public class ServerSocketThread extends Thread {
+ private volatile boolean shouldTerminate;
+ private ServerSocket socket;
+
+ public void run() {
+ try {
+ socket = new ServerSocket(1122);
+ Socket client = socket.accept();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
+ shouldTerminate = false;
+ while (!shouldTerminate) {
+ String msg = reader.readLine();
+ }
+ } catch (Exception z) {
+ if (!shouldTerminate) {
+ z.printStackTrace(System.err);
+ }
+ }
+ }
+
+ public void terminate() {
+ shouldTerminate = true;
+ try {
+ socket.close();
+ } catch (Exception z) {
+ z.printStackTrace(System.err);
+ // ignore
+ }
+ }
+ }
+
+ public class UDPThread extends Thread {
+ private DatagramChannel channel;
+ private volatile boolean shouldTerminate;
+
+ @Override
+ public void run() {
+ try {
+ channel = DatagramChannel.open();
+ channel.setOption(StandardSocketOptions.SO_RCVBUF, 6553600);
+ channel.bind(new InetSocketAddress(19870));
+ } catch (IOException z) {
+ z.printStackTrace(System.err);
+ }
+
+ ByteBuffer buf = ByteBuffer.allocate(6553600);
+ shouldTerminate = false;
+ while (!shouldTerminate) {
+ try {
+ buf.rewind();
+ channel.receive(buf);
+ } catch (IOException z) {
+ if (!shouldTerminate) {
+ z.printStackTrace(System.err);
+ }
+ }
+ }
+ }
+
+ public void terminate() {
+ shouldTerminate = true;
+ try {
+ channel.close();
+ } catch (Exception z) {
+ z.printStackTrace(System.err);
+ // ignore
+ }
+ }
+ }
+
+}
diff --git a/jdk/test/java/nio/channels/ServerSocketChannel/Basic.java b/jdk/test/java/nio/channels/ServerSocketChannel/Basic.java
index be30778759f..d821d28a89d 100644
--- a/jdk/test/java/nio/channels/ServerSocketChannel/Basic.java
+++ b/jdk/test/java/nio/channels/ServerSocketChannel/Basic.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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,6 +22,7 @@
*/
/* @test
+ * @bug 4286936 8143100
* @summary Unit test for server-socket channels
* @library ..
*/
@@ -130,7 +131,7 @@ public class Basic {
Client client = new Client(port, block);
server.start();
client.start();
- if ((server.finish(2000) & client.finish(100)) == 0)
+ if ((server.finish(0) & client.finish(0)) == 0)
throw new Exception("Failure");
log.println();
}
diff --git a/jdk/test/java/nio/channels/ServerSocketChannel/NonBlockingAccept.java b/jdk/test/java/nio/channels/ServerSocketChannel/NonBlockingAccept.java
index 1b985e8c68a..a210402903a 100644
--- a/jdk/test/java/nio/channels/ServerSocketChannel/NonBlockingAccept.java
+++ b/jdk/test/java/nio/channels/ServerSocketChannel/NonBlockingAccept.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, 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,7 +22,7 @@
*/
/* @test
- * @bug 4801882 5046333
+ * @bug 4801882 5046333 8141595
* @summary test ServerSocketAdaptor.accept on nonblocking channel
* @library ..
* @build TestUtil
@@ -57,8 +57,17 @@ public class NonBlockingAccept {
SocketChannel sc = SocketChannel.open();
sc.configureBlocking(false);
sc.connect(isa);
- Thread.sleep(100);
- ss.accept();
+
+ // loop until accepted
+ while (true) {
+ try {
+ ss.accept();
+ break;
+ } catch (IllegalBlockingModeException ex) {
+ System.out.println(ex + ", sleeping ...");
+ Thread.sleep(100);
+ }
+ }
}
diff --git a/jdk/test/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java b/jdk/test/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java
index caa712ebb2a..76415804693 100644
--- a/jdk/test/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java
+++ b/jdk/test/java/nio/file/attribute/BasicFileAttributeView/UnixSocketFile.java
@@ -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,7 @@
*/
import java.io.File;
+import java.io.InputStream;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
@@ -49,6 +50,17 @@ public class UnixSocketFile {
public static void main(String[] args)
throws InterruptedException, IOException {
+ // Use 'which' to verify that 'nc' is available and skip the test
+ // if it is not.
+ Process proc = Runtime.getRuntime().exec("which nc");
+ InputStream stdout = proc.getInputStream();
+ int b = stdout.read();
+ proc.destroy();
+ if (b == -1) {
+ System.err.println("Netcat command unavailable; skipping test.");
+ return;
+ }
+
// Create a new sub-directory of the nominal test directory in which
// 'nc' will create the socket file.
String testSubDir = System.getProperty("test.dir", ".")
@@ -62,7 +74,6 @@ public class UnixSocketFile {
// Create a process which executes the nc (netcat) utility to create
// a socket file at the indicated location.
- Process proc;
FileSystem fs = FileSystems.getDefault();
try (WatchService ws = fs.newWatchService()) {
// Watch the test sub-directory to receive notification when an
diff --git a/jdk/test/java/sql/testng/test/sql/StatementTests.java b/jdk/test/java/sql/testng/test/sql/StatementTests.java
index 169b7342d04..88697b77f9d 100644
--- a/jdk/test/java/sql/testng/test/sql/StatementTests.java
+++ b/jdk/test/java/sql/testng/test/sql/StatementTests.java
@@ -65,7 +65,7 @@ public class StatementTests extends BaseTest {
* enquoteLiteral is null
*/
@Test(expectedExceptions = NullPointerException.class)
- public void test01() throws SQLException {
+ public void test01() throws SQLException {
stmt.enquoteLiteral(null);
}
@@ -110,7 +110,7 @@ public class StatementTests extends BaseTest {
}
/*
- * Validate a NullPointerException is thrown is the string passed to
+ * Validate a NullPointerException is thrown if the string passed to
* isSimpleIdentifier is null
*/
@Test(expectedExceptions = NullPointerException.class)
@@ -119,6 +119,24 @@ public class StatementTests extends BaseTest {
}
+ /*
+ * Verify that enquoteLiteral creates a valid literal and converts every
+ * single quote to two single quotes
+ */
+ @Test(dataProvider = "validEnquotedNCharLiteralValues")
+ public void test07(String s, String expected) throws SQLException {
+ assertEquals(stmt.enquoteNCharLiteral(s), expected);
+ }
+
+ /*
+ * Validate a NullPointerException is thrown if the string passed to
+ * enquoteNCharLiteral is null
+ */
+ @Test(expectedExceptions = NullPointerException.class)
+ public void test08() throws SQLException {
+ stmt.enquoteNCharLiteral(null);
+ }
+
/*
* DataProvider used to provide strings that will be used to validate
* that enquoteLiteral converts a string to a literal and every instance of
@@ -169,8 +187,7 @@ public class StatementTests extends BaseTest {
{"\"Hel\"lo\"", true},
{"Hello" + '\0', false},
{"", false},
- {maxIdentifier + 'a', false},
- };
+ {maxIdentifier + 'a', false},};
}
/*
@@ -194,4 +211,22 @@ public class StatementTests extends BaseTest {
{"", false},};
}
+ /*
+ * DataProvider used to provide strings that will be used to validate
+ * that enquoteNCharLiteral converts a string to a National Character
+ * literal and every instance of
+ * a single quote will be converted into two single quotes in the literal.
+ */
+ @DataProvider(name = "validEnquotedNCharLiteralValues")
+ protected Object[][] validEnquotedNCharLiteralValues() {
+ return new Object[][]{
+ {"Hello", "N'Hello'"},
+ {"G'Day", "N'G''Day'"},
+ {"'G''Day'", "N'''G''''Day'''"},
+ {"I'''M", "N'I''''''M'"},
+ {"N'Hello'", "N'N''Hello'''"},
+ {"The Dark Knight", "N'The Dark Knight'"}
+
+ };
+ }
}
diff --git a/jdk/test/java/time/tck/java/time/TCKDuration.java b/jdk/test/java/time/tck/java/time/TCKDuration.java
index 1ef1302c6ff..40eefd0603c 100644
--- a/jdk/test/java/time/tck/java/time/TCKDuration.java
+++ b/jdk/test/java/time/tck/java/time/TCKDuration.java
@@ -2893,6 +2893,9 @@ public class TCKDuration extends AbstractTCKTest {
{-1, 0, "PT-1S"},
{-1, 1000, "PT-0.999999S"},
{-1, 900000000, "PT-0.1S"},
+ {-60, 100_000_000, "PT-59.9S"},
+ {-59, -900_000_000, "PT-59.9S"},
+ {-60, -100_000_000, "PT-1M-0.1S"},
{Long.MAX_VALUE, 0, "PT" + (Long.MAX_VALUE / 3600) + "H" +
((Long.MAX_VALUE % 3600) / 60) + "M" + (Long.MAX_VALUE % 60) + "S"},
{Long.MIN_VALUE, 0, "PT" + (Long.MIN_VALUE / 3600) + "H" +
diff --git a/jdk/test/java/time/tck/java/time/TCKLocalDate.java b/jdk/test/java/time/tck/java/time/TCKLocalDate.java
index afe7ddcdb58..96290401c97 100644
--- a/jdk/test/java/time/tck/java/time/TCKLocalDate.java
+++ b/jdk/test/java/time/tck/java/time/TCKLocalDate.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -1285,13 +1285,37 @@ public class TCKLocalDate extends AbstractDateTimeTest {
public void test_plusWeeks_invalidMaxMinusMin() {
LocalDate.of(Year.MAX_VALUE, 12, 25).plusWeeks(Long.MIN_VALUE);
}
-
- @Test
- public void test_plusDays_normal() {
- LocalDate t = TEST_2007_07_15.plusDays(1);
- assertEquals(t, LocalDate.of(2007, 7, 16));
+ //-----------------------------------------------------------------------
+ @DataProvider(name="PlusDays")
+ Object[][] provider_plusDays() {
+ return new Object[][] {
+ {LocalDate.of(2007, 7, 15), 1, LocalDate.of(2007, 7, 16)},
+ {LocalDate.of(2007, 7, 15), 17, LocalDate.of(2007, 8, 1)},
+ {LocalDate.of(2007, 12, 31), 1, LocalDate.of(2008, 1, 1)},
+ {LocalDate.of(2007, 1, 1), 58, LocalDate.of(2007, 2, 28)},
+ {LocalDate.of(2007, 1, 1), 59, LocalDate.of(2007, 3, 1)},
+ {LocalDate.of(2008, 1, 1), 60, LocalDate.of(2008, 3, 1)},
+ {LocalDate.of(2007, 2, 1), 27, LocalDate.of(2007, 2, 28)},
+ {LocalDate.of(2007, 2, 1), 28, LocalDate.of(2007, 3, 1)},
+ {LocalDate.of(2007, 1, 1), 29, LocalDate.of(2007, 1, 30)},
+ {LocalDate.of(2007, 1, 1), 30, LocalDate.of(2007, 1, 31)},
+ {LocalDate.of(2007, 1, 15), 13, LocalDate.of(2007, 1, 28)},
+ {LocalDate.of(2007, 1, 15), 14, LocalDate.of(2007, 1, 29)},
+ {LocalDate.of(2007, 1, 15), 15, LocalDate.of(2007, 1, 30)},
+ {LocalDate.of(2007, 1, 15), 16, LocalDate.of(2007, 1, 31)},
+ {LocalDate.of(2007, 2, 15), 13, LocalDate.of(2007, 2, 28)},
+ {LocalDate.of(2007, 2, 15), 14, LocalDate.of(2007, 3, 1)},
+ {LocalDate.of(2007, 2, 15), 15, LocalDate.of(2007, 3, 2)},
+ {LocalDate.of(2007, 2, 15), 16, LocalDate.of(2007, 3, 3)},
+ };
}
+ @Test(dataProvider="PlusDays")
+ public void test_plusDays_normal(LocalDate input, int amountsToAdd, LocalDate expected) {
+ LocalDate actual = input.plusDays(amountsToAdd);
+ assertEquals(actual, expected);
+ }
+
@Test
public void test_plusDays_overMonths() {
LocalDate t = TEST_2007_07_15.plusDays(62);
diff --git a/jdk/test/java/util/Locale/Bug8026766.java b/jdk/test/java/util/Locale/Bug8026766.java
new file mode 100644
index 00000000000..630737fdf99
--- /dev/null
+++ b/jdk/test/java/util/Locale/Bug8026766.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8026766
+ * @summary Confirm that LanguageRange.toString() returns an expected result.
+ * @run main Bug8026766
+ */
+
+import java.util.Locale.LanguageRange;
+
+public class Bug8026766 {
+
+ public static void main(String[] args) {
+ LanguageRange lr1 = new LanguageRange("ja", 1.0);
+ LanguageRange lr2 = new LanguageRange("fr", 0.0);
+
+ if (!lr1.toString().equals("ja") ||
+ !lr2.toString().equals("fr;q=0.0")) {
+ throw new RuntimeException("LanguageRange.toString() returned an unexpected result.");
+ }
+ }
+
+}
diff --git a/jdk/test/java/util/Locale/LocaleProviders.java b/jdk/test/java/util/Locale/LocaleProviders.java
index fe7b7085d20..230d11c320c 100644
--- a/jdk/test/java/util/Locale/LocaleProviders.java
+++ b/jdk/test/java/util/Locale/LocaleProviders.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -213,7 +213,7 @@ public class LocaleProviders {
static void bug8013903Test() {
if (System.getProperty("os.name").startsWith("Windows")) {
Date sampleDate = new Date(0x10000000000L);
- String fallbackResult = "Heisei 16.Nov.03 (Wed) AM 11:53:47";
+ String hostResult = "\u5e73\u6210 16.11.03 (Wed) AM 11:53:47";
String jreResult = "\u5e73\u6210 16.11.03 (\u6c34) \u5348\u524d 11:53:47";
Locale l = new Locale("ja", "JP", "JP");
SimpleDateFormat sdf = new SimpleDateFormat("GGGG yyyy.MMM.dd '('E')' a hh:mm:ss", l);
@@ -227,11 +227,10 @@ public class LocaleProviders {
result + "\", expected: \"" + jreResult);
}
} else {
- // should be FALLBACK, as Windows HOST does not return
- // display names
- if (!fallbackResult.equals(result)) {
+ // Windows display names. Subject to change if Windows changes its format.
+ if (!hostResult.equals(result)) {
throw new RuntimeException("Format failed. result: \"" +
- result + "\", expected: \"" + fallbackResult);
+ result + "\", expected: \"" + hostResult);
}
}
}
diff --git a/jdk/test/java/util/Locale/LocaleProviders.sh b/jdk/test/java/util/Locale/LocaleProviders.sh
index fb8043e21c3..798fce5ce6d 100644
--- a/jdk/test/java/util/Locale/LocaleProviders.sh
+++ b/jdk/test/java/util/Locale/LocaleProviders.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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,7 +24,7 @@
#
# @test
# @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577
-# 8010666 8013086 8013233 8013903 8015960 8028771 8062006
+# 8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006
# @summary tests for "java.locale.providers" system property
# @compile -XDignore.symbol.file LocaleProviders.java
# @run shell/timeout=600 LocaleProviders.sh
diff --git a/jdk/test/java/util/concurrent/forkjoin/FJExceptionTableLeak.java b/jdk/test/java/util/concurrent/forkjoin/FJExceptionTableLeak.java
index 372febce6b8..c236bd231cc 100644
--- a/jdk/test/java/util/concurrent/forkjoin/FJExceptionTableLeak.java
+++ b/jdk/test/java/util/concurrent/forkjoin/FJExceptionTableLeak.java
@@ -37,6 +37,7 @@
* @bug 8004138
* @summary Check if ForkJoinPool table leaks thrown exceptions.
* @run main/othervm -Xmx2200k FJExceptionTableLeak
+ * @key intermittent
*/
import java.util.concurrent.ForkJoinPool;
diff --git a/jdk/test/java/util/logging/LogManager/Configuration/updateConfiguration/UpdateConfigurationTest.java b/jdk/test/java/util/logging/LogManager/Configuration/updateConfiguration/UpdateConfigurationTest.java
index fd33de326ec..7022593f322 100644
--- a/jdk/test/java/util/logging/LogManager/Configuration/updateConfiguration/UpdateConfigurationTest.java
+++ b/jdk/test/java/util/logging/LogManager/Configuration/updateConfiguration/UpdateConfigurationTest.java
@@ -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
@@ -209,8 +209,9 @@ public class UpdateConfigurationTest {
+ barChild.getParent() +"\n\texpected: " + barRef.get());
}
Reference extends Logger> ref2;
- int max = 3;
+ int max = 10;
barChild = null;
+ System.gc();
while ((ref2 = queue.poll()) == null) {
System.gc();
Thread.sleep(100);
@@ -276,24 +277,27 @@ public class UpdateConfigurationTest {
}
});
- // Now we need to forget the child, so that loggers are released,
- // and so that we can run the test with the next configuration...
-
- fooChild = null;
- System.out.println("Setting fooChild to: " + fooChild);
- while ((ref2 = queue.poll()) == null) {
- System.gc();
- Thread.sleep(1000);
+ if (suppressed == null) {
+ // Now we need to forget the child, so that loggers are released,
+ // and so that we can run the test with the next configuration...
+ // No need to do that if failed!=null however, as the first
+ // ref might not have been cleared yet and failing here would
+ // hide the original failure.
+ fooChild = null;
+ System.out.println("Setting fooChild to: " + fooChild);
+ while ((ref2 = queue.poll()) == null) {
+ System.gc();
+ Thread.sleep(1000);
+ }
+ if (ref2 != fooRef) {
+ throw new RuntimeException("Unexpected reference: "
+ + ref2 +"\n\texpected: " + fooRef);
+ }
+ if (ref2.get() != null) {
+ throw new RuntimeException("Referent not cleared: " + ref2.get());
+ }
+ System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
}
- if (ref2 != fooRef) {
- throw new RuntimeException("Unexpected reference: "
- + ref2 +"\n\texpected: " + fooRef);
- }
- if (ref2.get() != null) {
- throw new RuntimeException("Referent not cleared: " + ref2.get());
- }
- System.out.println("Got fooRef after reset(), fooChild is " + fooChild);
-
}
}
if (failed != null) {
diff --git a/jdk/test/java/util/zip/ZipFile/TestZipFile.java b/jdk/test/java/util/zip/ZipFile/TestZipFile.java
index 986877731db..515ed356c2b 100644
--- a/jdk/test/java/util/zip/ZipFile/TestZipFile.java
+++ b/jdk/test/java/util/zip/ZipFile/TestZipFile.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8142508
+ * @bug 8142508 8146431
* @summary Tests various ZipFile apis
* @run main/manual TestZipFile
*/
@@ -216,6 +216,13 @@ public class TestZipFile {
}
static void doTest0(Zip zip, ZipFile zf) throws Throwable {
+ // (0) check zero-length entry name, no AIOOBE
+ try {
+ check(zf.getEntry("") == null);;
+ } catch (Throwable t) {
+ unexpected(t);
+ }
+
List list = new ArrayList(zip.entries.keySet());
// (1) check entry list, in expected order
if (!check(Arrays.equals(
diff --git a/jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java b/jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java
index 7f142cfae41..1a24febc056 100644
--- a/jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java
+++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionCommand.java
@@ -53,21 +53,13 @@ public class ImplVersionCommand {
// Check JMX implementation version vs. JVM implementation version
//
- if (Boolean.valueOf(args[1]).booleanValue()) {
- if (!mbsdVersion.equals(args[0]))
- throw new IllegalArgumentException(
- "JMX and Java Runtime implementation versions do not match!");
- // Test OK!
- //
- System.out.println("JMX and Java Runtime implementation " +
- "versions match!");
- } else {
- // Test OK!
- //
- System.out.println("JMX and Java Runtime implementation " +
- "versions do not match because the test " +
- "is using an unbundled version of JMX!");
- }
+ if (!mbsdVersion.equals(args[0]))
+ throw new IllegalArgumentException(
+ "JMX and Java Runtime implementation versions do not match!");
+ // Test OK!
+ //
+ System.out.println("JMX and Java Runtime implementation " +
+ "versions match!");
System.out.println("Bye! Bye!");
}
}
diff --git a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
index b17fd6442e1..ae454b5b7e0 100644
--- a/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
+++ b/jdk/test/javax/management/ImplementationVersion/ImplVersionTest.java
@@ -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
@@ -25,9 +25,9 @@
* @test
* @bug 4842196
* @summary Test that there is no difference between the JMX version and the
- * JDK version when JMX is bundled into the Java platform and the application
- * is run with a security manager and the test codebase has the java permission
- * to read the "java.runtime.version" system property.
+ * JDK version when the application is run with a security manager and the
+ * test codebase has the java permission to read the "java.runtime.version"
+ * system property.
* @author Luis-Miguel Alventosa
* @modules java.management
* @run clean ImplVersionTest ImplVersionCommand
@@ -36,8 +36,6 @@
*/
import java.io.File;
-import java.security.CodeSource;
-import javax.management.MBeanServer;
public class ImplVersionTest {
@@ -70,18 +68,13 @@ public class ImplVersionTest {
System.out.println("testClasses = " + testClasses);
// Get boot class path
//
- boolean checkVersion = true;
- String bootClassPath = System.getProperty("sun.boot.class.path");
- if (bootClassPath != null &&
- bootClassPath.indexOf("jmxri.jar") != -1)
- checkVersion = false;
String command =
javaHome + File.separator + "bin" + File.separator + "java " +
" -classpath " + testClasses +
" -Djava.security.manager -Djava.security.policy==" + testSrc +
File.separator + "policy -Dtest.classes=" + testClasses +
" ImplVersionCommand " +
- System.getProperty("java.runtime.version") + " " + checkVersion;
+ System.getProperty("java.runtime.version");
System.out.println("ImplVersionCommand Exec Command = " +command);
Process proc = Runtime.getRuntime().exec(command);
new ImplVersionReader(proc, proc.getInputStream()).start();
diff --git a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
index 0a924034713..1e3662cc1ed 100644
--- a/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
+++ b/jdk/test/javax/management/remote/mandatory/version/ImplVersionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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,9 +25,9 @@
* @test
* @bug 5046815
* @summary Test that RMIServer.getVersion() reflects the JDK version when
- * JMX is bundled into the Java platform and the application is run with a
- * security manager and the test codebase has the java permission to read
- * the "java.runtime.version" system property.
+ * the Java platform and the application is run with a security manager and the
+ * test codebase has the java permission to read the "java.runtime.version"
+ * system property.
* @author Luis-Miguel Alventosa, Joel Feraud
* @modules java.management
* @run clean ImplVersionTest ImplVersionCommand
@@ -36,8 +36,6 @@
*/
import java.io.File;
-import java.security.CodeSource;
-import javax.management.MBeanServer;
public class ImplVersionTest {
diff --git a/jdk/test/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java b/jdk/test/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java
new file mode 100644
index 00000000000..d457766d5d4
--- /dev/null
+++ b/jdk/test/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.net.Socket;
+import java.security.Principal;
+import java.security.PrivateKey;
+import java.security.cert.X509Certificate;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.X509ExtendedKeyManager;
+
+public class MyX509ExtendedKeyManager extends X509ExtendedKeyManager {
+
+ static final String ERROR = "ERROR";
+ X509ExtendedKeyManager akm;
+ String expectedAP;
+
+ MyX509ExtendedKeyManager(X509ExtendedKeyManager akm) {
+ this.akm = akm;
+ }
+
+ public MyX509ExtendedKeyManager(
+ X509ExtendedKeyManager akm, String expectedAP) {
+ this.akm = akm;
+ this.expectedAP = expectedAP;
+
+ }
+
+ @Override
+ public String[] getClientAliases(String keyType, Principal[] issuers) {
+ return akm.getClientAliases(keyType, issuers);
+ }
+
+ @Override
+ public String chooseClientAlias(String[] keyType, Principal[] issuers,
+ Socket socket) {
+ String nap = ((SSLSocket) socket).getHandshakeApplicationProtocol();
+ checkALPN(nap);
+
+ return akm.chooseClientAlias(keyType, issuers, socket);
+ }
+
+ @Override
+ public String[] getServerAliases(String keyType, Principal[] issuers) {
+ return akm.getServerAliases(keyType, issuers);
+ }
+
+ @Override
+ public String chooseServerAlias(String keyType, Principal[] issuers,
+ Socket socket) {
+ String nap = ((SSLSocket) socket).getHandshakeApplicationProtocol();
+ checkALPN(nap);
+
+ return akm.chooseServerAlias(keyType, issuers, socket);
+ }
+
+ @Override
+ public X509Certificate[] getCertificateChain(String alias) {
+ return akm.getCertificateChain(alias);
+ }
+
+ @Override
+ public PrivateKey getPrivateKey(String alias) {
+ return akm.getPrivateKey(alias);
+ }
+
+ @Override
+ public String chooseEngineClientAlias(String[] keyType, Principal[] issuers,
+ SSLEngine engine) {
+ String nap = engine.getHandshakeApplicationProtocol();
+ checkALPN(nap);
+
+ return akm.chooseEngineClientAlias(keyType, issuers, engine);
+ }
+
+ @Override
+ public String chooseEngineServerAlias(String keyType, Principal[] issuers,
+ SSLEngine engine) {
+ String nap = engine.getHandshakeApplicationProtocol();
+ checkALPN(nap);
+
+ return akm.chooseEngineServerAlias(keyType, issuers, engine);
+ }
+
+ private void checkALPN(String ap) {
+
+ if (ERROR.equals(expectedAP)) {
+ throw new RuntimeException("Should not reach here");
+ }
+
+ System.out.println("Expected ALPN value: " + expectedAP
+ + " Got: " + ap);
+
+ if (ap == null) {
+ throw new RuntimeException(
+ "ALPN should be negotiated, but null was received");
+ }
+ if (expectedAP.equals("NONE")) {
+ if (!ap.isEmpty()) {
+ throw new RuntimeException("Expected no ALPN value");
+ } else {
+ System.out.println("No ALPN value negotiated, as expected");
+ }
+ } else if (!expectedAP.equals(ap)) {
+ throw new RuntimeException(expectedAP
+ + " ALPN value not available on negotiated connection");
+ }
+
+ }
+}
diff --git a/jdk/test/javax/net/ssl/ALPN/SSLEngineAlpnTest.java b/jdk/test/javax/net/ssl/ALPN/SSLEngineAlpnTest.java
index b5cb0a1ac6c..de4ea6cc0b6 100644
--- a/jdk/test/javax/net/ssl/ALPN/SSLEngineAlpnTest.java
+++ b/jdk/test/javax/net/ssl/ALPN/SSLEngineAlpnTest.java
@@ -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
@@ -26,8 +26,9 @@
/*
* @test
- * @bug 8051498
+ * @bug 8051498 8145849
* @summary JEP 244: TLS Application-Layer Protocol Negotiation Extension
+ * @compile MyX509ExtendedKeyManager.java
* @run main/othervm SSLEngineAlpnTest h2 h2 h2
* @run main/othervm SSLEngineAlpnTest h2 h2,http/1.1 h2
* @run main/othervm SSLEngineAlpnTest h2,http/1.1 h2,http/1.1 h2
@@ -162,7 +163,7 @@ public class SSLEngineAlpnTest {
throw new Exception("Invalid number of test parameters");
}
- SSLEngineAlpnTest test = new SSLEngineAlpnTest();
+ SSLEngineAlpnTest test = new SSLEngineAlpnTest(args[2]);
try {
test.runTest(convert(args[0]), convert(args[1]), args[2]);
} catch (SSLHandshakeException she) {
@@ -179,7 +180,7 @@ public class SSLEngineAlpnTest {
/*
* Create an initialized SSLContext to use for these tests.
*/
- public SSLEngineAlpnTest() throws Exception {
+ public SSLEngineAlpnTest(String expectedAP) throws Exception {
KeyStore ks = KeyStore.getInstance("JKS");
KeyStore ts = KeyStore.getInstance("JKS");
@@ -192,12 +193,20 @@ public class SSLEngineAlpnTest {
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
kmf.init(ks, passphrase);
+ KeyManager [] kms = kmf.getKeyManagers();
+ if (!(kms[0] instanceof X509ExtendedKeyManager)) {
+ throw new Exception("kms[0] not X509ExtendedKeyManager");
+ }
+
+ kms = new KeyManager[] { new MyX509ExtendedKeyManager(
+ (X509ExtendedKeyManager) kms[0], expectedAP) };
+
TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
tmf.init(ts);
SSLContext sslCtx = SSLContext.getInstance("TLS");
- sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
+ sslCtx.init(kms, tmf.getTrustManagers(), null);
sslc = sslCtx;
}
@@ -327,6 +336,11 @@ public class SSLEngineAlpnTest {
return;
}
+ if (engine.getHandshakeApplicationProtocol() != null) {
+ throw new Exception ("getHandshakeApplicationProtocol() should "
+ + "return null after the handshake is completed");
+ }
+
String ap = engine.getApplicationProtocol();
System.out.println("Application Protocol: \"" + ap + "\"");
@@ -384,6 +398,12 @@ public class SSLEngineAlpnTest {
sslp = clientEngine.getSSLParameters();
sslp.setApplicationProtocols(clientAPs);
clientEngine.setSSLParameters(sslp);
+
+ if ((clientEngine.getHandshakeApplicationProtocol() != null) ||
+ (serverEngine.getHandshakeApplicationProtocol() != null)) {
+ throw new Exception ("getHandshakeApplicationProtocol() should "
+ + "return null before the handshake starts");
+ }
}
/*
diff --git a/jdk/test/javax/net/ssl/ALPN/SSLSocketAlpnTest.java b/jdk/test/javax/net/ssl/ALPN/SSLSocketAlpnTest.java
index 792f8dd750b..fd52f251f9d 100644
--- a/jdk/test/javax/net/ssl/ALPN/SSLSocketAlpnTest.java
+++ b/jdk/test/javax/net/ssl/ALPN/SSLSocketAlpnTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -26,8 +26,9 @@
/*
* @test
- * @bug 8051498
+ * @bug 8051498 8145849
* @summary JEP 244: TLS Application-Layer Protocol Negotiation Extension
+ * @compile MyX509ExtendedKeyManager.java
* @run main/othervm SSLSocketAlpnTest h2 h2 h2
* @run main/othervm SSLSocketAlpnTest h2 h2,http/1.1 h2
* @run main/othervm SSLSocketAlpnTest h2,http/1.1 h2,http/1.1 h2
@@ -40,6 +41,8 @@
* @author Brad Wetmore
*/
import java.io.*;
+import java.security.KeyStore;
+
import javax.net.ssl.*;
public class SSLSocketAlpnTest {
@@ -65,6 +68,16 @@ public class SSLSocketAlpnTest {
static String trustStoreFile = "truststore";
static String passwd = "passphrase";
+ static String keyFilename = System.getProperty("test.src", ".") + "/"
+ + pathToStores + "/" + keyStoreFile;
+ static String trustFilename = System.getProperty("test.src", ".") + "/"
+ + pathToStores + "/" + trustStoreFile;
+
+ /*
+ * SSLContext
+ */
+ SSLContext mySSLContext = null;
+
/*
* Is the server ready to serve?
*/
@@ -82,7 +95,7 @@ public class SSLSocketAlpnTest {
/*
* If the client or server is doing some kind of object creation
* that the other side depends on, and that thread prematurely
- * exits, you may experience a hang. The test harness will
+ * exits, you may experience a hang. The test harness will
* terminate all hung threads after its timeout has expired,
* currently 3 minutes by default, but you might try to be
* smart about it....
@@ -95,10 +108,11 @@ public class SSLSocketAlpnTest {
* to avoid infinite hangs.
*/
void doServerSide() throws Exception {
- SSLServerSocketFactory sslssf
- = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
+ SSLServerSocketFactory sslssf = mySSLContext.getServerSocketFactory();
SSLServerSocket sslServerSocket
= (SSLServerSocket) sslssf.createServerSocket(serverPort);
+ // for both client/server to call into X509KM
+ sslServerSocket.setNeedClientAuth(true);
serverPort = sslServerSocket.getLocalPort();
@@ -119,20 +133,30 @@ public class SSLSocketAlpnTest {
*/
String[] suites = sslp.getCipherSuites();
sslp.setCipherSuites(suites);
- sslp.setUseCipherSuitesOrder(true); // Set server side order
+ sslp.setUseCipherSuitesOrder(true); // Set server side order
// Set the ALPN selection.
sslp.setApplicationProtocols(serverAPs);
sslSocket.setSSLParameters(sslp);
+ if (sslSocket.getHandshakeApplicationProtocol() != null) {
+ throw new Exception ("getHandshakeApplicationProtocol() should "
+ + "return null before the handshake starts");
+ }
+
sslSocket.startHandshake();
+ if (sslSocket.getHandshakeApplicationProtocol() != null) {
+ throw new Exception ("getHandshakeApplicationProtocol() should "
+ + "return null after the handshake is completed");
+ }
+
String ap = sslSocket.getApplicationProtocol();
System.out.println("Application Protocol: \"" + ap + "\"");
if (ap == null) {
throw new Exception(
- "Handshake was completed but null was received");
+ "Handshake was completed but null was received");
}
if (expectedAP.equals("NONE")) {
if (!ap.isEmpty()) {
@@ -141,8 +165,8 @@ public class SSLSocketAlpnTest {
System.out.println("No ALPN value negotiated, as expected");
}
} else if (!expectedAP.equals(ap)) {
- throw new Exception(expectedAP +
- " ALPN value not available on negotiated connection");
+ throw new Exception(expectedAP
+ + " ALPN value not available on negotiated connection");
}
InputStream sslIS = sslSocket.getInputStream();
@@ -170,8 +194,7 @@ public class SSLSocketAlpnTest {
Thread.sleep(50);
}
- SSLSocketFactory sslsf
- = (SSLSocketFactory) SSLSocketFactory.getDefault();
+ SSLSocketFactory sslsf = mySSLContext.getSocketFactory();
SSLSocket sslSocket
= (SSLSocket) sslsf.createSocket("localhost", serverPort);
@@ -185,28 +208,35 @@ public class SSLSocketAlpnTest {
*/
String[] suites = sslp.getCipherSuites();
sslp.setCipherSuites(suites);
- sslp.setUseCipherSuitesOrder(true); // Set server side order
+ sslp.setUseCipherSuitesOrder(true); // Set server side order
// Set the ALPN selection.
sslp.setApplicationProtocols(clientAPs);
sslSocket.setSSLParameters(sslp);
+ if (sslSocket.getHandshakeApplicationProtocol() != null) {
+ throw new Exception ("getHandshakeApplicationProtocol() should "
+ + "return null before the handshake starts");
+ }
+
sslSocket.startHandshake();
+ if (sslSocket.getHandshakeApplicationProtocol() != null) {
+ throw new Exception ("getHandshakeApplicationProtocol() should "
+ + "return null after the handshake is completed");
+ }
+
/*
* Check that the resulting connection meets our defined ALPN
* criteria. If we were connecting to a non-JSSE implementation,
* the server might have negotiated something we shouldn't accept.
- *
- * We were expecting H2 from server, let's make sure the
- * conditions match.
*/
String ap = sslSocket.getApplicationProtocol();
System.out.println("Application Protocol: \"" + ap + "\"");
if (ap == null) {
throw new Exception(
- "Handshake was completed but null was received");
+ "Handshake was completed but null was received");
}
if (expectedAP.equals("NONE")) {
if (!ap.isEmpty()) {
@@ -215,8 +245,8 @@ public class SSLSocketAlpnTest {
System.out.println("No ALPN value negotiated, as expected");
}
} else if (!expectedAP.equals(ap)) {
- throw new Exception(expectedAP +
- " ALPN value not available on negotiated connection");
+ throw new Exception(expectedAP
+ + " ALPN value not available on negotiated connection");
}
InputStream sslIS = sslSocket.getInputStream();
@@ -240,17 +270,6 @@ public class SSLSocketAlpnTest {
volatile Exception clientException = null;
public static void main(String[] args) throws Exception {
- String keyFilename
- = System.getProperty("test.src", ".") + "/" + pathToStores
- + "/" + keyStoreFile;
- String trustFilename
- = System.getProperty("test.src", ".") + "/" + pathToStores
- + "/" + trustStoreFile;
-
- System.setProperty("javax.net.ssl.keyStore", keyFilename);
- System.setProperty("javax.net.ssl.keyStorePassword", passwd);
- System.setProperty("javax.net.ssl.trustStore", trustFilename);
- System.setProperty("javax.net.ssl.trustStorePassword", passwd);
if (debug) {
System.setProperty("javax.net.debug", "all");
@@ -280,6 +299,39 @@ public class SSLSocketAlpnTest {
System.out.println("Test Passed.");
}
+ SSLContext getSSLContext(String keyFilename, String trustFilename)
+ throws Exception {
+ SSLContext ctx = SSLContext.getInstance("TLS");
+
+ // Keystores
+ KeyStore keyKS = KeyStore.getInstance("JKS");
+ keyKS.load(new FileInputStream(keyFilename), passwd.toCharArray());
+
+ KeyStore trustKS = KeyStore.getInstance("JKS");
+ trustKS.load(new FileInputStream(trustFilename), passwd.toCharArray());
+
+ // Generate KeyManager and TrustManager
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+ kmf.init(keyKS, passwd.toCharArray());
+
+ KeyManager[] kms = kmf.getKeyManagers();
+ if (!(kms[0] instanceof X509ExtendedKeyManager)) {
+ throw new Exception("kms[0] not X509ExtendedKeyManager");
+ }
+
+ kms = new KeyManager[] { new MyX509ExtendedKeyManager(
+ (X509ExtendedKeyManager) kms[0], expectedAP) };
+
+ TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
+ tmf.init(trustKS);
+ TrustManager[] tms = tmf.getTrustManagers();
+
+ // initial SSLContext
+ ctx.init(kms, tms, null);
+
+ return ctx;
+ }
+
/*
* Convert a comma-separated list into an array of strings.
*/
@@ -309,6 +361,7 @@ public class SSLSocketAlpnTest {
*/
SSLSocketAlpnTest() throws Exception {
Exception startException = null;
+ mySSLContext = getSSLContext(keyFilename, trustFilename);
try {
if (separateServerThread) {
startServer(true);
diff --git a/jdk/test/javax/net/ssl/SSLSession/SessionCacheSizeTests.java b/jdk/test/javax/net/ssl/SSLSession/SessionCacheSizeTests.java
index ccb90c6c182..3fe2af97dfe 100644
--- a/jdk/test/javax/net/ssl/SSLSession/SessionCacheSizeTests.java
+++ b/jdk/test/javax/net/ssl/SSLSession/SessionCacheSizeTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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,6 +31,7 @@
* @bug 4366807
* @summary Need new APIs to get/set session timeout and session cache size.
* @run main/othervm SessionCacheSizeTests
+ * @key intermittent
*/
import java.io.*;
@@ -108,28 +109,34 @@ public class SessionCacheSizeTests {
void doServerSide(int serverPort, int serverConns) throws Exception {
- SSLServerSocket sslServerSocket =
- (SSLServerSocket) sslssf.createServerSocket(serverPort);
- sslServerSocket.setSoTimeout(45000); // timeout to accept a connection
- serverPorts[createdPorts++] = sslServerSocket.getLocalPort();
+ try (SSLServerSocket sslServerSocket =
+ (SSLServerSocket) sslssf.createServerSocket(serverPort)) {
- /*
- * Signal Client, we're ready for his connect.
- */
- if (createdPorts == serverPorts.length) {
- serverReady = true;
- }
- int read = 0;
- int nConnections = 0;
- /*
- * Divide the max connections among the available server ports.
- * The use of more than one server port ensures creation of more
- * than one session.
- */
- SSLSession sessions [] = new SSLSession [serverConns];
- SSLSessionContext sessCtx = sslctx.getServerSessionContext();
+ // timeout to accept a connection
+ sslServerSocket.setSoTimeout(45000);
+
+ // make sure createdPorts++ is atomic
+ synchronized(serverPorts) {
+ serverPorts[createdPorts++] = sslServerSocket.getLocalPort();
+
+ /*
+ * Signal Client, we're ready for his connect.
+ */
+ if (createdPorts == serverPorts.length) {
+ serverReady = true;
+ }
+ }
+ int read = 0;
+ int nConnections = 0;
+
+ /*
+ * Divide the max connections among the available server ports.
+ * The use of more than one server port ensures creation of more
+ * than one session.
+ */
+ SSLSession sessions [] = new SSLSession [serverConns];
+ SSLSessionContext sessCtx = sslctx.getServerSessionContext();
- try {
while (nConnections < serverConns) {
try (SSLSocket sslSocket =
(SSLSocket)sslServerSocket.accept()) {
@@ -143,8 +150,6 @@ public class SessionCacheSizeTests {
nConnections++;
}
}
- } finally {
- sslServerSocket.close();
}
}
@@ -270,8 +275,8 @@ public class SessionCacheSizeTests {
* Using four ports (one per each connection), we are able to create
* alteast four sessions.
*/
- volatile int serverPorts[] = new int[]{0, 0, 0, 0};
- volatile int createdPorts = 0;
+ int serverPorts[] = new int[]{0, 0, 0, 0}; // MAX_ACTIVE_CONNECTIONS: 4
+ int createdPorts = 0;
static SSLServerSocketFactory sslssf;
static SSLSocketFactory sslsf;
static SSLContext sslctx;
diff --git a/jdk/test/javax/security/auth/SubjectDomainCombiner/Optimize.java b/jdk/test/javax/security/auth/SubjectDomainCombiner/Optimize.java
index 99ec943caaf..df5adef42a6 100644
--- a/jdk/test/javax/security/auth/SubjectDomainCombiner/Optimize.java
+++ b/jdk/test/javax/security/auth/SubjectDomainCombiner/Optimize.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* 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,13 +37,16 @@ public class Optimize {
ProtectionDomain pd1 = new ProtectionDomain(
new CodeSource(null, (java.security.cert.Certificate[]) null),
- new Permissions());
+ new Permissions(),
+ null, null);
ProtectionDomain pd2 = new ProtectionDomain(
new CodeSource(null, (java.security.cert.Certificate[]) null),
- new Permissions());
+ new Permissions(),
+ null, null);
ProtectionDomain pd3 = new ProtectionDomain(
new CodeSource(null, (java.security.cert.Certificate[]) null),
- new Permissions());
+ new Permissions(),
+ null, null);
ProtectionDomain[] current = new ProtectionDomain[] {pd1, pd2};
ProtectionDomain[] assigned = new ProtectionDomain[] {pd3, pd2};
diff --git a/jdk/test/jdk/internal/jimage/JImageReadTest.java b/jdk/test/jdk/internal/jimage/JImageReadTest.java
index 82df8c83384..b840d1444e9 100644
--- a/jdk/test/jdk/internal/jimage/JImageReadTest.java
+++ b/jdk/test/jdk/internal/jimage/JImageReadTest.java
@@ -313,7 +313,7 @@ public class JImageReadTest {
static boolean isMetaName(String name) {
return name.startsWith("/modules")
|| name.startsWith("/packages")
- || name.startsWith("META-INF/services")
+ || name.startsWith("META-INF")
|| name.equals("bootmodules.jdata");
}
diff --git a/jdk/test/sun/misc/VM/GetNanoTimeAdjustment.java b/jdk/test/jdk/internal/misc/VM/GetNanoTimeAdjustment.java
similarity index 99%
rename from jdk/test/sun/misc/VM/GetNanoTimeAdjustment.java
rename to jdk/test/jdk/internal/misc/VM/GetNanoTimeAdjustment.java
index d92cba9eaca..964352522a3 100644
--- a/jdk/test/sun/misc/VM/GetNanoTimeAdjustment.java
+++ b/jdk/test/jdk/internal/misc/VM/GetNanoTimeAdjustment.java
@@ -21,13 +21,13 @@
* questions.
*/
import java.util.Objects;
-import sun.misc.VM;
+import jdk.internal.misc.VM;
/**
* @test
* @bug 8068730
* @summary tests that VM.getgetNanoTimeAdjustment() works as expected.
- * @modules java.base/sun.misc
+ * @modules java.base/jdk.internal.misc
* @run main GetNanoTimeAdjustment
* @author danielfuchs
*/
diff --git a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java
index 5275b69b594..887ae768b32 100644
--- a/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java
+++ b/jdk/test/sun/security/krb5/auto/ReplayCacheTestProc.java
@@ -78,7 +78,7 @@ public class ReplayCacheTestProc {
mode = -1;
}
- uid = sun.misc.VM.geteuid();
+ uid = jdk.internal.misc.VM.geteuid();
KDC kdc = KDC.create(OneKDC.REALM, HOST, 0, true);
for (int i=0; i extends AbstractAnnotationValueVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
index 1d37826f892..c239303179a 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor9.java
@@ -61,7 +61,7 @@ import static javax.lang.model.SourceVersion.*;
* @see AbstractElementVisitor6
* @see AbstractElementVisitor7
* @see AbstractElementVisitor8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public abstract class AbstractElementVisitor9 extends AbstractElementVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java
index 051100c1f5f..d268e867d0a 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/AbstractTypeVisitor9.java
@@ -61,7 +61,7 @@ import static javax.lang.model.SourceVersion.*;
* @see AbstractTypeVisitor6
* @see AbstractTypeVisitor7
* @see AbstractTypeVisitor8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public abstract class AbstractTypeVisitor9 extends AbstractTypeVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
index bd561111aba..a0e51e2af0f 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor9.java
@@ -74,7 +74,7 @@ import javax.lang.model.SourceVersion;
* @see ElementKindVisitor6
* @see ElementKindVisitor7
* @see ElementKindVisitor8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public class ElementKindVisitor9 extends ElementKindVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
index 32c368dced5..b6f88105138 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/ElementScanner9.java
@@ -87,7 +87,7 @@ import static javax.lang.model.SourceVersion.*;
* @see ElementScanner6
* @see ElementScanner7
* @see ElementScanner8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public class ElementScanner9 extends ElementScanner8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java
index e48903deb7a..d5cf8e0cfd0 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor9.java
@@ -64,7 +64,7 @@ import static javax.lang.model.SourceVersion.*;
* @see SimpleAnnotationValueVisitor6
* @see SimpleAnnotationValueVisitor7
* @see SimpleAnnotationValueVisitor8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public class SimpleAnnotationValueVisitor9 extends SimpleAnnotationValueVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
index d7fc7b489ad..fae29ca6e97 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor9.java
@@ -69,7 +69,7 @@ import static javax.lang.model.SourceVersion.*;
* @see SimpleElementVisitor6
* @see SimpleElementVisitor7
* @see SimpleElementVisitor8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public class SimpleElementVisitor9 extends SimpleElementVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java b/langtools/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java
index f92e9d706c3..299969b39b3 100644
--- a/langtools/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java
+++ b/langtools/src/java.compiler/share/classes/javax/lang/model/util/TypeKindVisitor9.java
@@ -72,7 +72,7 @@ import static javax.lang.model.SourceVersion.*;
* @see TypeKindVisitor6
* @see TypeKindVisitor7
* @see TypeKindVisitor8
- * @since 1.9
+ * @since 9
*/
@SupportedSourceVersion(RELEASE_9)
public class TypeKindVisitor9 extends TypeKindVisitor8 {
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java b/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java
index fe8f6589c5d..1fe7783f638 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/FileManagerUtils.java
@@ -32,7 +32,7 @@ import java.util.Iterator;
/**
* Package-private utility methods to convert between files and paths.
*
- * @since 1.9
+ * @since 9
*/
class FileManagerUtils {
private FileManagerUtils() { }
diff --git a/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java b/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
index 9701584805c..e24d5a2e915 100644
--- a/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
+++ b/langtools/src/java.compiler/share/classes/javax/tools/StandardJavaFileManager.java
@@ -187,7 +187,7 @@ public interface StandardJavaFileManager extends JavaFileManager {
* a directory or if this file manager does not support any of the
* given paths.
*
- * @since 1.9
+ * @since 9
*/
default Iterable extends JavaFileObject> getJavaFileObjectsFromPaths(
Iterable extends Path> paths) {
@@ -226,7 +226,7 @@ public interface StandardJavaFileManager extends JavaFileManager {
* @throws NullPointerException if the given array contains null
* elements
*
- * @since 1.9
+ * @since 9
*/
default Iterable extends JavaFileObject> getJavaFileObjects(Path... paths) {
return getJavaFileObjectsFromPaths(Arrays.asList(paths));
@@ -295,7 +295,7 @@ public interface StandardJavaFileManager extends JavaFileManager {
* @throws IOException if {@code location} is an output location and
* {@code paths} does not represent an existing directory
*
- * @since 1.9
+ * @since 9
*/
default void setLocationFromPaths(Location location, Iterable extends Path> paths)
throws IOException {
@@ -324,7 +324,7 @@ public interface StandardJavaFileManager extends JavaFileManager {
* associated search path
*
* @see #setLocationFromPaths
- * @since 1.9
+ * @since 9
*/
default Iterable extends Path> getLocationAsPaths(Location location) {
return asPaths(getLocation(location));
@@ -345,7 +345,7 @@ public interface StandardJavaFileManager extends JavaFileManager {
* @throws IllegalArgumentException if the file object does not have an underlying path
* @throws UnsupportedOperationException if the operation is not supported by this file manager
*
- * @since 1.9
+ * @since 9
*/
default Path asPath(FileObject file) {
throw new UnsupportedOperationException();
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AttributeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AttributeTree.java
index 86d236f9295..d6c30f9e0da 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AttributeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AttributeTree.java
@@ -33,12 +33,10 @@ import javax.lang.model.element.Name;
*
* @since 1.8
*/
-@jdk.Exported
public interface AttributeTree extends DocTree {
/**
* The kind of an attribute value.
*/
- @jdk.Exported
enum ValueKind {
/** The attribute value is empty. */
EMPTY,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AuthorTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AuthorTree.java
index 4dce58feff9..d1b1d19acb8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AuthorTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/AuthorTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface AuthorTree extends BlockTagTree {
/**
* Returns the name of the author.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/BlockTagTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/BlockTagTree.java
index 2284f01057f..bb5bbe412d8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/BlockTagTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/BlockTagTree.java
@@ -31,7 +31,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface BlockTagTree extends DocTree {
/**
* Returns the name of the tag.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java
index 346b1542714..52c50891d3b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java
@@ -33,7 +33,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface CommentTree extends DocTree {
/**
* Returns the text of the comment.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DeprecatedTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DeprecatedTree.java
index bfcebcf7393..7855c8989db 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DeprecatedTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DeprecatedTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface DeprecatedTree extends BlockTagTree {
/**
* Returns the description explaining why an item is deprecated.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocCommentTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocCommentTree.java
index b85edc99fd2..810be9ea6ba 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocCommentTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocCommentTree.java
@@ -36,7 +36,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface DocCommentTree extends DocTree {
/**
* Returns the first sentence of a documentation comment.
@@ -49,7 +48,7 @@ public interface DocCommentTree extends DocTree {
* before any block tags, including the first sentence.
* @return body of a documentation comment first sentence inclusive
*
- * @since 1.9
+ * @since 9
*/
default List extends DocTree> getFullBody() {
ArrayList bodyList = new ArrayList<>();
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocRootTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocRootTree.java
index e0c3c91bb61..2de83b3a1fc 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocRootTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocRootTree.java
@@ -33,5 +33,4 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface DocRootTree extends InlineTagTree { }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java
index 0b54ca8334a..2a526ebcb03 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTree.java
@@ -30,12 +30,10 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface DocTree {
/**
* Enumerates all kinds of trees.
*/
- @jdk.Exported
enum Kind {
/**
* Used for instances of {@link AttributeTree}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java
index 1512cf08f2f..f9a3d9ed444 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTreeVisitor.java
@@ -54,7 +54,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface DocTreeVisitor {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EndElementTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EndElementTree.java
index e54e3082d08..5015b02169e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EndElementTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EndElementTree.java
@@ -35,7 +35,6 @@ import javax.lang.model.element.Name;
*
* @since 1.8
*/
-@jdk.Exported
public interface EndElementTree extends DocTree {
/**
* Returns the name of this element.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EntityTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EntityTree.java
index 5431fd7057c..57200237e84 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EntityTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/EntityTree.java
@@ -38,7 +38,6 @@ import javax.lang.model.element.Name;
*
* @since 1.8
*/
-@jdk.Exported
public interface EntityTree extends DocTree {
/**
* Returns the name or value of the entity.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ErroneousTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ErroneousTree.java
index eb0156fecb1..4e867e2a88e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ErroneousTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ErroneousTree.java
@@ -33,7 +33,6 @@ import javax.tools.JavaFileObject;
*
* @since 1.8
*/
-@jdk.Exported
public interface ErroneousTree extends TextTree {
/**
* Returns a diagnostic object giving details about
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IdentifierTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IdentifierTree.java
index a82bf142976..a4e54b687e1 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IdentifierTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IdentifierTree.java
@@ -35,7 +35,6 @@ import javax.lang.model.element.Name;
*
* @since 1.8
*/
-@jdk.Exported
public interface IdentifierTree extends DocTree {
/**
* Returns the name of the identifier.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IndexTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IndexTree.java
index bfceffa2b81..d6b5d7d1fd9 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IndexTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/IndexTree.java
@@ -33,9 +33,8 @@ import java.util.List;
*
* {@index keyword optional description}
*
- * @since 1.9
+ * @since 9
*/
-@jdk.Exported
public interface IndexTree extends InlineTagTree {
/**
* Returns the specified search term.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InheritDocTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InheritDocTree.java
index 444558ac01d..54347d6c6f6 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InheritDocTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InheritDocTree.java
@@ -34,5 +34,4 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface InheritDocTree extends InlineTagTree { }
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InlineTagTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InlineTagTree.java
index 6cbf1fc4258..8a3222f0563 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InlineTagTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/InlineTagTree.java
@@ -31,7 +31,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface InlineTagTree extends DocTree {
/**
* Returns the name of the tag.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LinkTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LinkTree.java
index 1f4a0a12ded..7db7907d094 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LinkTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LinkTree.java
@@ -36,7 +36,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface LinkTree extends InlineTagTree {
/**
* Returns the reference of a link.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LiteralTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LiteralTree.java
index 91727ccd402..babd8579f55 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LiteralTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/LiteralTree.java
@@ -34,7 +34,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface LiteralTree extends InlineTagTree {
/**
* Returns the body of the {@code @code} or {@code @literal} tag.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ParamTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ParamTree.java
index b721783e493..cc800cab48d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ParamTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ParamTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface ParamTree extends BlockTagTree {
/**
* Returns true if this is documenting a type parameter.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java
index ab623036702..9d4c0c0970e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java
@@ -34,7 +34,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface ReferenceTree extends DocTree {
/**
* Returns the signature of the Java language element being referenced,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReturnTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReturnTree.java
index 305c92c19dc..5d23903c43c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReturnTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ReturnTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface ReturnTree extends BlockTagTree {
/**
* Returns the description of the return value of a method.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SeeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SeeTree.java
index 4ff81c0f6ec..ecab84d24da 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SeeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SeeTree.java
@@ -38,7 +38,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface SeeTree extends BlockTagTree {
/**
* Returns the reference.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialDataTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialDataTree.java
index 90757595c66..2c7ff080655 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialDataTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialDataTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface SerialDataTree extends BlockTagTree {
/**
* Returns the description of the serial data.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialFieldTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialFieldTree.java
index ff7c25a919d..5e0e648bb8c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialFieldTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialFieldTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface SerialFieldTree extends BlockTagTree {
/**
* Returns the name of the serial field.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialTree.java
index 04feab793b3..980360d1e5e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SerialTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface SerialTree extends BlockTagTree {
/**
* Returns the description of the field, or the word
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SinceTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SinceTree.java
index 074aebd4cff..68406a8ef04 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SinceTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/SinceTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface SinceTree extends BlockTagTree {
/**
* Returns the text explaining the availability of the item being documented.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/StartElementTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/StartElementTree.java
index 34f98e8ec71..5731f1a7496 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/StartElementTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/StartElementTree.java
@@ -36,7 +36,6 @@ import javax.lang.model.element.Name;
*
* @since 1.8
*/
-@jdk.Exported
public interface StartElementTree extends DocTree {
/**
* Returns the name of the element.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java
index f2adf029dfc..86f81e8eafb 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java
@@ -30,7 +30,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface TextTree extends DocTree {
/**
* Returns the text.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ThrowsTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ThrowsTree.java
index 1f340469582..0fcb0863cc2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ThrowsTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ThrowsTree.java
@@ -38,7 +38,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface ThrowsTree extends BlockTagTree {
/**
* Returns a name of the exception being documented.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownBlockTagTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownBlockTagTree.java
index 80d93572ac2..d55a36bb96a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownBlockTagTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownBlockTagTree.java
@@ -36,7 +36,6 @@ import java.util.List;
* @since 1.8
*
*/
-@jdk.Exported
public interface UnknownBlockTagTree extends BlockTagTree {
/**
* Returns the content of an unrecognized block tag.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownInlineTagTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownInlineTagTree.java
index b8cd4bdc53b..2eedb18e486 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownInlineTagTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/UnknownInlineTagTree.java
@@ -36,7 +36,6 @@ import java.util.List;
* @since 1.8
*
*/
-@jdk.Exported
public interface UnknownInlineTagTree extends InlineTagTree {
/**
* Returns the content of an unrecognized inline tag.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ValueTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ValueTree.java
index 5c792b5bb1d..be6be16dca0 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ValueTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/ValueTree.java
@@ -33,7 +33,6 @@ package com.sun.source.doctree;
*
* @since 1.8
*/
-@jdk.Exported
public interface ValueTree extends InlineTagTree {
/**
* Returns the reference to the value.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/VersionTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/VersionTree.java
index eee4237aab8..41cc20ed380 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/VersionTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/VersionTree.java
@@ -36,7 +36,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface VersionTree extends BlockTagTree {
/**
* Returns the body of the tag.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java
index 47de93766c6..324da402768 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/doctree/package-info.java
@@ -31,5 +31,4 @@
* @since 1.8
* @see http://download.oracle.com/javase/6/docs/technotes/tools/solaris/javadoc.html#javadoctags
*/
-@jdk.Exported
package com.sun.source.doctree;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotatedTypeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotatedTypeTree.java
index d84fcd60730..26d7473fb5f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotatedTypeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotatedTypeTree.java
@@ -41,7 +41,6 @@ import java.util.List;
* @author Mahmood Ali
* @since 1.8
*/
-@jdk.Exported
public interface AnnotatedTypeTree extends ExpressionTree {
/**
* Returns the annotations associated with this type expression.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotationTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotationTree.java
index b47cdbced84..06c5a7d7cc5 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotationTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AnnotationTree.java
@@ -42,7 +42,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface AnnotationTree extends ExpressionTree {
/**
* Returns the annotation type.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayAccessTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayAccessTree.java
index 515aee06d5f..7ec7004641e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayAccessTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayAccessTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ArrayAccessTree extends ExpressionTree {
/**
* Returns the expression for the array being accessed.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayTypeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayTypeTree.java
index d7d8ceb55d8..504b3afc9cf 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayTypeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ArrayTypeTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ArrayTypeTree extends Tree {
/**
* Returns the element type of this array type.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssertTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssertTree.java
index 080bc3ee5f7..ee1cc7b8550 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssertTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssertTree.java
@@ -41,7 +41,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface AssertTree extends StatementTree {
/**
* Returns the condition being asserted.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssignmentTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssignmentTree.java
index 5ce69d24e8f..cb94ead5321 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssignmentTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/AssignmentTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface AssignmentTree extends ExpressionTree {
/**
* Returns the variable being assigned to.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BinaryTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BinaryTree.java
index 8f0d155f334..7769b7136c5 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BinaryTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BinaryTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface BinaryTree extends ExpressionTree {
/**
* Returns the left (first) operand of the expression.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BlockTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BlockTree.java
index 4b5721e1aa3..b5ce0b7bdf2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BlockTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BlockTree.java
@@ -45,7 +45,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface BlockTree extends StatementTree {
/**
* Returns true if and only if this is a static initializer block.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java
index 4f900a62ba8..9307d690dda 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/BreakTree.java
@@ -43,7 +43,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface BreakTree extends StatementTree {
/**
* Returns the label for this {@code break} statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java
index 6aa374f1cb5..a70fe7e6d9a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java
@@ -45,7 +45,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface CaseTree extends Tree {
/**
* Returns the expression for the case, or
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CatchTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CatchTree.java
index b91a94dce5b..40ab239d34b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CatchTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CatchTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface CatchTree extends Tree {
/**
* Returns the catch variable.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ClassTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ClassTree.java
index 3a7f5b34440..b58ccada10e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ClassTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ClassTree.java
@@ -48,7 +48,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ClassTree extends StatementTree {
/**
* Returns the modifiers, including any annotations,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompilationUnitTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompilationUnitTree.java
index fa3e5745814..7aab1228d72 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompilationUnitTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompilationUnitTree.java
@@ -37,7 +37,6 @@ import javax.tools.JavaFileObject;
* @author Peter von der Ahé
* @since 1.6
*/
-@jdk.Exported
public interface CompilationUnitTree extends Tree {
/**
* Returns the annotations listed on any package declaration
@@ -59,7 +58,7 @@ public interface CompilationUnitTree extends Tree {
* Returns the package tree associated with this compilation unit,
* or {@code null} if there is no package declaration.
* @return the package tree
- * @since 1.9
+ * @since 9
*/
PackageTree getPackage();
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompoundAssignmentTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompoundAssignmentTree.java
index e4db62bb053..db6dcc8743f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompoundAssignmentTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompoundAssignmentTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface CompoundAssignmentTree extends ExpressionTree {
/**
* Returns the variable on the left hand side of the compound assignment.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ConditionalExpressionTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ConditionalExpressionTree.java
index fa3dd83769a..aaf665b279d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ConditionalExpressionTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ConditionalExpressionTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ConditionalExpressionTree extends ExpressionTree {
/**
* Returns the condition.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ContinueTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ContinueTree.java
index 2f6f3fa46e6..0d9a4abcc3a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ContinueTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ContinueTree.java
@@ -42,7 +42,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ContinueTree extends StatementTree {
/**
* Returns the label for this {@code continue} statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/DoWhileLoopTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/DoWhileLoopTree.java
index 2aeac4b26ca..6a89d2dd518 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/DoWhileLoopTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/DoWhileLoopTree.java
@@ -41,7 +41,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface DoWhileLoopTree extends StatementTree {
/**
* Returns the condition of the loop.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EmptyStatementTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EmptyStatementTree.java
index 6548eaf9f42..4e33f968583 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EmptyStatementTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EmptyStatementTree.java
@@ -39,5 +39,4 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface EmptyStatementTree extends StatementTree {}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EnhancedForLoopTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EnhancedForLoopTree.java
index f9619f897ba..7316c432e2f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EnhancedForLoopTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/EnhancedForLoopTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface EnhancedForLoopTree extends StatementTree {
/**
* Returns the control variable for the loop.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ErroneousTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ErroneousTree.java
index b56c3ee448c..aa1dbca8a97 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ErroneousTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ErroneousTree.java
@@ -34,7 +34,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ErroneousTree extends ExpressionTree {
/**
* Returns any trees that were saved in this node.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionStatementTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionStatementTree.java
index 7ae8c2265d9..d2c852f9121 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionStatementTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionStatementTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ExpressionStatementTree extends StatementTree {
/**
* Returns the expression constituting this statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionTree.java
index f3a7ed3a829..ca1bc2d9e7f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ExpressionTree.java
@@ -35,5 +35,4 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ExpressionTree extends Tree {}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ForLoopTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ForLoopTree.java
index e42daffe8f6..b155b5ffe9f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ForLoopTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ForLoopTree.java
@@ -42,7 +42,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ForLoopTree extends StatementTree {
/**
* Returns any initializers of the {@code for} statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IdentifierTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IdentifierTree.java
index 3f2a2f49249..bb37699a97b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IdentifierTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IdentifierTree.java
@@ -41,7 +41,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface IdentifierTree extends ExpressionTree {
/**
* Returns the name of the identifier.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IfTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IfTree.java
index f5790c7ea93..6358e3a088a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IfTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IfTree.java
@@ -45,7 +45,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface IfTree extends StatementTree {
/**
* Returns the condition of the if-statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ImportTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ImportTree.java
index dfd57e5496b..0b0c19274f3 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ImportTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ImportTree.java
@@ -41,7 +41,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ImportTree extends Tree {
/**
* Returns true if this is a static import declaration.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java
index 7766482daf1..1bd27b6d7de 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/InstanceOfTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface InstanceOfTree extends ExpressionTree {
/**
* Returns the expression to be tested.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IntersectionTypeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IntersectionTypeTree.java
index 0b2790a784e..c7b77a0e76d 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IntersectionTypeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/IntersectionTypeTree.java
@@ -34,7 +34,6 @@ import java.util.List;
*
* @since 1.8
*/
-@jdk.Exported
public interface IntersectionTypeTree extends Tree {
/**
* Returns the bounds of the type.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LabeledStatementTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LabeledStatementTree.java
index 3fe724e01f7..966cf02f228 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LabeledStatementTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LabeledStatementTree.java
@@ -41,7 +41,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface LabeledStatementTree extends StatementTree {
/**
* Returns the label.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LambdaExpressionTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LambdaExpressionTree.java
index 9f3c988d1cb..4efa546bea3 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LambdaExpressionTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LambdaExpressionTree.java
@@ -37,7 +37,6 @@ import java.util.List;
* (x,y)-> { return x + y; }
* }
*/
-@jdk.Exported
public interface LambdaExpressionTree extends ExpressionTree {
/**
@@ -47,7 +46,6 @@ public interface LambdaExpressionTree extends ExpressionTree {
*
statement lambdas, whose body is a block
*
*/
- @jdk.Exported
public enum BodyKind {
/** enum constant for expression lambdas */
EXPRESSION,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LineMap.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LineMap.java
index 7a396d1270f..711f63a0dbd 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LineMap.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LineMap.java
@@ -31,7 +31,6 @@ package com.sun.source.tree;
*
* @since 1.6
*/
-@jdk.Exported
public interface LineMap {
/**
* Finds the start position of a line.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LiteralTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LiteralTree.java
index 4c8fa521e81..c4cb9ca3cd2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LiteralTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/LiteralTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface LiteralTree extends ExpressionTree {
/**
* Returns the value of the literal expression.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberReferenceTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberReferenceTree.java
index 23c77bfb21c..d9c48855e81 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberReferenceTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberReferenceTree.java
@@ -39,14 +39,12 @@ import javax.lang.model.element.Name;
*
* @since 1.8
*/
-@jdk.Exported
public interface MemberReferenceTree extends ExpressionTree {
/**
* There are two kinds of member references: (i) method references and
* (ii) constructor references
*/
- @jdk.Exported
public enum ReferenceMode {
/** enum constant for method references. */
INVOKE,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberSelectTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberSelectTree.java
index dac747208fc..1834e88ddaa 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberSelectTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MemberSelectTree.java
@@ -41,7 +41,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface MemberSelectTree extends ExpressionTree {
/**
* Returns the expression for which a member is to be selected.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodInvocationTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodInvocationTree.java
index 3e7088b6dd0..3d04dddcfaf 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodInvocationTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodInvocationTree.java
@@ -43,7 +43,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface MethodInvocationTree extends ExpressionTree {
/**
* Returns the type arguments for this method invocation.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodTree.java
index f16c521953b..83756d1cd40 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/MethodTree.java
@@ -46,7 +46,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface MethodTree extends Tree {
/**
* Returns the modifiers, including any annotations for the method being declared.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ModifiersTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ModifiersTree.java
index 1dd45fb0ebc..6aebf0de8e6 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ModifiersTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ModifiersTree.java
@@ -45,7 +45,6 @@ import javax.lang.model.element.Modifier;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ModifiersTree extends Tree {
/**
* Returns the flags in this modifiers tree.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewArrayTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewArrayTree.java
index beea5bb23f3..0b52c880660 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewArrayTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewArrayTree.java
@@ -43,7 +43,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface NewArrayTree extends ExpressionTree {
/**
* Returns the base type of the expression.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewClassTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewClassTree.java
index b82faaf9669..34f3013a218 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewClassTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/NewClassTree.java
@@ -48,7 +48,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface NewClassTree extends ExpressionTree {
/**
* Returns the enclosing expression, or {@code null} if none.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PackageTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PackageTree.java
index 8d722f6afb2..1ab65a6cd3c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PackageTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PackageTree.java
@@ -33,9 +33,8 @@ import java.util.List;
* @jls sections 7.3, and 7.4
*
* @author Paul Govereau
- * @since 1.9
+ * @since 9
*/
-@jdk.Exported
public interface PackageTree extends Tree {
/**
* Returns the annotations associated with this package declaration.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParameterizedTypeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParameterizedTypeTree.java
index 99f5b751289..93f3091df15 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParameterizedTypeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParameterizedTypeTree.java
@@ -41,7 +41,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ParameterizedTypeTree extends Tree {
/**
* Returns the base type.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParenthesizedTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParenthesizedTree.java
index 02eb7b3cc01..ab4d9bd669a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParenthesizedTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ParenthesizedTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ParenthesizedTree extends ExpressionTree {
/**
* Returns the expression within the parentheses.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PrimitiveTypeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PrimitiveTypeTree.java
index 4d509a7fb4e..72d4eba47f2 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PrimitiveTypeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/PrimitiveTypeTree.java
@@ -41,7 +41,6 @@ import javax.lang.model.type.TypeKind;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface PrimitiveTypeTree extends Tree {
/**
* Returns the kind of this primitive type.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ReturnTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ReturnTree.java
index 6f58574436e..cabc303356f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ReturnTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ReturnTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ReturnTree extends StatementTree {
/**
* Returns the expression to be returned.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Scope.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Scope.java
index e30d9279755..d0ea08bf8ea 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Scope.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Scope.java
@@ -48,7 +48,6 @@ import javax.lang.model.element.TypeElement;
*
* @since 1.6
*/
-@jdk.Exported
public interface Scope {
/**
* Returns the enclosing scope.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/StatementTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/StatementTree.java
index c558ea28da5..442dcee6768 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/StatementTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/StatementTree.java
@@ -35,5 +35,4 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface StatementTree extends Tree {}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SwitchTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SwitchTree.java
index 76e90885ead..9e40968dc53 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SwitchTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SwitchTree.java
@@ -43,7 +43,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface SwitchTree extends StatementTree {
/**
* Returns the expression for the {@code switch} statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SynchronizedTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SynchronizedTree.java
index cb72cf731c8..51edafd76dd 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SynchronizedTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/SynchronizedTree.java
@@ -40,7 +40,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface SynchronizedTree extends StatementTree {
/**
* Returns the expression on which to synchronize.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ThrowTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ThrowTree.java
index af319f3ffe9..d23e896688c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ThrowTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/ThrowTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface ThrowTree extends StatementTree {
/**
* Returns the expression to be thrown.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java
index 8c6b08803ad..bdd0f536f5b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java
@@ -39,13 +39,11 @@ package com.sun.source.tree;
*
* @since 1.6
*/
-@jdk.Exported
public interface Tree {
/**
* Enumerates all kinds of trees.
*/
- @jdk.Exported
public enum Kind {
/**
* Used for instances of {@link AnnotatedTypeTree}
@@ -212,7 +210,7 @@ public interface Tree {
/**
* Used for instances of {@link PackageTree}.
- * @since 1.9
+ * @since 9
*/
PACKAGE(PackageTree.class),
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java
index 8f63188537a..30d2a32bc0c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TreeVisitor.java
@@ -56,7 +56,6 @@ package com.sun.source.tree;
*
* @since 1.6
*/
-@jdk.Exported
public interface TreeVisitor {
/**
* Visits an AnnotatedTypeTree node.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TryTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TryTree.java
index a02e2e5f0be..7643598fa9e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TryTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TryTree.java
@@ -45,7 +45,6 @@ import java.util.List;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface TryTree extends StatementTree {
/**
* Returns the block of the {@code try} statement.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeCastTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeCastTree.java
index 23d14e86a6f..ac86ecd2214 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeCastTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeCastTree.java
@@ -39,7 +39,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface TypeCastTree extends ExpressionTree {
/**
* Returns the target type of the cast.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeParameterTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeParameterTree.java
index 5ffd552ac3d..a911002c357 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeParameterTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/TypeParameterTree.java
@@ -46,7 +46,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface TypeParameterTree extends Tree {
/**
* Returns the name of the type parameter.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnaryTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnaryTree.java
index c9ad9210345..5ba18fd0c44 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnaryTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnaryTree.java
@@ -42,7 +42,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface UnaryTree extends ExpressionTree {
/**
* Returns the expression that is the operand of the unary operator.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnionTypeTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnionTypeTree.java
index 544366844d2..07f488fc71b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnionTypeTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/UnionTypeTree.java
@@ -35,7 +35,6 @@ import java.util.List;
*
* @since 1.7
*/
-@jdk.Exported
public interface UnionTypeTree extends Tree {
/**
* Returns the alternative type expressions.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java
index 203178b5976..9342ccd8491 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/VariableTree.java
@@ -42,7 +42,6 @@ import javax.lang.model.element.Name;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface VariableTree extends StatementTree {
/**
* Returns the modifiers, including any annotations, on the declaration.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WhileLoopTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WhileLoopTree.java
index e59a8d27a14..58597ed239f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WhileLoopTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WhileLoopTree.java
@@ -41,7 +41,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface WhileLoopTree extends StatementTree {
/**
* Returns the condition of the loop.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WildcardTree.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WildcardTree.java
index 3fad97bdec2..f5095c1aa0f 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WildcardTree.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/WildcardTree.java
@@ -44,7 +44,6 @@ package com.sun.source.tree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface WildcardTree extends Tree {
/**
* Returns the bound of the wildcard.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/package-info.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/package-info.java
index 22d1c9b52ec..9819a362835 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/package-info.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/tree/package-info.java
@@ -31,5 +31,4 @@
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
package com.sun.source.tree;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocSourcePositions.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocSourcePositions.java
index a6d5c8d9f9b..8298fac09fb 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocSourcePositions.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocSourcePositions.java
@@ -36,7 +36,6 @@ import com.sun.source.tree.CompilationUnitTree;
*
* @since 1.8
*/
-@jdk.Exported
public interface DocSourcePositions extends SourcePositions {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java
index 1ab74ebcd8a..50e9bc855b3 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java
@@ -37,7 +37,6 @@ import java.util.Objects;
*
* @since 1.8
*/
-@jdk.Exported
public class DocTreePath implements Iterable {
/**
* Returns a documentation tree path for a tree node within a compilation unit,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePathScanner.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePathScanner.java
index e12aea6d856..6e11ca1c2d3 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePathScanner.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePathScanner.java
@@ -37,7 +37,6 @@ import com.sun.source.doctree.DocTree;
*
* @since 1.8
*/
-@jdk.Exported
public class DocTreePathScanner extends DocTreeScanner {
/**
* Scans a tree from a position identified by a tree path.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
index 4866ab6b0c8..9898256d290 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java
@@ -68,7 +68,6 @@ import com.sun.tools.javac.tree.DCTree.DCIndex;
*
* @since 1.8
*/
-@jdk.Exported
public class DocTreeScanner implements DocTreeVisitor {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java
index 94537ce9704..dddbc6c1fec 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/DocTrees.java
@@ -43,7 +43,6 @@ import com.sun.source.doctree.DocTree;
*
* @since 1.8
*/
-@jdk.Exported
public abstract class DocTrees extends Trees {
/**
* Returns a DocTrees object for a given CompilationTask.
@@ -73,7 +72,7 @@ public abstract class DocTrees extends Trees {
* Returns {@code null} if none has been specified.
* @return the break iterator
*
- * @since 1.9
+ * @since 9
*/
public abstract BreakIterator getBreakIterator();
@@ -91,7 +90,7 @@ public abstract class DocTrees extends Trees {
* @param e an element whose documentation is required
* @return the doc comment tree
*
- * @since 1.9
+ * @since 9
*/
public abstract DocCommentTree getDocCommentTree(Element e);
@@ -105,7 +104,7 @@ public abstract class DocTrees extends Trees {
* @param fileObject the content container
* @return the doc comment tree
*
- * @since 1.9
+ * @since 9
*/
public abstract DocCommentTree getDocCommentTree(FileObject fileObject);
@@ -122,7 +121,7 @@ public abstract class DocTrees extends Trees {
* @return the doc comment tree
* @throws java.io.IOException if an exception occurs
*
- * @since 1.9
+ * @since 9
*/
public abstract DocCommentTree getDocCommentTree(Element e, String relativePath) throws IOException;
@@ -141,7 +140,7 @@ public abstract class DocTrees extends Trees {
* @param list the DocTree list to interrogate
* @return the first sentence
*
- * @since 1.9
+ * @since 9
*/
public abstract List getFirstSentence(List extends DocTree> list);
@@ -173,7 +172,7 @@ public abstract class DocTrees extends Trees {
* @param breakiterator a break iterator or {@code null} to specify the default
* sentence breaker
*
- * @since 1.9
+ * @since 9
*/
public abstract void setBreakIterator(BreakIterator breakiterator);
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/JavacTask.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/JavacTask.java
index 622c294af88..8f1c99806c6 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/JavacTask.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/JavacTask.java
@@ -48,7 +48,6 @@ import com.sun.tools.javac.util.Context;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public abstract class JavacTask implements CompilationTask {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Plugin.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Plugin.java
index d31508a5bea..68c14f7e454 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Plugin.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Plugin.java
@@ -49,7 +49,6 @@ import javax.tools.StandardLocation;
*
* @since 1.8
*/
-@jdk.Exported
public interface Plugin {
/**
* Returns the user-friendly name of this plug-in.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
index 28a946a8f83..4f28955f1af 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java
@@ -38,7 +38,6 @@ import com.sun.source.doctree.*;
*
* @since 1.8
*/
-@jdk.Exported
public class SimpleDocTreeVisitor implements DocTreeVisitor {
/**
* The default value, returned by the {@link #defaultAction default action}.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java
index 28bd802f253..a7e5740ca5b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SimpleTreeVisitor.java
@@ -39,7 +39,6 @@ import com.sun.source.tree.*;
* @author Peter von der Ahé
* @since 1.6
*/
-@jdk.Exported
public class SimpleTreeVisitor implements TreeVisitor {
/**
* The default value, returned by the {@link #defaultAction default action}.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SourcePositions.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SourcePositions.java
index 7a2054b3469..4f5bbbcdac7 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SourcePositions.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/SourcePositions.java
@@ -35,7 +35,6 @@ import com.sun.source.tree.*;
* @author Peter von der Ahé
* @since 1.6
*/
-@jdk.Exported
public interface SourcePositions {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskEvent.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskEvent.java
index 9ead33e0aeb..6a116ab93a1 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskEvent.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskEvent.java
@@ -36,14 +36,12 @@ import com.sun.source.tree.CompilationUnitTree;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public final class TaskEvent
{
/**
* Kind of task event.
* @since 1.6
*/
- @jdk.Exported
public enum Kind {
/**
* For events related to the parsing of a file.
@@ -74,7 +72,7 @@ public final class TaskEvent
* This event is not sent when using {@link JavacTask#parse()},
* {@link JavacTask#analyze()} or {@link JavacTask#generate()}.
*
- * @since 1.9
+ * @since 9
*/
COMPILATION,
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskListener.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskListener.java
index 9a57b134add..eef9389685c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskListener.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TaskListener.java
@@ -32,7 +32,6 @@ package com.sun.source.util;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public interface TaskListener
{
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePath.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePath.java
index 4c7e395685b..3040d1f3142 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePath.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePath.java
@@ -37,7 +37,6 @@ import com.sun.source.tree.*;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public class TreePath implements Iterable {
/**
* Returns a tree path for a tree node within a compilation unit,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePathScanner.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePathScanner.java
index a07f829096c..46a3e1e547c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePathScanner.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreePathScanner.java
@@ -38,7 +38,6 @@ import com.sun.source.tree.*;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public class TreePathScanner extends TreeScanner {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
index 275d9c8fb9c..3e37f6f1914 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
@@ -74,7 +74,6 @@ import com.sun.source.tree.*;
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
public class TreeScanner implements TreeVisitor {
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java
index 5e464c71de3..3f72336c779 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/Trees.java
@@ -51,7 +51,6 @@ import com.sun.source.tree.Tree;
*
* @author Peter von der Ahé
*/
-@jdk.Exported
public abstract class Trees {
/**
* Returns a Trees object for a given CompilationTask.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/package-info.java b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/package-info.java
index 01a7888e682..65afc0bf833 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/source/util/package-info.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/source/util/package-info.java
@@ -30,5 +30,4 @@
* @author Jonathan Gibbons
* @since 1.6
*/
-@jdk.Exported
package com.sun.source.util;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/Main.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/Main.java
index 5ad9d4b78f6..6d35e1dded8 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/Main.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/Main.java
@@ -31,7 +31,6 @@ import java.io.PrintWriter;
* The programmatic interface for the Java Programming Language
* compiler, javac.
*/
-@jdk.Exported
public class Main {
/** Main entry point for the launcher.
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
index 590ca4377c0..33029b46497 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
@@ -1146,14 +1146,21 @@ public class Types {
if (!visit(supertype(t), supertype(s)))
return false;
- HashSet set = new HashSet<>();
- for (Type x : interfaces(t))
- set.add(new UniqueType(x, Types.this));
- for (Type x : interfaces(s)) {
- if (!set.remove(new UniqueType(x, Types.this)))
+ Map tMap = new HashMap<>();
+ for (Type ti : interfaces(t)) {
+ if (tMap.containsKey(ti)) {
+ throw new AssertionError("Malformed intersection");
+ }
+ tMap.put(ti.tsym, ti);
+ }
+ for (Type si : interfaces(s)) {
+ if (!tMap.containsKey(si.tsym))
+ return false;
+ Type ti = tMap.remove(si.tsym);
+ if (!visit(ti, si))
return false;
}
- return (set.isEmpty());
+ return tMap.isEmpty();
}
return t.tsym == s.tsym
&& visit(t.getEnclosingType(), s.getEnclosingType())
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
index 557b921e20f..b5dfb11dc42 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java
@@ -1137,7 +1137,56 @@ public class Resolve {
/** Parameters {@code t} and {@code s} are unrelated functional interface types. */
private boolean functionalInterfaceMostSpecific(Type t, Type s, JCTree tree) {
- FunctionalInterfaceMostSpecificChecker msc = new FunctionalInterfaceMostSpecificChecker(t, s);
+ Type tDesc = types.findDescriptorType(t);
+ Type sDesc = types.findDescriptorType(s);
+
+ // compare type parameters -- can't use Types.hasSameBounds because bounds may have ivars
+ final List tTypeParams = tDesc.getTypeArguments();
+ final List sTypeParams = sDesc.getTypeArguments();
+ List tIter = tTypeParams;
+ List sIter = sTypeParams;
+ while (tIter.nonEmpty() && sIter.nonEmpty()) {
+ Type tBound = tIter.head.getUpperBound();
+ Type sBound = types.subst(sIter.head.getUpperBound(), sTypeParams, tTypeParams);
+ if (tBound.containsAny(tTypeParams) && inferenceContext().free(sBound)) {
+ return false;
+ }
+ if (!types.isSameType(tBound, inferenceContext().asUndetVar(sBound))) {
+ return false;
+ }
+ tIter = tIter.tail;
+ sIter = sIter.tail;
+ }
+ if (!tIter.isEmpty() || !sIter.isEmpty()) {
+ return false;
+ }
+
+ // compare parameters
+ List tParams = tDesc.getParameterTypes();
+ List sParams = sDesc.getParameterTypes();
+ while (tParams.nonEmpty() && sParams.nonEmpty()) {
+ Type tParam = tParams.head;
+ Type sParam = types.subst(sParams.head, sTypeParams, tTypeParams);
+ if (tParam.containsAny(tTypeParams) && inferenceContext().free(sParam)) {
+ return false;
+ }
+ if (!types.isSameType(tParam, inferenceContext().asUndetVar(sParam))) {
+ return false;
+ }
+ tParams = tParams.tail;
+ sParams = sParams.tail;
+ }
+ if (!tParams.isEmpty() || !sParams.isEmpty()) {
+ return false;
+ }
+
+ // compare returns
+ Type tRet = tDesc.getReturnType();
+ Type sRet = types.subst(sDesc.getReturnType(), sTypeParams, tTypeParams);
+ if (tRet.containsAny(tTypeParams) && inferenceContext().free(sRet)) {
+ return false;
+ }
+ MostSpecificFunctionReturnChecker msc = new MostSpecificFunctionReturnChecker(tRet, sRet);
msc.scan(tree);
return msc.result;
}
@@ -1146,16 +1195,16 @@ public class Resolve {
* Tests whether one functional interface type can be considered more specific
* than another unrelated functional interface type for the scanned expression.
*/
- class FunctionalInterfaceMostSpecificChecker extends DeferredAttr.PolyScanner {
+ class MostSpecificFunctionReturnChecker extends DeferredAttr.PolyScanner {
- final Type t;
- final Type s;
+ final Type tRet;
+ final Type sRet;
boolean result;
/** Parameters {@code t} and {@code s} are unrelated functional interface types. */
- FunctionalInterfaceMostSpecificChecker(Type t, Type s) {
- this.t = t;
- this.s = s;
+ MostSpecificFunctionReturnChecker(Type tRet, Type sRet) {
+ this.tRet = tRet;
+ this.sRet = sRet;
result = true;
}
@@ -1172,29 +1221,18 @@ public class Resolve {
@Override
public void visitReference(JCMemberReference tree) {
- Type desc_t = types.findDescriptorType(t);
- Type desc_s = types.findDescriptorType(s);
- // use inference variables here for more-specific inference (18.5.4)
- if (!types.isSameTypes(desc_t.getParameterTypes(),
- inferenceContext().asUndetVars(desc_s.getParameterTypes()))) {
+ if (sRet.hasTag(VOID)) {
+ result &= true;
+ } else if (tRet.hasTag(VOID)) {
result &= false;
+ } else if (tRet.isPrimitive() != sRet.isPrimitive()) {
+ boolean retValIsPrimitive =
+ tree.refPolyKind == PolyKind.STANDALONE &&
+ tree.sym.type.getReturnType().isPrimitive();
+ result &= (retValIsPrimitive == tRet.isPrimitive()) &&
+ (retValIsPrimitive != sRet.isPrimitive());
} else {
- // compare return types
- Type ret_t = desc_t.getReturnType();
- Type ret_s = desc_s.getReturnType();
- if (ret_s.hasTag(VOID)) {
- result &= true;
- } else if (ret_t.hasTag(VOID)) {
- result &= false;
- } else if (ret_t.isPrimitive() != ret_s.isPrimitive()) {
- boolean retValIsPrimitive =
- tree.refPolyKind == PolyKind.STANDALONE &&
- tree.sym.type.getReturnType().isPrimitive();
- result &= (retValIsPrimitive == ret_t.isPrimitive()) &&
- (retValIsPrimitive != ret_s.isPrimitive());
- } else {
- result &= compatibleBySubtyping(ret_t, ret_s);
- }
+ result &= compatibleBySubtyping(tRet, sRet);
}
}
@@ -1205,32 +1243,24 @@ public class Resolve {
@Override
public void visitLambda(JCLambda tree) {
- Type desc_t = types.findDescriptorType(t);
- Type desc_s = types.findDescriptorType(s);
- // use inference variables here for more-specific inference (18.5.4)
- if (!types.isSameTypes(desc_t.getParameterTypes(),
- inferenceContext().asUndetVars(desc_s.getParameterTypes()))) {
+ if (sRet.hasTag(VOID)) {
+ result &= true;
+ } else if (tRet.hasTag(VOID)) {
result &= false;
} else {
- // compare return types
- Type ret_t = desc_t.getReturnType();
- Type ret_s = desc_s.getReturnType();
- if (ret_s.hasTag(VOID)) {
- result &= true;
- } else if (ret_t.hasTag(VOID)) {
- result &= false;
- } else if (unrelatedFunctionalInterfaces(ret_t, ret_s)) {
- for (JCExpression expr : lambdaResults(tree)) {
- result &= functionalInterfaceMostSpecific(ret_t, ret_s, expr);
+ List lambdaResults = lambdaResults(tree);
+ if (!lambdaResults.isEmpty() && unrelatedFunctionalInterfaces(tRet, sRet)) {
+ for (JCExpression expr : lambdaResults) {
+ result &= functionalInterfaceMostSpecific(tRet, sRet, expr);
}
- } else if (ret_t.isPrimitive() != ret_s.isPrimitive()) {
- for (JCExpression expr : lambdaResults(tree)) {
+ } else if (!lambdaResults.isEmpty() && tRet.isPrimitive() != sRet.isPrimitive()) {
+ for (JCExpression expr : lambdaResults) {
boolean retValIsPrimitive = expr.isStandalone() && expr.type.isPrimitive();
- result &= (retValIsPrimitive == ret_t.isPrimitive()) &&
- (retValIsPrimitive != ret_s.isPrimitive());
+ result &= (retValIsPrimitive == tRet.isPrimitive()) &&
+ (retValIsPrimitive != sRet.isPrimitive());
}
} else {
- result &= compatibleBySubtyping(ret_t, ret_s);
+ result &= compatibleBySubtyping(tRet, sRet);
}
}
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
index ba68b58457a..28be92d14df 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, 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
@@ -301,15 +301,16 @@ public class JavaTokenizer {
}
/** Read a number.
- * @param radix The radix of the number; one of 2, j8, 10, 16.
+ * @param radix The radix of the number; one of 2, 8, 10, 16.
*/
private void scanNumber(int pos, int radix) {
// for octal, allow base-10 digit in case it's a float literal
this.radix = radix;
int digitRadix = (radix == 8 ? 10 : radix);
- boolean seendigit = false;
- if (reader.digit(pos, digitRadix) >= 0) {
- seendigit = true;
+ int firstDigit = reader.digit(pos, Math.max(10, digitRadix));
+ boolean seendigit = firstDigit >= 0;
+ boolean seenValidDigit = firstDigit >= 0 && firstDigit < digitRadix;
+ if (seendigit) {
scanDigits(pos, digitRadix);
}
if (radix == 16 && reader.ch == '.') {
@@ -325,6 +326,16 @@ public class JavaTokenizer {
reader.ch == 'd' || reader.ch == 'D')) {
scanFractionAndSuffix(pos);
} else {
+ if (!seenValidDigit) {
+ switch (radix) {
+ case 2:
+ lexError(pos, "invalid.binary.number");
+ break;
+ case 16:
+ lexError(pos, "invalid.hex.number");
+ break;
+ }
+ }
if (reader.ch == 'l' || reader.ch == 'L') {
reader.scanChar();
tk = TokenKind.LONGLITERAL;
@@ -491,13 +502,7 @@ public class JavaTokenizer {
if (reader.ch == 'x' || reader.ch == 'X') {
reader.scanChar();
skipIllegalUnderscores();
- if (reader.ch == '.') {
- scanHexFractionAndSuffix(pos, false);
- } else if (reader.digit(pos, 16) < 0) {
- lexError(pos, "invalid.hex.number");
- } else {
- scanNumber(pos, 16);
- }
+ scanNumber(pos, 16);
} else if (reader.ch == 'b' || reader.ch == 'B') {
if (!allowBinaryLiterals) {
lexError(pos, "unsupported.binary.lit", source.name);
@@ -505,11 +510,7 @@ public class JavaTokenizer {
}
reader.scanChar();
skipIllegalUnderscores();
- if (reader.digit(pos, 2) < 0) {
- lexError(pos, "invalid.binary.number");
- } else {
- scanNumber(pos, 2);
- }
+ scanNumber(pos, 2);
} else {
reader.putChar('0');
if (reader.ch == '_') {
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java
index e5f461cc48a..f843a8adc52 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/platform/package-info.java
@@ -31,5 +31,4 @@
* This code and its internal interfaces are subject to change or
* deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.javac.platform;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CleanProperties.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CleanProperties.java
index 0525b47b312..03f02d8e42c 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CleanProperties.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CleanProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -66,7 +66,6 @@ public class CleanProperties implements Transformer {
public boolean transform(CompilationService sjavac,
Map> pkgSrcs,
Set visibleSrcs,
- Map> visibleClasses,
Map> oldPackageDependencies,
URI destRoot,
Map> packageArtifacts,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
index c13376ddd56..14fc859048b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileJavaPackages.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -80,7 +80,6 @@ public class CompileJavaPackages implements Transformer {
public boolean transform(final CompilationService sjavac,
Map> pkgSrcs,
final Set visibleSources,
- final Map> visibleClasses,
Map> oldPackageDependents,
URI destRoot,
final Map> packageArtifacts,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileProperties.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileProperties.java
index 18a335f584f..3ca37b547f6 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileProperties.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CompileProperties.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -74,7 +74,6 @@ public class CompileProperties implements Transformer {
public boolean transform(CompilationService compilationService,
Map> pkgSrcs,
Set visibleSrcs,
- Map> visibleClasses,
Map> oldPackageDependents,
URI destRoot,
Map> packageArtifacts,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CopyFile.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CopyFile.java
index 5b12bcc2240..5ab8d22fc7a 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CopyFile.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/CopyFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -61,7 +61,6 @@ public class CopyFile implements Transformer {
public boolean transform(CompilationService compilationService,
Map> pkgSrcs,
Set visibleSrcs,
- Map> visibleClasses,
Map> oldPackageDependents,
URI destRoot,
Map> packageArtifacts,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java
index 8e1c946fafb..114d1282fc1 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/JavacState.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -120,13 +120,6 @@ public class JavacState {
// ones that -sourcepath is allowed to see.
Set visibleSrcs;
- // Visible classes for linking. These are the only
- // ones that -classpath is allowed to see.
- // It maps from a classpath root to the set of visible classes for that root.
- // If the set is empty, then all classes are visible for that root.
- // It can also map from a jar file to the set of visible classes for that jar file.
- Map> visibleClasses;
-
// Setup transform that always exist.
private CompileJavaPackages compileJavaPackages = new CompileJavaPackages();
@@ -213,16 +206,6 @@ public class JavacState {
}
}
- /**
- * Specify which classes are visible to the compiler through -classpath.
- */
- public void setVisibleClasses(Map vs) {
- visibleSrcs = new HashSet<>();
- for (String s : vs.keySet()) {
- Source src = vs.get(s);
- visibleSrcs.add(src.file().toURI());
- }
- }
/**
* Returns true if this is an incremental build.
*/
@@ -820,7 +803,6 @@ public class JavacState {
boolean r = t.transform(sjavac,
srcs,
visibleSrcs,
- visibleClasses,
prev.dependents(),
outputDir.toURI(),
packageArtifacts,
@@ -954,8 +936,7 @@ public class JavacState {
}
}
// Read in the file and create another set of filenames with full paths.
- try {
- BufferedReader in = new BufferedReader(new FileReader(makefileSourceList));
+ try(BufferedReader in = new BufferedReader(new FileReader(makefileSourceList))) {
for (;;) {
String l = in.readLine();
if (l==null) break;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Source.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Source.java
index cc54eb57e2a..b288955b9a1 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Source.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Source.java
@@ -26,11 +26,20 @@
package com.sun.tools.sjavac;
import java.io.File;
+import java.io.IOException;
+import java.nio.file.FileSystem;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
import java.util.Set;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
+import java.util.regex.PatternSyntaxException;
/** A Source object maintains information about a source file.
* For example which package it belongs to and kind of source it is.
@@ -56,8 +65,6 @@ public class Source implements Comparable {
private long lastModified;
// The source File.
private File file;
- // The source root under which file resides.
- private File root;
// If the source is generated.
private boolean isGenerated;
// If the source is only linked to, not compiled.
@@ -78,7 +85,7 @@ public class Source implements Comparable {
return name.hashCode();
}
- public Source(Module m, String n, File f, File r) {
+ public Source(Module m, String n, File f) {
name = n;
int dp = n.lastIndexOf(".");
if (dp != -1) {
@@ -87,7 +94,6 @@ public class Source implements Comparable {
suffix = "";
}
file = f;
- root = r;
lastModified = f.lastModified();
linkedOnly = false;
}
@@ -102,7 +108,6 @@ public class Source implements Comparable {
suffix = "";
}
file = null;
- root = null;
lastModified = lm;
linkedOnly = false;
int ls = n.lastIndexOf('/');
@@ -112,7 +117,6 @@ public class Source implements Comparable {
public String suffix() { return suffix; }
public Package pkg() { return pkg; }
public File file() { return file; }
- public File root() { return root; }
public long lastModified() {
return lastModified;
}
@@ -183,225 +187,122 @@ public class Source implements Comparable {
*/
static public void scanRoot(File root,
Set suffixes,
- List excludes, List includes,
- List excludeFiles, List includeFiles,
+ List excludes,
+ List includes,
Map foundFiles,
Map foundModules,
- Module currentModule,
+ final Module currentModule,
boolean permitSourcesWithoutPackage,
boolean inGensrc,
boolean inLinksrc)
- throws ProblemException {
+ throws IOException, ProblemException {
- if (root == null) return;
- int root_prefix = root.getPath().length()+1;
- // This is the root source directory, it must not contain any Java sources files
- // because we do not allow Java source files without a package.
- // (Unless of course --permit-sources-without-package has been specified.)
- // It might contain other source files however, (for -tr and -copy) these will
- // always be included, since no package pattern can match the root directory.
- currentModule = addFilesInDir(root, root_prefix, root, suffixes, permitSourcesWithoutPackage,
- excludeFiles, includeFiles,
- foundFiles, foundModules, currentModule,
- inGensrc, inLinksrc);
+ if (root == null)
+ return;
- File[] dirfiles = root.listFiles();
- for (File d : dirfiles) {
- if (d.isDirectory()) {
- // Descend into the directory structure.
- scanDirectory(d, root_prefix, root, suffixes,
- excludes, includes, excludeFiles, includeFiles,
- foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
- }
+ FileSystem fs = root.toPath().getFileSystem();
+
+ if (includes.isEmpty()) {
+ includes = Collections.singletonList("**");
}
- }
- /**
- * Test if a path matches any of the patterns given.
- * The pattern foo/bar matches only foo/bar
- * The pattern foo/* matches foo/bar and foo/bar/zoo etc
- */
- static private boolean hasMatch(String path, List patterns) {
+ List includeMatchers = createPathMatchers(fs, includes);
+ List excludeMatchers = createPathMatchers(fs, excludes);
- // Convert Windows '\' to '/' for the sake of comparing with the patterns
- path = path.replace(File.separatorChar, '/');
+ Files.walkFileTree(root.toPath(), new SimpleFileVisitor() {
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
- for (String p : patterns) {
- // Exact match
- if (p.equals(path))
- return true;
+ Path relToRoot = root.toPath().relativize(file);
- // Single dot the end matches this package and all its subpackages.
- if (p.endsWith("/*")) {
- // Remove the wildcard
- String patprefix = p.substring(0,p.length()-2);
- // Does the path start with the pattern prefix?
- if (path.startsWith(patprefix)) {
- // If the path has the same length as the pattern prefix, then it is a match.
- // If the path is longer, then make sure that
- // the next part of the path starts with a dot (.) to prevent
- // wildcard matching in the middle of a package name.
- if (path.length()==patprefix.length() || path.charAt(patprefix.length())=='/') {
- return true;
+ if (includeMatchers.stream().anyMatch(im -> im.matches(relToRoot))
+ && excludeMatchers.stream().noneMatch(em -> em.matches(relToRoot))
+ && suffixes.contains(Util.fileSuffix(file))) {
+
+ // TODO: Test this.
+ Source existing = foundFiles.get(file);
+ if (existing != null) {
+ throw new IOException("You have already added the file "+file+" from "+existing.file().getPath());
}
- }
- }
- }
- return false;
- }
+ existing = currentModule.lookupSource(file.toString());
+ if (existing != null) {
- /**
- * Matches patterns with the asterisk first. */
- // The pattern foo/bar.java only matches foo/bar.java
- // The pattern */bar.java matches foo/bar.java and zoo/bar.java etc
- static private boolean hasFileMatch(String path, List patterns) {
- // Convert Windows '\' to '/' for the sake of comparing with the patterns
- path = path.replace(File.separatorChar, '/');
+ // Oups, the source is already added, could be ok, could be not, lets check.
+ if (inLinksrc) {
+ // So we are collecting sources for linking only.
+ if (existing.isLinkedOnly()) {
+ // Ouch, this one is also for linking only. Bad.
+ throw new IOException("You have already added the link only file " + file + " from " + existing.file().getPath());
+ }
+ // Ok, the existing source is to be compiled. Thus this link only is redundant
+ // since all compiled are also linked to. Continue to the next source.
+ // But we need to add the source, so that it will be visible to linking,
+ // if not the multi core compile will fail because a JavaCompiler cannot
+ // find the necessary dependencies for its part of the source.
+ foundFiles.put(file.toString(), existing);
+ } else {
+ // We are looking for sources to compile, if we find an existing to be compiled
+ // source with the same name, it is an internal error, since we must
+ // find the sources to be compiled before we find the sources to be linked to.
+ throw new IOException("Internal error: Double add of file " + file + " from " + existing.file().getPath());
+ }
- path = Util.normalizeDriveLetter(path);
- for (String p : patterns) {
- // Exact match
- if (p.equals(path)) {
- return true;
- }
- // Single dot the end matches this package and all its subpackages.
- if (p.startsWith("*")) {
- // Remove the wildcard
- String patsuffix = p.substring(1);
- // Does the path start with the pattern prefix?
- if (path.endsWith(patsuffix)) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Add the files in the directory, assuming that the file has not been excluded.
- * Returns a fresh Module object, if this was a dir with a module-info.java file.
- */
- static private Module addFilesInDir(File dir, int rootPrefix, File root,
- Set suffixes, boolean allow_javas,
- List excludeFiles, List includeFiles,
- Map foundFiles,
- Map foundModules,
- Module currentModule,
- boolean inGensrc,
- boolean inLinksrc)
- throws ProblemException
- {
- for (File f : dir.listFiles()) {
-
- if (!f.isFile())
- continue;
-
- boolean should_add =
- (excludeFiles == null || excludeFiles.isEmpty() || !hasFileMatch(f.getPath(), excludeFiles))
- && (includeFiles == null || includeFiles.isEmpty() || hasFileMatch(f.getPath(), includeFiles));
-
- if (!should_add)
- continue;
-
- if (!allow_javas && f.getName().endsWith(".java")) {
- throw new ProblemException("No .java files are allowed in the source root "+dir.getPath()+
- ", please remove "+f.getName());
- }
- // Extract the file name relative the root.
- String fn = f.getPath().substring(rootPrefix);
- // Extract the package name.
- int sp = fn.lastIndexOf(File.separatorChar);
- String pkg = "";
- if (sp != -1) {
- pkg = fn.substring(0,sp).replace(File.separatorChar,'.');
- }
- // Is this a module-info.java file?
- if (fn.endsWith("module-info.java")) {
- // Aha! We have recursed into a module!
- if (!currentModule.name().equals("")) {
- throw new ProblemException("You have an extra module-info.java inside a module! Please remove "+fn);
- }
- String module_name = fn.substring(0,fn.length()-16);
- currentModule = new Module(module_name, f.getPath());
- foundModules.put(module_name, currentModule);
- }
- // Extract the suffix.
- int dp = fn.lastIndexOf(".");
- String suffix = "";
- if (dp > 0) {
- suffix = fn.substring(dp);
- }
- // Should the file be added?
- if (suffixes.contains(suffix)) {
- Source of = foundFiles.get(f.getPath());
- if (of != null) {
- throw new ProblemException("You have already added the file "+fn+" from "+of.file().getPath());
- }
- of = currentModule.lookupSource(f.getPath());
- if (of != null) {
- // Oups, the source is already added, could be ok, could be not, lets check.
- if (inLinksrc) {
- // So we are collecting sources for linking only.
- if (of.isLinkedOnly()) {
- // Ouch, this one is also for linking only. Bad.
- throw new ProblemException("You have already added the link only file "+fn+" from "+of.file().getPath());
- }
- // Ok, the existing source is to be compiled. Thus this link only is redundant
- // since all compiled are also linked to. Continue to the next source.
- // But we need to add the source, so that it will be visible to linking,
- // if not the multi core compile will fail because a JavaCompiler cannot
- // find the necessary dependencies for its part of the source.
- foundFiles.put(f.getPath(), of);
- continue;
} else {
- // We are looking for sources to compile, if we find an existing to be compiled
- // source with the same name, it is an internal error, since we must
- // find the sources to be compiled before we find the sources to be linked to.
- throw new ProblemException("Internal error: Double add of file "+fn+" from "+of.file().getPath());
+
+ //////////////////////////////////////////////////////////////
+ // Add source
+ Source s = new Source(currentModule, file.toString(), file.toFile());
+ if (inGensrc) {
+ s.markAsGenerated();
+ }
+ if (inLinksrc) {
+ s.markAsLinkedOnly();
+ }
+ String pkg = packageOfJavaFile(root.toPath(), file);
+ pkg = currentModule.name() + ":" + pkg;
+ foundFiles.put(file.toString(), s);
+ currentModule.addSource(pkg, s);
+ //////////////////////////////////////////////////////////////
}
}
- Source s = new Source(currentModule, f.getPath(), f, root);
- if (inGensrc) s.markAsGenerated();
- if (inLinksrc) {
- s.markAsLinkedOnly();
- }
- pkg = currentModule.name()+":"+pkg;
- foundFiles.put(f.getPath(), s);
- currentModule.addSource(pkg, s);
+
+ return FileVisitResult.CONTINUE;
}
- }
- return currentModule;
+ });
}
- static private void scanDirectory(File dir, int rootPrefix, File root,
- Set suffixes,
- List excludes, List includes,
- List excludeFiles, List includeFiles,
- Map foundFiles,
- Map foundModules,
- Module currentModule, boolean inGensrc, boolean inLinksrc)
- throws ProblemException {
-
- String path = "";
- // Remove the root prefix from the dir path
- if (dir.getPath().length() > rootPrefix) {
- path = dir.getPath().substring(rootPrefix);
- }
- // Should this package directory be included and not excluded?
- if ((includes==null || includes.isEmpty() || hasMatch(path, includes)) &&
- (excludes==null || excludes.isEmpty() || !hasMatch(path, excludes))) {
- // Add the source files.
- currentModule = addFilesInDir(dir, rootPrefix, root, suffixes, true, excludeFiles, includeFiles,
- foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
- }
-
- for (File d : dir.listFiles()) {
- if (d.isDirectory()) {
- // Descend into the directory structure.
- scanDirectory(d, rootPrefix, root, suffixes,
- excludes, includes, excludeFiles, includeFiles,
- foundFiles, foundModules, currentModule, inGensrc, inLinksrc);
+ private static List createPathMatchers(FileSystem fs, List patterns) {
+ List matchers = new ArrayList<>();
+ for (String pattern : patterns) {
+ try {
+ matchers.add(fs.getPathMatcher("glob:" + pattern));
+ } catch (PatternSyntaxException e) {
+ Log.error("Invalid pattern: " + pattern);
+ throw e;
}
}
+ return matchers;
+ }
+
+ private static String packageOfJavaFile(Path sourceRoot, Path javaFile) {
+ Path javaFileDir = javaFile.getParent();
+ Path packageDir = sourceRoot.relativize(javaFileDir);
+ List separateDirs = new ArrayList<>();
+ for (Path pathElement : packageDir) {
+ separateDirs.add(pathElement.getFileName().toString());
+ }
+ return String.join(".", separateDirs);
+ }
+
+ @Override
+ public String toString() {
+ return String.format("%s[pkg: %s, name: %s, suffix: %s, file: %s, isGenerated: %b, linkedOnly: %b]",
+ getClass().getSimpleName(),
+ pkg,
+ name,
+ suffix,
+ file,
+ isGenerated,
+ linkedOnly);
}
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Transformer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Transformer.java
index 93e14190bcf..7fcac272176 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Transformer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Transformer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -86,7 +86,6 @@ public interface Transformer {
boolean transform(CompilationService sjavac,
Map> pkgSrcs,
Set visibleSources,
- Map> visibleClasses,
Map> oldPackageDependencies,
URI destRoot,
Map> packageArtifacts,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Util.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Util.java
index 5d137ef8be7..03fcc537244 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Util.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/Util.java
@@ -230,4 +230,10 @@ public class Util {
Function super T, ? extends I> indexFunction) {
return c.stream().collect(Collectors.toMap(indexFunction, o -> o));
}
+
+ public static String fileSuffix(Path file) {
+ String fileNameStr = file.getFileName().toString();
+ int dotIndex = fileNameStr.indexOf('.');
+ return dotIndex == -1 ? "" : fileNameStr.substring(dotIndex);
+ }
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java
index 092501b483b..5a6194acb8e 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/comp/SjavacImpl.java
@@ -144,77 +144,77 @@ public class SjavacImpl implements Sjavac {
Module current_module = new Module("", "");
modules.put("", current_module);
- // Find all sources, use the suffix rules to know which files are sources.
- Map sources = new HashMap<>();
-
- // Find the files, this will automatically populate the found modules
- // with found packages where the sources are found!
- findSourceFiles(options.getSources(),
- suffixRules.keySet(),
- sources,
- modules,
- current_module,
- options.isDefaultPackagePermitted(),
- false);
-
- if (sources.isEmpty()) {
- Log.error("Found nothing to compile!");
- return RC_FATAL;
- }
-
-
- // Create a map of all source files that are available for linking. Both -src and
- // -sourcepath point to such files. It is possible to specify multiple
- // -sourcepath options to enable different filtering rules. If the
- // filters are the same for multiple sourcepaths, they may be concatenated
- // using :(;). Before sending the list of sourcepaths to javac, they are
- // all concatenated. The list created here is used by the SmartFileWrapper to
- // make sure only the correct sources are actually available.
- // We might find more modules here as well.
- Map sources_to_link_to = new HashMap<>();
-
- List sourceResolutionLocations = new ArrayList<>();
- sourceResolutionLocations.addAll(options.getSources());
- sourceResolutionLocations.addAll(options.getSourceSearchPaths());
- findSourceFiles(sourceResolutionLocations,
- Collections.singleton(".java"),
- sources_to_link_to,
- modules,
- current_module,
- options.isDefaultPackagePermitted(),
- true);
-
- // Add the set of sources to the build database.
- javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
- javac_state.now().checkInternalState("checking sources", false, sources);
- javac_state.now().checkInternalState("checking linked sources", true, sources_to_link_to);
- javac_state.setVisibleSources(sources_to_link_to);
-
- int round = 0;
- printRound(round);
-
- // If there is any change in the source files, taint packages
- // and mark the database in need of saving.
- javac_state.checkSourceStatus(false);
-
- // Find all existing artifacts. Their timestamp will match the last modified timestamps stored
- // in javac_state, simply because loading of the JavacState will clean out all artifacts
- // that do not match the javac_state database.
- javac_state.findAllArtifacts();
-
- // Remove unidentified artifacts from the bin, gensrc and header dirs.
- // (Unless we allow them to be there.)
- // I.e. artifacts that are not known according to the build database (javac_state).
- // For examples, files that have been manually copied into these dirs.
- // Artifacts with bad timestamps (ie the on disk timestamp does not match the timestamp
- // in javac_state) have already been removed when the javac_state was loaded.
- if (!options.areUnidentifiedArtifactsPermitted()) {
- javac_state.removeUnidentifiedArtifacts();
- }
- // Go through all sources and taint all packages that miss artifacts.
- javac_state.taintPackagesThatMissArtifacts();
-
try {
+ // Find all sources, use the suffix rules to know which files are sources.
+ Map sources = new HashMap<>();
+
+ // Find the files, this will automatically populate the found modules
+ // with found packages where the sources are found!
+ findSourceFiles(options.getSources(),
+ suffixRules.keySet(),
+ sources,
+ modules,
+ current_module,
+ options.isDefaultPackagePermitted(),
+ false);
+
+ if (sources.isEmpty()) {
+ Log.error("Found nothing to compile!");
+ return RC_FATAL;
+ }
+
+
+ // Create a map of all source files that are available for linking. Both -src and
+ // -sourcepath point to such files. It is possible to specify multiple
+ // -sourcepath options to enable different filtering rules. If the
+ // filters are the same for multiple sourcepaths, they may be concatenated
+ // using :(;). Before sending the list of sourcepaths to javac, they are
+ // all concatenated. The list created here is used by the SmartFileWrapper to
+ // make sure only the correct sources are actually available.
+ // We might find more modules here as well.
+ Map sources_to_link_to = new HashMap<>();
+
+ List sourceResolutionLocations = new ArrayList<>();
+ sourceResolutionLocations.addAll(options.getSources());
+ sourceResolutionLocations.addAll(options.getSourceSearchPaths());
+ findSourceFiles(sourceResolutionLocations,
+ Collections.singleton(".java"),
+ sources_to_link_to,
+ modules,
+ current_module,
+ options.isDefaultPackagePermitted(),
+ true);
+
+ // Add the set of sources to the build database.
+ javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
+ javac_state.now().checkInternalState("checking sources", false, sources);
+ javac_state.now().checkInternalState("checking linked sources", true, sources_to_link_to);
+ javac_state.setVisibleSources(sources_to_link_to);
+
+ int round = 0;
+ printRound(round);
+
+ // If there is any change in the source files, taint packages
+ // and mark the database in need of saving.
+ javac_state.checkSourceStatus(false);
+
+ // Find all existing artifacts. Their timestamp will match the last modified timestamps stored
+ // in javac_state, simply because loading of the JavacState will clean out all artifacts
+ // that do not match the javac_state database.
+ javac_state.findAllArtifacts();
+
+ // Remove unidentified artifacts from the bin, gensrc and header dirs.
+ // (Unless we allow them to be there.)
+ // I.e. artifacts that are not known according to the build database (javac_state).
+ // For examples, files that have been manually copied into these dirs.
+ // Artifacts with bad timestamps (ie the on disk timestamp does not match the timestamp
+ // in javac_state) have already been removed when the javac_state was loaded.
+ if (!options.areUnidentifiedArtifactsPermitted()) {
+ javac_state.removeUnidentifiedArtifacts();
+ }
+ // Go through all sources and taint all packages that miss artifacts.
+ javac_state.taintPackagesThatMissArtifacts();
+
// Check recorded classpath public apis. Taint packages that depend on
// classpath classes whose public apis have changed.
javac_state.taintPackagesDependingOnChangedClasspathPackages();
@@ -229,8 +229,16 @@ public class SjavacImpl implements Sjavac {
// (Generated sources must always have a package.)
Map generated_sources = new HashMap<>();
- Source.scanRoot(Util.pathToFile(options.getGenSrcDir()), Util.set(".java"), null, null, null, null,
- generated_sources, modules, current_module, false, true, false);
+ Source.scanRoot(Util.pathToFile(options.getGenSrcDir()),
+ Util.set(".java"),
+ Collections.emptyList(),
+ Collections.emptyList(),
+ generated_sources,
+ modules,
+ current_module,
+ false,
+ true,
+ false);
javac_state.now().flattenPackagesSourcesAndArtifacts(modules);
// Recheck the the source files and their timestamps again.
javac_state.checkSourceStatus(true);
@@ -254,7 +262,10 @@ public class SjavacImpl implements Sjavac {
printRound(round);
// Clean out artifacts in tainted packages.
javac_state.deleteClassArtifactsInTaintedPackages();
- again = javac_state.performJavaCompilations(compilationService, options, recently_compiled, rc);
+ again = javac_state.performJavaCompilations(compilationService,
+ options,
+ recently_compiled,
+ rc);
if (!rc[0]) {
Log.debug("Compilation failed.");
break;
@@ -344,7 +355,8 @@ public class SjavacImpl implements Sjavac {
Map foundModules,
Module currentModule,
boolean permitSourcesInDefaultPackage,
- boolean inLinksrc) {
+ boolean inLinksrc)
+ throws IOException {
for (SourceLocation source : sourceLocations) {
source.findSourceFiles(sourceTypes,
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java
index 364c48b4117..d64d3182cc0 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Option.java
@@ -93,7 +93,7 @@ public enum Option {
CLASSPATH.processMatching(iter, helper);
}
},
- X("-x", "Exclude directory from the subsequent source directory") {
+ X("-x", "Exclude files matching the given pattern") {
@Override
protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
String pattern = getFilePatternArg(iter, helper);
@@ -101,7 +101,7 @@ public enum Option {
helper.exclude(pattern);
}
},
- I("-i", "Include only the given directory from the subsequent source directory") {
+ I("-i", "Include only files matching the given pattern") {
@Override
protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
String pattern = getFilePatternArg(iter, helper);
@@ -109,22 +109,6 @@ public enum Option {
helper.include(pattern);
}
},
- XF("-xf", "Exclude a given file") {
- @Override
- protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
- String pattern = getFilePatternArg(iter, helper);
- if (pattern != null)
- helper.excludeFile(pattern);
- }
- },
- IF("-if", "Include only the given file") {
- @Override
- protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
- String pattern = getFilePatternArg(iter, helper);
- if (pattern != null)
- helper.includeFile(pattern);
- }
- },
TR("-tr", "Translate resources") {
@Override
protected void processMatching(ArgumentIterator iter, OptionHelper helper) {
@@ -338,7 +322,7 @@ public enum Option {
String getFilePatternArg(ArgumentIterator iter, OptionHelper helper) {
if (!iter.hasNext()) {
- helper.reportError(arg + " must be followed by a file or directory pattern.");
+ helper.reportError(arg + " must be followed by a glob pattern.");
return null;
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java
index 7f3304a4008..709bf835a5b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/OptionHelper.java
@@ -53,12 +53,6 @@ public abstract class OptionHelper {
/** Record a package inclusion pattern */
public abstract void include(String incl);
- /** Record a file exclusion */
- public abstract void excludeFile(String exclFile);
-
- /** Record a file inclusion */
- public abstract void includeFile(String inclFile);
-
/** Record a root of sources to be compiled */
public abstract void sourceRoots(List path);
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java
index 6b4fbf7ef98..61d1ec13545 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/Options.java
@@ -220,8 +220,6 @@ public class Options {
for (SourceLocation sl : locs) {
for (String pkg : sl.includes) addArg(Option.I, pkg);
for (String pkg : sl.excludes) addArg(Option.X, pkg);
- for (String f : sl.excludedFiles) addArg(Option.XF, f);
- for (String f : sl.includedFiles) addArg(Option.IF, f);
addArg(opt, sl.getPath());
}
}
@@ -379,18 +377,6 @@ public class Options {
includes.add(inclPattern);
}
- @Override
- public void excludeFile(String exclFilePattern) {
- exclFilePattern = Util.normalizeDriveLetter(exclFilePattern);
- excludeFiles.add(exclFilePattern);
- }
-
- @Override
- public void includeFile(String inclFilePattern) {
- inclFilePattern = Util.normalizeDriveLetter(inclFilePattern);
- includeFiles.add(inclFilePattern);
- }
-
@Override
public void addTransformer(String suffix, Transformer tr) {
if (trRules.containsKey(suffix)) {
@@ -519,9 +505,7 @@ public class Options {
result.add(new SourceLocation(
path,
includes,
- excludes,
- includeFiles,
- excludeFiles));
+ excludes));
}
resetFilters();
return result;
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/SourceLocation.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/SourceLocation.java
index ecc5b96c8c6..2b6b12c27f5 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/SourceLocation.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/options/SourceLocation.java
@@ -25,11 +25,13 @@
package com.sun.tools.sjavac.options;
+import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import com.sun.tools.sjavac.Log;
import com.sun.tools.sjavac.Module;
import com.sun.tools.sjavac.ProblemException;
import com.sun.tools.sjavac.Source;
@@ -49,18 +51,14 @@ public class SourceLocation {
private Path path;
// Package include / exclude patterns and file includes / excludes.
- List includes, excludes, includedFiles, excludedFiles;
+ List includes, excludes;
public SourceLocation(Path path,
List includes,
- List excludes,
- List includedFiles,
- List excludedFiles) {
+ List excludes) {
this.path = path;
this.includes = includes;
this.excludes = excludes;
- this.includedFiles = includedFiles;
- this.excludedFiles = excludedFiles;
}
@@ -81,17 +79,23 @@ public class SourceLocation {
Map foundModules,
Module currentModule,
boolean permitSourcesInDefaultPackage,
- boolean inLinksrc) {
+ boolean inLinksrc)
+ throws IOException {
try {
- Source.scanRoot(path.toFile(), suffixes, excludes, includes,
- excludedFiles, includedFiles, foundFiles, foundModules,
- currentModule, permitSourcesInDefaultPackage, false,
- inLinksrc);
+ Source.scanRoot(path.toFile(),
+ suffixes,
+ excludes,
+ includes,
+ foundFiles,
+ foundModules,
+ currentModule,
+ permitSourcesInDefaultPackage,
+ false,
+ inLinksrc);
} catch (ProblemException e) {
e.printStackTrace();
}
}
-
/** Get the root directory of this source location */
public Path getPath() {
return path;
@@ -107,14 +111,9 @@ public class SourceLocation {
return excludes;
}
- /** Get the file include patterns */
- public List getIncludedFiles() {
- return includedFiles;
+ @Override
+ public String toString() {
+ return String.format("%s[\"%s\", includes: %s, excludes: %s]",
+ getClass().getSimpleName(), path, includes, excludes);
}
-
- /** Get the file exclude patterns */
- public List getExcludedFiles() {
- return excludedFiles;
- }
-
}
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java
index 3d5f1952b43..c66730a928b 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/PortFile.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -174,11 +174,20 @@ public class PortFile {
/**
* Delete the port file.
*/
- public void delete() throws IOException {
+ public void delete() throws IOException, InterruptedException {
// Access to file must be closed before deleting.
rwfile.close();
- // Now delete.
+
file.delete();
+
+ // Wait until file has been deleted (deletes are asynchronous on Windows!) otherwise we
+ // might shutdown the server and prevent another one from starting.
+ for (int i = 0; i < 10 && file.exists(); i++) {
+ Thread.sleep(1000);
+ }
+ if (file.exists()) {
+ throw new IOException("Failed to delete file.");
+ }
}
/**
diff --git a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java
index 1e506ac5275..1f9ec7504d4 100644
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/sjavac/server/SjavacServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -279,7 +279,7 @@ public class SjavacServer implements Terminable {
// failed connection attempts
try {
portFile.delete();
- } catch (IOException e) {
+ } catch (IOException | InterruptedException e) {
e.printStackTrace(theLog);
}
try {
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/package-info.java
index 100318f5fcb..ace69c00622 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/javadoc/package-info.java
@@ -144,5 +144,4 @@ producing output like:
@see com.sun.javadoc.Doclet
@see com.sun.javadoc.RootDoc
*/
-@jdk.Exported
package com.sun.javadoc;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java
index 3503e95467a..7c8766c4f69 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java
@@ -31,5 +31,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.formats.html.markup;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java
index e4d51f6793a..dadc9e1500d 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java
@@ -36,5 +36,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.formats.html;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java
index a5e2db3e137..ef8b4acf1c1 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java
@@ -37,5 +37,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.internal.toolkit.builders;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java
index 5e3f61f4cde..e8bcae2fed3 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java
@@ -53,5 +53,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.internal.toolkit;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package-info.java
index cb7d6b6f5ef..43750f1d774 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package-info.java
@@ -48,5 +48,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.internal.toolkit.taglets;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java
index 17743cd7166..487215ca4a0 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2014, 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
@@ -248,7 +248,7 @@ public class VisibleMemberMap {
for (ProgramElementDoc element : list) {
Object key = getMemberKey(element);
Map memberLevelMap = memberNameMap.get(key);
- if (level.equals(memberLevelMap.get(element)))
+ if (memberLevelMap != null && level.equals(memberLevelMap.get(element)))
memberLevelMap.remove(element);
}
}
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package-info.java
index 7244b533d23..1319ccd0877 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package-info.java
@@ -31,5 +31,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.internal.toolkit.util.links;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/package-info.java
index 39f37a302a4..2e898013ffb 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/util/package-info.java
@@ -32,5 +32,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets.internal.toolkit.util;
diff --git a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/package-info.java b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/package-info.java
index 6df5c2bb845..0ced35a2c62 100644
--- a/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/package-info.java
+++ b/langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/package-info.java
@@ -32,5 +32,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.doclets;
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/package-info.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/package-info.java
index 588ae3b88b4..adcd32c328c 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/package-info.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/classfile/package-info.java
@@ -33,5 +33,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.classfile;
diff --git a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/package-info.java b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/package-info.java
index aa2de0038da..77fa3185031 100644
--- a/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/package-info.java
+++ b/langtools/src/jdk.jdeps/share/classes/com/sun/tools/javap/package-info.java
@@ -31,5 +31,4 @@
This code and its internal interfaces are subject to change or
deletion without notice.
*/
-@jdk.Exported(false)
package com.sun.tools.javap;
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/remote/RemoteAgent.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/remote/RemoteAgent.java
index bbebbfe2077..5ac073b1b9a 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/remote/RemoteAgent.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/remote/RemoteAgent.java
@@ -28,6 +28,9 @@ import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -35,7 +38,9 @@ import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
+
import static jdk.internal.jshell.remote.RemoteCodes.*;
+
import java.util.Map;
import java.util.TreeMap;
@@ -59,7 +64,10 @@ class RemoteAgent {
void commandLoop(Socket socket) throws IOException {
// in before out -- so we don't hang the controlling process
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
- ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
+ OutputStream socketOut = socket.getOutputStream();
+ System.setOut(new PrintStream(new MultiplexingOutputStream("out", socketOut), true));
+ System.setErr(new PrintStream(new MultiplexingOutputStream("err", socketOut), true));
+ ObjectOutputStream out = new ObjectOutputStream(new MultiplexingOutputStream("command", socketOut));
while (true) {
int cmd = in.readInt();
switch (cmd) {
@@ -260,4 +268,64 @@ class RemoteAgent {
}
return sb.toString();
}
+
+ private static final class MultiplexingOutputStream extends OutputStream {
+
+ private static final int PACKET_SIZE = 127;
+
+ private final byte[] name;
+ private final OutputStream delegate;
+
+ public MultiplexingOutputStream(String name, OutputStream delegate) {
+ try {
+ this.name = name.getBytes("UTF-8");
+ this.delegate = delegate;
+ } catch (UnsupportedEncodingException ex) {
+ throw new IllegalStateException(ex); //should not happen
+ }
+ }
+
+ @Override
+ public void write(int b) throws IOException {
+ synchronized (delegate) {
+ delegate.write(name.length); //assuming the len is small enough to fit into byte
+ delegate.write(name);
+ delegate.write(1);
+ delegate.write(b);
+ delegate.flush();
+ }
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ synchronized (delegate) {
+ int i = 0;
+ while (len > 0) {
+ int size = Math.min(PACKET_SIZE, len);
+
+ delegate.write(name.length); //assuming the len is small enough to fit into byte
+ delegate.write(name);
+ delegate.write(size);
+ delegate.write(b, off + i, size);
+ i += size;
+ len -= size;
+ }
+
+ delegate.flush();
+ }
+ }
+
+ @Override
+ public void flush() throws IOException {
+ super.flush();
+ delegate.flush();
+ }
+
+ @Override
+ public void close() throws IOException {
+ super.close();
+ delegate.close();
+ }
+
+ }
}
diff --git a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
index a66d9cbc1aa..180fc4d8206 100644
--- a/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
+++ b/langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
@@ -1,3 +1,4 @@
+
/*
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,8 +91,10 @@ import java.util.MissingResourceException;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.Spliterators;
+import java.util.function.Function;
import java.util.function.Supplier;
import static java.util.stream.Collectors.toList;
+import static jdk.jshell.Snippet.SubKind.VAR_VALUE_SUBKIND;
/**
* Command line REPL tool for Java using the JShell API.
@@ -102,6 +105,7 @@ public class JShellTool {
private static final Pattern LINEBREAK = Pattern.compile("\\R");
private static final Pattern HISTORY_ALL_START_FILENAME = Pattern.compile(
"((?(all|history|start))(\\z|\\p{javaWhitespace}+))?(?.*)");
+ private static final String RECORD_SEPARATOR = "\u241E";
final InputStream cmdin;
final PrintStream cmdout;
@@ -150,9 +154,14 @@ public class JShellTool {
private String cmdlineStartup = null;
private String editor = null;
- static final Preferences PREFS = Preferences.userRoot().node("tool/REPL");
+ // Commands and snippets which should be replayed
+ private List replayableHistory;
+ private List replayableHistoryPrevious;
+
+ static final Preferences PREFS = Preferences.userRoot().node("tool/JShell");
static final String STARTUP_KEY = "STARTUP";
+ static final String REPLAY_RESTORE_KEY = "REPLAY_RESTORE";
static final String DEFAULT_STARTUP =
"\n" +
@@ -165,11 +174,14 @@ public class JShellTool {
"import java.util.regex.*;\n" +
"void printf(String format, Object... args) { System.out.printf(format, args); }\n";
- // Tool id (tid) mapping
+ // Tool id (tid) mapping: the three name spaces
NameSpace mainNamespace;
NameSpace startNamespace;
NameSpace errorNamespace;
+
+ // Tool id (tid) mapping: the current name spaces
NameSpace currentNameSpace;
+
Map mapSnippet;
void debug(String format, Object... args) {
@@ -252,6 +264,12 @@ public class JShellTool {
private void start(IOContext in, List loadList) {
resetState(); // Initialize
+ // Read replay history from last jshell session into previous history
+ String prevReplay = PREFS.get(REPLAY_RESTORE_KEY, null);
+ if (prevReplay != null) {
+ replayableHistoryPrevious = Arrays.asList(prevReplay.split(RECORD_SEPARATOR));
+ }
+
for (String loadFile : loadList) {
cmdOpen(loadFile);
}
@@ -370,6 +388,10 @@ public class JShellTool {
mapSnippet = new LinkedHashMap<>();
currentNameSpace = startNamespace;
+ // Reset the replayable history, saving the old for restore
+ replayableHistoryPrevious = replayableHistory;
+ replayableHistory = new ArrayList<>();
+
state = JShell.builder()
.in(userin)
.out(userout)
@@ -382,7 +404,8 @@ public class JShellTool {
analysis = state.sourceCodeAnalysis();
shutdownSubscription = state.onShutdown((JShell deadState) -> {
if (deadState == state) {
- hard("State engine terminated. See /history");
+ hard("State engine terminated.");
+ hard("Restore definitions with: /reload restore");
live = false;
}
});
@@ -392,7 +415,6 @@ public class JShellTool {
state.addToClasspath(cmdlineClasspath);
}
-
String start;
if (cmdlineStartup == null) {
start = PREFS.get(STARTUP_KEY, "");
@@ -431,7 +453,7 @@ public class JShellTool {
String incomplete = "";
while (live) {
String prompt;
- if (in.interactiveOutput() && displayPrompt) {
+ if (displayPrompt) {
prompt = testPrompt
? incomplete.isEmpty()
? "\u0005" //ENQ
@@ -480,6 +502,12 @@ public class JShellTool {
}
}
+ private void addToReplayHistory(String s) {
+ if (currentNameSpace == mainNamespace) {
+ replayableHistory.add(s);
+ }
+ }
+
private String processSourceCatchingReset(String src) {
try {
input.beforeUserCode();
@@ -516,7 +544,12 @@ public class JShellTool {
fluff("Type /help for help.");
}
} else if (candidates.length == 1) {
- candidates[0].run.accept(arg);
+ Command command = candidates[0];
+
+ // If comand was successful and is of a replayable kind, add it the replayable history
+ if (command.run.apply(arg) && command.kind == CommandKind.REPLAY) {
+ addToReplayHistory((command.command + " " + arg).trim());
+ }
} else {
hard("Command: %s is ambiguous: %s", cmd, Arrays.stream(candidates).map(c -> c.command).collect(Collectors.joining(", ")));
fluff("Type /help for help.");
@@ -546,15 +579,15 @@ public class JShellTool {
public final String command;
public final String params;
public final String description;
- public final Consumer run;
+ public final Function run;
public final CompletionProvider completions;
public final CommandKind kind;
- public Command(String command, String params, String description, Consumer run, CompletionProvider completions) {
+ public Command(String command, String params, String description, Function run, CompletionProvider completions) {
this(command, params, description, run, completions, CommandKind.NORMAL);
}
- public Command(String command, String params, String description, Consumer run, CompletionProvider completions, CommandKind kind) {
+ public Command(String command, String params, String description, Function run, CompletionProvider completions, CommandKind kind) {
this.command = command;
this.params = params;
this.description = description;
@@ -571,6 +604,7 @@ public class JShellTool {
enum CommandKind {
NORMAL,
+ REPLAY,
HIDDEN,
HELP_ONLY;
}
@@ -602,6 +636,7 @@ public class JShellTool {
private static final CompletionProvider EMPTY_COMPLETION_PROVIDER = new FixedCompletionProvider();
private static final CompletionProvider KEYWORD_COMPLETION_PROVIDER = new FixedCompletionProvider("all ", "start ", "history ");
+ private static final CompletionProvider RELOAD_OPTIONS_COMPLETION_PROVIDER = new FixedCompletionProvider("restore", "quiet");
private static final CompletionProvider FILE_COMPLETION_PROVIDER = fileCompletions(p -> true);
private final Map commands = new LinkedHashMap<>();
private void registerCommand(Command cmd) {
@@ -674,6 +709,16 @@ public class JShellTool {
};
}
+ private static CompletionProvider reloadCompletion() {
+ return (code, cursor, anchor) -> {
+ List result = new ArrayList<>();
+ int pastSpace = code.indexOf(' ') + 1; // zero if no space
+ result.addAll(RELOAD_OPTIONS_COMPLETION_PROVIDER.completionSuggestions(code.substring(pastSpace), cursor - pastSpace, anchor));
+ anchor[0] += pastSpace;
+ return result;
+ };
+ }
+
// Table of commands -- with command forms, argument kinds, help message, implementation, ...
{
@@ -688,7 +733,8 @@ public class JShellTool {
editCompletion()));
registerCommand(new Command("/drop", "", "delete a source entry referenced by name or id",
arg -> cmdDrop(arg),
- editCompletion()));
+ editCompletion(),
+ CommandKind.REPLAY));
registerCommand(new Command("/save", "[all|history|start] ", "save: - current source;\n" +
" all - source including overwritten, failed, and start-up code;\n" +
" history - editing history;\n" +
@@ -716,6 +762,9 @@ public class JShellTool {
registerCommand(new Command("/reset", null, "reset everything in the REPL",
arg -> cmdReset(),
EMPTY_COMPLETION_PROVIDER));
+ registerCommand(new Command("/reload", "[restore] [quiet]", "reset and replay relevant history -- current or previous (restore)",
+ arg -> cmdReload(arg),
+ reloadCompletion()));
registerCommand(new Command("/feedback", "", "feedback information: off, concise, normal, verbose, default, or ?",
arg -> cmdFeedback(arg),
new FixedCompletionProvider("off", "concise", "normal", "verbose", "default", "?")));
@@ -724,7 +773,8 @@ public class JShellTool {
EMPTY_COMPLETION_PROVIDER));
registerCommand(new Command("/classpath", "", "add a path to the classpath",
arg -> cmdClasspath(arg),
- classPathCompletion()));
+ classPathCompletion(),
+ CommandKind.REPLAY));
registerCommand(new Command("/history", null, "history of what you have typed",
arg -> cmdHistory(),
EMPTY_COMPLETION_PROVIDER));
@@ -801,25 +851,29 @@ public class JShellTool {
// --- Command implementations ---
- void cmdSetEditor(String arg) {
+ boolean cmdSetEditor(String arg) {
if (arg.isEmpty()) {
hard("/seteditor requires a path argument");
+ return false;
} else {
editor = arg;
fluff("Editor set to: %s", arg);
+ return true;
}
}
- void cmdClasspath(String arg) {
+ boolean cmdClasspath(String arg) {
if (arg.isEmpty()) {
hard("/classpath requires a path argument");
+ return false;
} else {
state.addToClasspath(toPathResolvingUserHome(arg).toString());
fluff("Path %s added to classpath", arg);
+ return true;
}
}
- void cmdDebug(String arg) {
+ boolean cmdDebug(String arg) {
if (arg.isEmpty()) {
debug = !debug;
InternalDebugControl.setDebugFlags(state, debug ? InternalDebugControl.DBG_GEN : 0);
@@ -860,20 +914,26 @@ public class JShellTool {
default:
hard("Unknown debugging option: %c", ch);
fluff("Use: 0 r g f c d");
- break;
+ return false;
}
}
InternalDebugControl.setDebugFlags(state, flags);
}
+ return true;
}
- private void cmdExit() {
+ private boolean cmdExit() {
regenerateOnDeath = false;
live = false;
+ if (!replayableHistory.isEmpty()) {
+ PREFS.put(REPLAY_RESTORE_KEY, replayableHistory.stream().reduce(
+ (a, b) -> a + RECORD_SEPARATOR + b).get());
+ }
fluff("Goodbye\n");
+ return true;
}
- private void cmdFeedback(String arg) {
+ private boolean cmdFeedback(String arg) {
switch (arg) {
case "":
case "d":
@@ -905,12 +965,13 @@ public class JShellTool {
hard(" default");
hard("You may also use just the first letter, for example: /f c");
hard("In interactive mode 'default' is the same as 'normal', from a file it is the same as 'off'");
- return;
+ return false;
}
fluff("Feedback mode: %s", feedback.name().toLowerCase());
+ return true;
}
- void cmdHelp() {
+ boolean cmdHelp() {
int synopsisLen = 0;
Map synopsis2Description = new LinkedHashMap<>();
for (Command cmd : new LinkedHashSet<>(commands.values())) {
@@ -936,14 +997,16 @@ public class JShellTool {
cmdout.println("Supported shortcuts include:");
cmdout.println(" -- show possible completions for the current text");
cmdout.println("Shift- -- for current method or constructor invocation, show a synopsis of the method/constructor");
+ return true;
}
- private void cmdHistory() {
+ private boolean cmdHistory() {
cmdout.println();
for (String s : input.currentSessionHistory()) {
// No number prefix, confusing with snippet ids
cmdout.printf("%s\n", s);
}
+ return true;
}
/**
@@ -1010,23 +1073,23 @@ public class JShellTool {
}
}
- private void cmdDrop(String arg) {
+ private boolean cmdDrop(String arg) {
if (arg.isEmpty()) {
hard("In the /drop argument, please specify an import, variable, method, or class to drop.");
hard("Specify by id or name. Use /list to see ids. Use /reset to reset all state.");
- return;
+ return false;
}
Stream stream = argToSnippets(arg, false);
if (stream == null) {
hard("No definition or id named %s found. See /classes, /methods, /vars, or /list", arg);
- return;
+ return false;
}
List snippets = stream
.filter(sn -> state.status(sn).isActive && sn instanceof PersistentSnippet)
.collect(toList());
if (snippets.isEmpty()) {
hard("The argument did not specify an active import, variable, method, or class to drop.");
- return;
+ return false;
}
if (snippets.size() > 1) {
hard("The argument references more than one import, variable, method, or class.");
@@ -1034,17 +1097,18 @@ public class JShellTool {
for (Snippet sn : snippets) {
cmdout.printf("%4s : %s\n", sn.id(), sn.source().replace("\n", "\n "));
}
- return;
+ return false;
}
PersistentSnippet psn = (PersistentSnippet) snippets.get(0);
state.drop(psn).forEach(this::handleEvent);
+ return true;
}
- private void cmdEdit(String arg) {
+ private boolean cmdEdit(String arg) {
Stream stream = argToSnippets(arg, true);
if (stream == null) {
hard("No definition or id named %s found. See /classes, /methods, /vars, or /list", arg);
- return;
+ return false;
}
Set srcSet = new LinkedHashSet<>();
stream.forEachOrdered(sn -> {
@@ -1078,6 +1142,7 @@ public class JShellTool {
} else {
ExternalEditor.edit(editor, errorHandler, src, saveHandler, input);
}
+ return true;
}
//where
// receives editor requests to save
@@ -1135,10 +1200,9 @@ public class JShellTool {
}
}
- private void cmdList(String arg) {
+ private boolean cmdList(String arg) {
if (arg.equals("history")) {
- cmdHistory();
- return;
+ return cmdHistory();
}
Stream stream = argToSnippets(arg, true);
if (stream == null) {
@@ -1148,7 +1212,7 @@ public class JShellTool {
} else {
hard("No definition or id named %s found. There are no active definitions.", arg);
}
- return;
+ return false;
}
// prevent double newline on empty list
@@ -1160,38 +1224,72 @@ public class JShellTool {
}
cmdout.printf("%4s : %s\n", sn.id(), sn.source().replace("\n", "\n "));
});
+ return true;
}
- private void cmdOpen(String filename) {
+ private boolean cmdOpen(String filename) {
if (filename.isEmpty()) {
hard("The /open command requires a filename argument.");
+ return false;
} else {
try {
run(new FileScannerIOContext(toPathResolvingUserHome(filename).toString()));
} catch (FileNotFoundException e) {
hard("File '%s' is not found: %s", filename, e.getMessage());
+ return false;
} catch (Exception e) {
hard("Exception while reading file: %s", e);
+ return false;
}
}
+ return true;
}
- private void cmdPrompt() {
+ private boolean cmdPrompt() {
displayPrompt = !displayPrompt;
fluff("Prompt will %sdisplay. Use /prompt to toggle.", displayPrompt ? "" : "NOT ");
concise("Prompt: %s", displayPrompt ? "on" : "off");
+ return true;
}
- private void cmdReset() {
+ private boolean cmdReset() {
live = false;
fluff("Resetting state.");
+ return true;
}
- private void cmdSave(String arg_filename) {
+ private boolean cmdReload(String arg) {
+ Iterable