A simple way to radically speed up compilation of native code
- (typically hotspot and native libraries in JDK) is to install
- ccache. This will cache and reuse prior compilation results, if the
- source code is unchanged. However, ccache versions prior to 3.1.4
- does not work correctly with the precompiled headers used in
- OpenJDK. So if your platform supports ccache at 3.1.4 or later, we
- highly recommend installing it. This is currently only supported on
- linux.
+
The OpenJDK build supports building with ccache
+ when using gcc or clang. Using ccache can
+ radically speed up compilation of native code if
+ you often rebuild the same sources. Your milage
+ may vary however so we recommend evaluating it for
+ yourself. To enable it, make sure it's on the path
+ and configure with --enable-ccache.
Building on local disk
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index 800c52b844b..fd677aacc3c 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -242,6 +242,9 @@ AC_DEFUN_ONCE([BASIC_INIT],
[
# Save the original command line. This is passed to us by the wrapper configure script.
AC_SUBST(CONFIGURE_COMMAND_LINE)
+ # Save the path variable before it gets changed
+ ORIGINAL_PATH="$PATH"
+ AC_SUBST(ORIGINAL_PATH)
DATE_WHEN_CONFIGURED=`LANG=C date`
AC_SUBST(DATE_WHEN_CONFIGURED)
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4
index 5c106cd1f68..49316f7eb41 100644
--- a/common/autoconf/build-performance.m4
+++ b/common/autoconf/build-performance.m4
@@ -164,19 +164,26 @@ AC_DEFUN([BPERF_SETUP_CCACHE],
[enable using ccache to speed up recompilations @<:@disabled@:>@])])
CCACHE=
+ CCACHE_STATUS=
AC_MSG_CHECKING([is ccache enabled])
- ENABLE_CCACHE=$enable_ccache
if test "x$enable_ccache" = xyes; then
- AC_MSG_RESULT([yes])
- OLD_PATH="$PATH"
- if test "x$TOOLCHAIN_PATH" != x; then
- PATH=$TOOLCHAIN_PATH:$PATH
+ if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then
+ AC_MSG_RESULT([yes])
+ OLD_PATH="$PATH"
+ if test "x$TOOLCHAIN_PATH" != x; then
+ PATH=$TOOLCHAIN_PATH:$PATH
+ fi
+ BASIC_REQUIRE_PROGS(CCACHE, ccache)
+ PATH="$OLD_PATH"
+ CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`]
+ CCACHE_STATUS="Active ($CCACHE_VERSION)"
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_WARN([ccache is not supported with toolchain type $TOOLCHAIN_TYPE])
fi
- BASIC_REQUIRE_PROGS(CCACHE, ccache)
- CCACHE_STATUS="enabled"
- PATH="$OLD_PATH"
elif test "x$enable_ccache" = xno; then
AC_MSG_RESULT([no, explicitly disabled])
+ CCACHE_STATUS="Disabled"
elif test "x$enable_ccache" = x; then
AC_MSG_RESULT([no])
else
@@ -206,35 +213,31 @@ AC_DEFUN([BPERF_SETUP_CCACHE],
AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
[
if test "x$CCACHE" != x; then
- # Only use ccache if it is 3.1.4 or later, which supports
- # precompiled headers.
- AC_MSG_CHECKING([if ccache supports precompiled headers])
- HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null`
- if test "x$HAS_GOOD_CCACHE" = x; then
- AC_MSG_RESULT([no, disabling ccache])
- CCACHE=
- CCACHE_STATUS="disabled"
- else
- AC_MSG_RESULT([yes])
+ if test "x$USE_PRECOMPILED_HEADER" = "x1"; then
+ HAS_BAD_CCACHE=[`$ECHO $CCACHE_VERSION | \
+ $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]'`]
+ if test "x$HAS_BAD_CCACHE" != "x"; then
+ AC_MSG_ERROR([Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION])
+ fi
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
+ CCACHE_PRECOMP_FLAG="-fpch-preprocess"
PUSHED_FLAGS="$CXXFLAGS"
- CXXFLAGS="-fpch-preprocess $CXXFLAGS"
+ CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
CXXFLAGS="$PUSHED_FLAGS"
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
AC_MSG_RESULT([yes])
+ CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG"
+ AC_SUBST(CFLAGS_CCACHE)
+ CCACHE_SLOPPINESS=pch_defines,time_macros
else
- AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
- CCACHE=
- CCACHE_STATUS="disabled"
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG])
fi
fi
- fi
- if test "x$CCACHE" != x; then
- CCACHE_SLOPPINESS=time_macros
- CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
- CCACHE_FLAGS=-fpch-preprocess
+ CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
+ CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
if test "x$SET_CCACHE_DIR" != x; then
mkdir -p $CCACHE_DIR > /dev/null 2>&1
diff --git a/common/autoconf/configure b/common/autoconf/configure
index b6a38a307e3..e786ff81916 100644
--- a/common/autoconf/configure
+++ b/common/autoconf/configure
@@ -40,8 +40,9 @@ if test "x$BASH" = x; then
echo "Error: This script must be run using bash." 1>&2
exit 1
fi
-# Force autoconf to use bash
+# Force autoconf to use bash. This also means we must disable autoconf re-exec.
export CONFIG_SHELL=$BASH
+export _as_can_reexec=no
conf_script_dir="$TOPDIR/common/autoconf"
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 11b5d337733..616aaad497b 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -629,6 +629,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
+CFLAGS_CCACHE
CCACHE
USE_PRECOMPILED_HEADER
SJAVAC_SERVER_DIR
@@ -991,6 +992,7 @@ CAT
BASH
BASENAME
DATE_WHEN_CONFIGURED
+ORIGINAL_PATH
CONFIGURE_COMMAND_LINE
target_alias
host_alias
@@ -4333,7 +4335,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1421247827
+DATE_WHEN_GENERATED=1423567509
###############################################################################
#
@@ -4366,6 +4368,9 @@ DATE_WHEN_GENERATED=1421247827
# Save the original command line. This is passed to us by the wrapper configure script.
+ # Save the path variable before it gets changed
+ ORIGINAL_PATH="$PATH"
+
DATE_WHEN_CONFIGURED=`LANG=C date`
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5
@@ -27438,8 +27443,8 @@ $as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;}
# The trailing space for everyone except PATH is no typo, but is needed due
# to trailing \ in the Windows paths. These will be stripped later.
$ECHO "$WINPATH_BASH -c 'echo VS_PATH="'\"$PATH\" > set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
- $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
+ $ECHO "$WINPATH_BASH -c 'echo VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WindowsSdkDir="'\"$WindowsSdkDir \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE
@@ -27486,9 +27491,9 @@ $as_echo "present but broken" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
- # Remove any trailing "\" and " " from the variables.
- VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
- VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
+ # Remove any trailing "\" ";" and " " from the variables.
+ VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
+ VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
@@ -27499,6 +27504,268 @@ $as_echo "ok" >&6; }
+
+ # Convert VS_INCLUDE into SYSROOT_CFLAGS
+ OLDIFS="$IFS"
+ IFS=";"
+ for i in $VS_INCLUDE; do
+ ipath=$i
+ IFS="$OLDIFS"
+
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+ # Input might be given as Windows format, start by converting to
+ # unix format.
+ path="$ipath"
+ new_path=`$CYGPATH -u "$path"`
+
+ # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+ # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+ # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+ # "foo.exe" is OK but "foo" is an error.
+ #
+ # This test is therefore slightly more accurate than "test -f" to check for file precense.
+ # It is also a way to make sure we got the proper file name for the real test later on.
+ test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+ if test "x$test_shortpath" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Cannot locate the the path of ipath" "$LINENO" 5
+ fi
+
+ # Call helper function which possibly converts this using DOS-style short mode.
+ # If so, the updated path is stored in $new_path.
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+ path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+ if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+ # Going to short mode and back again did indeed matter. Since short mode is
+ # case insensitive, let's make it lowercase to improve readability.
+ shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Now convert it back to Unix-stile (cygpath)
+ input_path=`$CYGPATH -u "$shortmode_path"`
+ new_path="$input_path"
+ fi
+ fi
+
+ test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+ if test "x$test_cygdrive_prefix" = x; then
+ # As a simple fix, exclude /usr/bin since it's not a real path.
+ if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+ # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+ # a path prefixed by /cygdrive for fixpath to work.
+ new_path="$CYGWIN_ROOT_PATH$input_path"
+ fi
+ fi
+
+
+ if test "x$path" != "x$new_path"; then
+ ipath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
+ fi
+
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+ path="$ipath"
+ has_colon=`$ECHO $path | $GREP ^.:`
+ new_path="$path"
+ if test "x$has_colon" = x; then
+ # Not in mixed or Windows style, start by that.
+ new_path=`cmd //c echo $path`
+ fi
+
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ fi
+
+
+ windows_path="$new_path"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ new_path="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ new_path="$unix_path"
+ fi
+
+ if test "x$path" != "x$new_path"; then
+ ipath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting ipath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting ipath to \"$new_path\"" >&6;}
+ fi
+
+ # Save the first 10 bytes of this path to the storage, so fixpath can work.
+ all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+ else
+ # We're on a unix platform. Hooray! :)
+ path="$ipath"
+ has_space=`$ECHO "$path" | $GREP " "`
+ if test "x$has_space" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of ipath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of ipath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+ fi
+
+ # Use eval to expand a potential ~
+ eval path="$path"
+ if test ! -f "$path" && test ! -d "$path"; then
+ as_fn_error $? "The path of ipath, which resolves as \"$path\", is not found." "$LINENO" 5
+ fi
+
+ ipath="`cd "$path"; $THEPWDCMD -L`"
+ fi
+
+ IFS=";"
+ SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+ done
+ # Convert VS_LIB into SYSROOT_LDFLAGS
+ for i in $VS_LIB; do
+ libpath=$i
+ IFS="$OLDIFS"
+
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+
+ # Input might be given as Windows format, start by converting to
+ # unix format.
+ path="$libpath"
+ new_path=`$CYGPATH -u "$path"`
+
+ # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
+ # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
+ # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
+ # "foo.exe" is OK but "foo" is an error.
+ #
+ # This test is therefore slightly more accurate than "test -f" to check for file precense.
+ # It is also a way to make sure we got the proper file name for the real test later on.
+ test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
+ if test "x$test_shortpath" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Cannot locate the the path of libpath" "$LINENO" 5
+ fi
+
+ # Call helper function which possibly converts this using DOS-style short mode.
+ # If so, the updated path is stored in $new_path.
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ shortmode_path=`$CYGPATH -s -m -a "$input_path"`
+ path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
+ if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
+ # Going to short mode and back again did indeed matter. Since short mode is
+ # case insensitive, let's make it lowercase to improve readability.
+ shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ # Now convert it back to Unix-stile (cygpath)
+ input_path=`$CYGPATH -u "$shortmode_path"`
+ new_path="$input_path"
+ fi
+ fi
+
+ test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
+ if test "x$test_cygdrive_prefix" = x; then
+ # As a simple fix, exclude /usr/bin since it's not a real path.
+ if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
+ # The path is in a Cygwin special directory (e.g. /home). We need this converted to
+ # a path prefixed by /cygdrive for fixpath to work.
+ new_path="$CYGWIN_ROOT_PATH$input_path"
+ fi
+ fi
+
+
+ if test "x$path" != "x$new_path"; then
+ libpath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
+ fi
+
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+
+ path="$libpath"
+ has_colon=`$ECHO $path | $GREP ^.:`
+ new_path="$path"
+ if test "x$has_colon" = x; then
+ # Not in mixed or Windows style, start by that.
+ new_path=`cmd //c echo $path`
+ fi
+
+
+ input_path="$new_path"
+ # Check if we need to convert this using DOS-style short mode. If the path
+ # contains just simple characters, use it. Otherwise (spaces, weird characters),
+ # take no chances and rewrite it.
+ # Note: m4 eats our [], so we need to use [ and ] instead.
+ has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
+ if test "x$has_forbidden_chars" != x; then
+ # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
+ new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ fi
+
+
+ windows_path="$new_path"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ new_path="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ new_path="$unix_path"
+ fi
+
+ if test "x$path" != "x$new_path"; then
+ libpath="$new_path"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting libpath to \"$new_path\"" >&5
+$as_echo "$as_me: Rewriting libpath to \"$new_path\"" >&6;}
+ fi
+
+ # Save the first 10 bytes of this path to the storage, so fixpath can work.
+ all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
+
+ else
+ # We're on a unix platform. Hooray! :)
+ path="$libpath"
+ has_space=`$ECHO "$path" | $GREP " "`
+ if test "x$has_space" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: The path of libpath, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of libpath, which resolves as \"$path\", is invalid." >&6;}
+ as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+ fi
+
+ # Use eval to expand a potential ~
+ eval path="$path"
+ if test ! -f "$path" && test ! -d "$path"; then
+ as_fn_error $? "The path of libpath, which resolves as \"$path\", is not found." "$LINENO" 5
+ fi
+
+ libpath="`cd "$path"; $THEPWDCMD -L`"
+ fi
+
+ IFS=";"
+ SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+ done
+ IFS="$OLDIFS"
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
@@ -50616,16 +50883,17 @@ fi
CCACHE=
+ CCACHE_STATUS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking is ccache enabled" >&5
$as_echo_n "checking is ccache enabled... " >&6; }
- ENABLE_CCACHE=$enable_ccache
if test "x$enable_ccache" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
- OLD_PATH="$PATH"
- if test "x$TOOLCHAIN_PATH" != x; then
- PATH=$TOOLCHAIN_PATH:$PATH
- fi
+ OLD_PATH="$PATH"
+ if test "x$TOOLCHAIN_PATH" != x; then
+ PATH=$TOOLCHAIN_PATH:$PATH
+ fi
@@ -50819,11 +51087,19 @@ $as_echo "$tool_specified" >&6; }
fi
- CCACHE_STATUS="enabled"
- PATH="$OLD_PATH"
+ PATH="$OLD_PATH"
+ CCACHE_VERSION=`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`
+ CCACHE_STATUS="Active ($CCACHE_VERSION)"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&5
+$as_echo "$as_me: WARNING: ccache is not supported with toolchain type $TOOLCHAIN_TYPE" >&2;}
+ fi
elif test "x$enable_ccache" = xno; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, explicitly disabled" >&5
$as_echo "no, explicitly disabled" >&6; }
+ CCACHE_STATUS="Disabled"
elif test "x$enable_ccache" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
@@ -50854,23 +51130,17 @@ $as_echo "$as_me: WARNING: --with-ccache-dir has no meaning when ccache is not e
if test "x$CCACHE" != x; then
if test "x$CCACHE" != x; then
- # Only use ccache if it is 3.1.4 or later, which supports
- # precompiled headers.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ccache supports precompiled headers" >&5
-$as_echo_n "checking if ccache supports precompiled headers... " >&6; }
- HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.[456789]) 2> /dev/null`
- if test "x$HAS_GOOD_CCACHE" = x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccache" >&5
-$as_echo "no, disabling ccache" >&6; }
- CCACHE=
- CCACHE_STATUS="disabled"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+ if test "x$USE_PRECOMPILED_HEADER" = "x1"; then
+ HAS_BAD_CCACHE=`$ECHO $CCACHE_VERSION | \
+ $GREP -e '^1.*' -e '^2.*' -e '^3\.0.*' -e '^3\.1\.[0123]'`
+ if test "x$HAS_BAD_CCACHE" != "x"; then
+ as_fn_error $? "Precompiled headers requires ccache 3.1.4 or later, found $CCACHE_VERSION" "$LINENO" 5
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5
$as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; }
+ CCACHE_PRECOMP_FLAG="-fpch-preprocess"
PUSHED_FLAGS="$CXXFLAGS"
- CXXFLAGS="-fpch-preprocess $CXXFLAGS"
+ CXXFLAGS="$CCACHE_PRECOMP_FLAG $CXXFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -50892,19 +51162,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ CFLAGS_CCACHE="$CCACHE_PRECOMP_FLAG"
+
+ CCACHE_SLOPPINESS=pch_defines,time_macros
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccaching of precompiled headers" >&5
-$as_echo "no, disabling ccaching of precompiled headers" >&6; }
- CCACHE=
- CCACHE_STATUS="disabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "Cannot use ccache with precompiled headers without compiler support for $CCACHE_PRECOMP_FLAG" "$LINENO" 5
fi
fi
- fi
- if test "x$CCACHE" != x; then
- CCACHE_SLOPPINESS=time_macros
- CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
- CCACHE_FLAGS=-fpch-preprocess
+ CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
+ CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
if test "x$SET_CCACHE_DIR" != x; then
mkdir -p $CCACHE_DIR > /dev/null 2>&1
diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in
index dcd2fd8f360..2cc8be74416 100644
--- a/common/autoconf/hotspot-spec.gmk.in
+++ b/common/autoconf/hotspot-spec.gmk.in
@@ -109,8 +109,8 @@ LD:=@HOTSPOT_LD@
MT:=@HOTSPOT_MT@
RC:=@HOTSPOT_RC@
-EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@
-EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
+EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@ $(CFLAGS_CCACHE)
+EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@ $(CFLAGS_CCACHE)
EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
USE_PRECOMPILED_HEADER=@USE_PRECOMPILED_HEADER@
@@ -132,6 +132,13 @@ else
ZIP_DEBUGINFO_FILES:=0
endif
+ifeq ($(OPENJDK_TARGET_OS), windows)
+ # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
+ # environment variables (in Windows path style).
+ export INCLUDE:=@VS_INCLUDE@
+ export LIB:=@VS_LIB@
+endif
+
# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
# This is needed to get the LOG setting to work properly.
include $(SRC_ROOT)/make/common/MakeBase.gmk
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index d25b35b2070..f59e255537e 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -129,14 +129,12 @@ LIBDL:=@LIBDL@
# colon or semicolon
PATH_SEP:=@PATH_SEP@
+# Save the original path before replacing it with the Visual Studio tools
+ORIGINAL_PATH:=@ORIGINAL_PATH@
ifeq ($(OPENJDK_TARGET_OS), windows)
- # On Windows, the Visual Studio toolchain needs the LIB and INCLUDE
- # environment variables (in Windows path style), and the PATH needs to
- # be adjusted to include Visual Studio tools (but this needs to be in
- # cygwin/msys style).
+ # On Windows, the Visual Studio toolchain needs the PATH to be adjusted
+ # to include Visual Studio tools (this needs to be in cygwin/msys style).
export PATH:=@VS_PATH@
- export INCLUDE:=@VS_INCLUDE@
- export LIB:=@VS_LIB@
endif
SYSROOT_CFLAGS := @SYSROOT_CFLAGS@
@@ -328,6 +326,8 @@ CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
+CFLAGS_CCACHE:=@CFLAGS_CCACHE@
+
# Tools that potentially need to be cross compilation aware.
CC:=@FIXPATH@ @CCACHE@ @CC@
diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4
index e1ec6f3db5b..aad784cd420 100644
--- a/common/autoconf/toolchain_windows.m4
+++ b/common/autoconf/toolchain_windows.m4
@@ -213,9 +213,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
else
AC_MSG_RESULT([ok])
- # Remove any trailing "\" and " " from the variables.
- VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED 's/\\\\* *$//'`
- VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\* *$//'`
+ # Remove any trailing "\" ";" and " " from the variables.
+ VS_INCLUDE=`$ECHO "$VS_INCLUDE" | $SED -e 's/\\\\*;* *$//'`
+ VS_LIB=`$ECHO "$VS_LIB" | $SED 's/\\\\*;* *$//'`
VCINSTALLDIR=`$ECHO "$VCINSTALLDIR" | $SED 's/\\\\* *$//'`
WindowsSDKDir=`$ECHO "$WindowsSDKDir" | $SED 's/\\\\* *$//'`
WINDOWSSDKDIR=`$ECHO "$WINDOWSSDKDIR" | $SED 's/\\\\* *$//'`
@@ -226,6 +226,26 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_SUBST(VS_PATH)
AC_SUBST(VS_INCLUDE)
AC_SUBST(VS_LIB)
+
+ # Convert VS_INCLUDE into SYSROOT_CFLAGS
+ OLDIFS="$IFS"
+ IFS=";"
+ for i in $VS_INCLUDE; do
+ ipath=$i
+ IFS="$OLDIFS"
+ BASIC_FIXUP_PATH([ipath])
+ IFS=";"
+ SYSROOT_CFLAGS="$SYSROOT_CFLAGS -I$ipath"
+ done
+ # Convert VS_LIB into SYSROOT_LDFLAGS
+ for i in $VS_LIB; do
+ libpath=$i
+ IFS="$OLDIFS"
+ BASIC_FIXUP_PATH([libpath])
+ IFS=";"
+ SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS -libpath:$libpath"
+ done
+ IFS="$OLDIFS"
fi
else
AC_MSG_RESULT([not found])
diff --git a/corba/.hgtags b/corba/.hgtags
index 171c3db868c..40d1d16c964 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -292,3 +292,4 @@ e27c725d6c9d155667b35255f442d4ceb8c3c084 jdk9-b40
ee8447ca632e1d39180b4767c749db101bff7314 jdk9-b47
a13c49c5f2899b702652a460ed7aa73123e671e6 jdk9-b48
9285d14eb7b6b0815679bae98dd936dbc136218d jdk9-b49
+224f593393e5b01b3c8f1e591b7f4b1790a3737a jdk9-b50
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index 08b2b023cfe..bec0066461f 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -452,3 +452,4 @@ a184ee1d717297bd35b7c3e35393e137921a3ed2 jdk9-b46
3b241fb72b8925b75941d612db762a6d5da66d02 jdk9-b47
cc775a4a24c7f5d9e624b4205e9fbd48a17331f6 jdk9-b48
360cd1fc42f10941a9fd17cc32d5b85a22d12a0b jdk9-b49
+e0947f58c9c1426aa0d98b98ebb78357b27a7b99 jdk9-b50
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
index 7510d08bfd0..cefdcf2aa30 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2013, 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
@@ -44,15 +44,22 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("SymbolTable");
theTableField = type.getAddressField("_the_table");
+ sharedTableField = type.getAddressField("_shared_table");
}
// Fields
private static AddressField theTableField;
+ private static AddressField sharedTableField;
+
+ private CompactHashTable sharedTable;
// Accessors
public static SymbolTable getTheTable() {
Address tmp = theTableField.getValue();
- return (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp);
+ SymbolTable table = (SymbolTable) VMObjectFactory.newObject(SymbolTable.class, tmp);
+ Address shared = sharedTableField.getStaticFieldAddress();
+ table.sharedTable = (CompactHashTable)VMObjectFactory.newObject(CompactHashTable.class, shared);
+ return table;
}
public SymbolTable(Address addr) {
@@ -73,8 +80,9 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
/** Clone of VM's "temporary" probe routine, as the SA currently
does not support mutation so lookup() would have no effect
- anyway. Returns null if the given string is not in the symbol
- table. */
+ anyway. Searches the regular symbol table and the shared symbol
+ table. Null is returned if the given name is not found in both
+ tables. */
public Symbol probe(byte[] name) {
long hashValue = hashSymbol(name);
for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) {
@@ -85,7 +93,8 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable {
}
}
}
- return null;
+
+ return sharedTable.probe(name, hashValue);
}
public interface SymbolVisitor {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java
new file mode 100644
index 00000000000..d17c980bc7d
--- /dev/null
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2015, 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 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.jvm.hotspot.utilities;
+
+import java.util.*;
+import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.runtime.*;
+import sun.jvm.hotspot.utilities.*;
+
+public class CompactHashTable extends VMObject {
+ static {
+ VM.registerVMInitializedObserver(new Observer() {
+ public void update(Observable o, Object data) {
+ initialize(VM.getVM().getTypeDataBase());
+ }
+ });
+ }
+
+ private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
+ Type type = db.lookupType("SymbolCompactHashTable");
+ baseAddressField = type.getAddressField("_base_address");
+ bucketCountField = type.getCIntegerField("_bucket_count");
+ tableEndOffsetField = type.getCIntegerField("_table_end_offset");
+ bucketsField = type.getAddressField("_buckets");
+ uintSize = db.lookupType("juint").getSize();
+ }
+
+ // Fields
+ private static CIntegerField bucketCountField;
+ private static CIntegerField tableEndOffsetField;
+ private static AddressField baseAddressField;
+ private static AddressField bucketsField;
+ private static long uintSize;
+
+ private static int BUCKET_OFFSET_MASK = 0x3FFFFFFF;
+ private static int BUCKET_TYPE_SHIFT = 30;
+ private static int COMPACT_BUCKET_TYPE = 1;
+
+ public CompactHashTable(Address addr) {
+ super(addr);
+ }
+
+ private int bucketCount() {
+ return (int)bucketCountField.getValue(addr);
+ }
+
+ private int tableEndOffset() {
+ return (int)tableEndOffsetField.getValue(addr);
+ }
+
+ private boolean isCompactBucket(int bucket_info) {
+ return (bucket_info >> BUCKET_TYPE_SHIFT) == COMPACT_BUCKET_TYPE;
+ }
+
+ private int bucketOffset(int bucket_info) {
+ return bucket_info & BUCKET_OFFSET_MASK;
+ }
+
+ public Symbol probe(byte[] name, long hash) {
+ long symOffset;
+ Symbol sym;
+ Address baseAddress = baseAddressField.getValue(addr);
+ Address bucket = bucketsField.getValue(addr);
+ Address bucketEnd = bucket;
+ long index = hash % bucketCount();
+ int bucketInfo = (int)bucket.getCIntegerAt(index * uintSize, uintSize, true);
+ int bucketOffset = bucketOffset(bucketInfo);
+ int nextBucketInfo = (int)bucket.getCIntegerAt((index+1) * uintSize, uintSize, true);
+ int nextBucketOffset = bucketOffset(nextBucketInfo);
+
+ bucket = bucket.addOffsetTo(bucketOffset * uintSize);
+
+ if (isCompactBucket(bucketInfo)) {
+ symOffset = bucket.getCIntegerAt(0, uintSize, true);
+ sym = Symbol.create(baseAddress.addOffsetTo(symOffset));
+ if (sym.equals(name)) {
+ return sym;
+ }
+ } else {
+ bucketEnd = bucket.addOffsetTo(nextBucketOffset * uintSize);
+ while (bucket.lessThan(bucketEnd)) {
+ long symHash = bucket.getCIntegerAt(0, uintSize, true);
+ if (symHash == hash) {
+ symOffset = bucket.getCIntegerAt(uintSize, uintSize, true);
+ Address symAddr = baseAddress.addOffsetTo(symOffset);
+ sym = Symbol.create(symAddr);
+ if (sym.equals(name)) {
+ return sym;
+ }
+ }
+ bucket = bucket.addOffsetTo(2 * uintSize);
+ }
+ }
+ return null;
+ }
+}
diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
index 69c1e0d1be1..70d1420022d 100644
--- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
+++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp
@@ -143,7 +143,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
ShouldNotReachHere();
break;
default:
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
index 438d376b2c6..fe58233ced1 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -115,7 +115,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
ShouldNotReachHere();
break;
default :
diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp
index 71d89bb82f5..654f0689ec2 100644
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -123,7 +123,9 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
intptr_t* sender_sp = NULL;
+ intptr_t* sender_unextended_sp = NULL;
address sender_pc = NULL;
+ intptr_t* saved_fp = NULL;
if (is_interpreted_frame()) {
// fp must be safe
@@ -132,7 +134,12 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
sender_pc = (address) this->fp()[return_addr_offset];
+ // for interpreted frames, the value below is the sender "raw" sp,
+ // which can be different from the sender unextended sp (the sp seen
+ // by the sender) because of current frame local variables
sender_sp = (intptr_t*) addr_at(sender_sp_offset);
+ sender_unextended_sp = (intptr_t*) this->fp()[interpreter_frame_sender_sp_offset];
+ saved_fp = (intptr_t*) this->fp()[link_offset];
} else {
// must be some sort of compiled/runtime frame
@@ -144,8 +151,11 @@ bool frame::safe_for_sender(JavaThread *thread) {
}
sender_sp = _unextended_sp + _cb->frame_size();
+ sender_unextended_sp = sender_sp;
// On Intel the return_address is always the word on the stack
sender_pc = (address) *(sender_sp-1);
+ // Note: frame::sender_sp_offset is only valid for compiled frame
+ saved_fp = (intptr_t*) *(sender_sp - frame::sender_sp_offset);
}
@@ -156,7 +166,6 @@ bool frame::safe_for_sender(JavaThread *thread) {
// only if the sender is interpreted/call_stub (c1 too?) are we certain that the saved ebp
// is really a frame pointer.
- intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset);
bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp);
if (!saved_fp_safe) {
@@ -165,7 +174,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// construct the potential sender
- frame sender(sender_sp, saved_fp, sender_pc);
+ frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
return sender.is_interpreted_frame_valid(thread);
@@ -194,7 +203,6 @@ bool frame::safe_for_sender(JavaThread *thread) {
// Could be the call_stub
if (StubRoutines::returns_to_call_stub(sender_pc)) {
- intptr_t *saved_fp = (intptr_t*)*(sender_sp - frame::sender_sp_offset);
bool saved_fp_safe = ((address)saved_fp < thread->stack_base()) && (saved_fp > sender_sp);
if (!saved_fp_safe) {
@@ -203,7 +211,7 @@ bool frame::safe_for_sender(JavaThread *thread) {
// construct the potential sender
- frame sender(sender_sp, saved_fp, sender_pc);
+ frame sender(sender_sp, sender_unextended_sp, saved_fp, sender_pc);
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
@@ -568,8 +576,11 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
if (!m->is_valid_method()) return false;
// stack frames shouldn't be much larger than max_stack elements
-
- if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
+ // this test requires the use the unextended_sp which is the sp as seen by
+ // the current frame, and not sp which is the "raw" pc which could point
+ // further because of local variables of the callee method inserted after
+ // method arguments
+ if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) {
return false;
}
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index d0bdc33905c..1a8d8870c2a 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -185,7 +185,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
if (val == noreg) {
__ movptr(obj, NULL_WORD);
} else {
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index 82072f0c920..acb4e146415 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -189,7 +189,6 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
}
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
if (val == noreg) {
__ store_heap_oop_null(obj);
} else {
diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
index 8fe99af08ad..199b840629a 100644
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
@@ -1432,7 +1432,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
// No pre barriers
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
// No pre barriers
break;
default :
@@ -1454,7 +1453,6 @@ void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) {
CardTableModRef_post_barrier(addr, new_val);
break;
case BarrierSet::ModRef:
- case BarrierSet::Other:
// No post barriers
break;
default :
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index f80d0fcc00e..13449eef879 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -62,6 +62,7 @@
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"
+#include "utilities/resourceHash.hpp"
#if INCLUDE_CDS
#include "classfile/systemDictionaryShared.hpp"
#endif
@@ -693,7 +694,6 @@ void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Hand
}
-
class NameSigHash: public ResourceObj {
public:
Symbol* _name; // name
@@ -1370,6 +1370,33 @@ void ClassFileParser::parse_linenumber_table(
}
+class LVT_Hash : public AllStatic {
+ public:
+
+ static bool equals(LocalVariableTableElement const& e0, LocalVariableTableElement const& e1) {
+ /*
+ * 3-tuple start_bci/length/slot has to be unique key,
+ * so the following comparison seems to be redundant:
+ * && elem->name_cp_index == entry->_elem->name_cp_index
+ */
+ return (e0.start_bci == e1.start_bci &&
+ e0.length == e1.length &&
+ e0.name_cp_index == e1.name_cp_index &&
+ e0.slot == e1.slot);
+ }
+
+ static unsigned int hash(LocalVariableTableElement const& e0) {
+ unsigned int raw_hash = e0.start_bci;
+
+ raw_hash = e0.length + raw_hash * 37;
+ raw_hash = e0.name_cp_index + raw_hash * 37;
+ raw_hash = e0.slot + raw_hash * 37;
+
+ return raw_hash;
+ }
+};
+
+
// Class file LocalVariableTable elements.
class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
public:
@@ -1380,88 +1407,6 @@ class Classfile_LVT_Element VALUE_OBJ_CLASS_SPEC {
u2 slot;
};
-
-class LVT_Hash: public CHeapObj {
- public:
- LocalVariableTableElement *_elem; // element
- LVT_Hash* _next; // Next entry in hash table
-};
-
-unsigned int hash(LocalVariableTableElement *elem) {
- unsigned int raw_hash = elem->start_bci;
-
- raw_hash = elem->length + raw_hash * 37;
- raw_hash = elem->name_cp_index + raw_hash * 37;
- raw_hash = elem->slot + raw_hash * 37;
-
- return raw_hash % HASH_ROW_SIZE;
-}
-
-void initialize_hashtable(LVT_Hash** table) {
- for (int i = 0; i < HASH_ROW_SIZE; i++) {
- table[i] = NULL;
- }
-}
-
-void clear_hashtable(LVT_Hash** table) {
- for (int i = 0; i < HASH_ROW_SIZE; i++) {
- LVT_Hash* current = table[i];
- LVT_Hash* next;
- while (current != NULL) {
- next = current->_next;
- current->_next = NULL;
- delete(current);
- current = next;
- }
- table[i] = NULL;
- }
-}
-
-LVT_Hash* LVT_lookup(LocalVariableTableElement *elem, int index, LVT_Hash** table) {
- LVT_Hash* entry = table[index];
-
- /*
- * 3-tuple start_bci/length/slot has to be unique key,
- * so the following comparison seems to be redundant:
- * && elem->name_cp_index == entry->_elem->name_cp_index
- */
- while (entry != NULL) {
- if (elem->start_bci == entry->_elem->start_bci
- && elem->length == entry->_elem->length
- && elem->name_cp_index == entry->_elem->name_cp_index
- && elem->slot == entry->_elem->slot
- ) {
- return entry;
- }
- entry = entry->_next;
- }
- return NULL;
-}
-
-// Return false if the local variable is found in table.
-// Return true if no duplicate is found.
-// And local variable is added as a new entry in table.
-bool LVT_put_after_lookup(LocalVariableTableElement *elem, LVT_Hash** table) {
- // First lookup for duplicates
- int index = hash(elem);
- LVT_Hash* entry = LVT_lookup(elem, index, table);
-
- if (entry != NULL) {
- return false;
- }
- // No duplicate is found, allocate a new entry and fill it.
- if ((entry = new LVT_Hash()) == NULL) {
- return false;
- }
- entry->_elem = elem;
-
- // Insert into hash table
- entry->_next = table[index];
- table[index] = entry;
-
- return true;
-}
-
void copy_lvt_element(Classfile_LVT_Element *src, LocalVariableTableElement *lvt) {
lvt->start_bci = Bytes::get_Java_u2((u1*) &src->start_bci);
lvt->length = Bytes::get_Java_u2((u1*) &src->length);
@@ -1861,8 +1806,12 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm,
u2** localvariable_type_table_start,
TRAPS) {
- LVT_Hash** lvt_Hash = NEW_RESOURCE_ARRAY(LVT_Hash*, HASH_ROW_SIZE);
- initialize_hashtable(lvt_Hash);
+ ResourceMark rm(THREAD);
+
+ typedef ResourceHashtable LVT_HashTable;
+
+ LVT_HashTable* table = new LVT_HashTable();
// To fill LocalVariableTable in
Classfile_LVT_Element* cf_lvt;
@@ -1872,11 +1821,10 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm,
cf_lvt = (Classfile_LVT_Element *) localvariable_table_start[tbl_no];
for (int idx = 0; idx < localvariable_table_length[tbl_no]; idx++, lvt++) {
copy_lvt_element(&cf_lvt[idx], lvt);
- // If no duplicates, add LVT elem in hashtable lvt_Hash.
- if (LVT_put_after_lookup(lvt, lvt_Hash) == false
+ // If no duplicates, add LVT elem in hashtable.
+ if (table->put(*lvt, lvt) == false
&& _need_verify
&& _major_version >= JAVA_1_5_VERSION) {
- clear_hashtable(lvt_Hash);
classfile_parse_error("Duplicated LocalVariableTable attribute "
"entry for '%s' in class file %s",
_cp->symbol_at(lvt->name_cp_index)->as_utf8(),
@@ -1893,29 +1841,25 @@ void ClassFileParser::copy_localvariable_table(ConstMethod* cm,
cf_lvtt = (Classfile_LVT_Element *) localvariable_type_table_start[tbl_no];
for (int idx = 0; idx < localvariable_type_table_length[tbl_no]; idx++) {
copy_lvt_element(&cf_lvtt[idx], &lvtt_elem);
- int index = hash(&lvtt_elem);
- LVT_Hash* entry = LVT_lookup(&lvtt_elem, index, lvt_Hash);
+ LocalVariableTableElement** entry = table->get(lvtt_elem);
if (entry == NULL) {
if (_need_verify) {
- clear_hashtable(lvt_Hash);
classfile_parse_error("LVTT entry for '%s' in class file %s "
"does not match any LVT entry",
_cp->symbol_at(lvtt_elem.name_cp_index)->as_utf8(),
CHECK);
}
- } else if (entry->_elem->signature_cp_index != 0 && _need_verify) {
- clear_hashtable(lvt_Hash);
+ } else if ((*entry)->signature_cp_index != 0 && _need_verify) {
classfile_parse_error("Duplicated LocalVariableTypeTable attribute "
"entry for '%s' in class file %s",
_cp->symbol_at(lvtt_elem.name_cp_index)->as_utf8(),
CHECK);
} else {
// to add generic signatures into LocalVariableTable
- entry->_elem->signature_cp_index = lvtt_elem.descriptor_cp_index;
+ (*entry)->signature_cp_index = lvtt_elem.descriptor_cp_index;
}
}
}
- clear_hashtable(lvt_Hash);
}
diff --git a/hotspot/src/share/vm/classfile/compactHashtable.hpp b/hotspot/src/share/vm/classfile/compactHashtable.hpp
index 3e32fc07df9..28149643727 100644
--- a/hotspot/src/share/vm/classfile/compactHashtable.hpp
+++ b/hotspot/src/share/vm/classfile/compactHashtable.hpp
@@ -188,6 +188,7 @@ public:
// dump time.
//
template class CompactHashtable VALUE_OBJ_CLASS_SPEC {
+ friend class VMStructs;
uintx _base_address;
juint _entry_count;
juint _bucket_count;
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 0d81bbfec83..6759dd96761 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -3525,9 +3525,14 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure {
size_t card_index;
while (hrrs.has_next(card_index)) {
jbyte* card_ptr = (jbyte*)bs->byte_for_index(card_index);
- if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
- *card_ptr = CardTableModRefBS::dirty_card_val();
- _dcq.enqueue(card_ptr);
+ // The remembered set might contain references to already freed
+ // regions. Filter out such entries to avoid failing card table
+ // verification.
+ if (!g1h->heap_region_containing(bs->addr_for(card_ptr))->is_free()) {
+ if (*card_ptr != CardTableModRefBS::dirty_card_val()) {
+ *card_ptr = CardTableModRefBS::dirty_card_val();
+ _dcq.enqueue(card_ptr);
+ }
}
}
r->rem_set()->clear_locked();
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
index 175c5eb9448..2507d4e3e28 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp
@@ -139,6 +139,8 @@ G1CollectorPolicy::G1CollectorPolicy() :
_survivor_cset_region_length(0),
_old_cset_region_length(0),
+ _sigma(G1ConfidencePercent / 100.0),
+
_collection_set(NULL),
_collection_set_bytes_used_before(0),
@@ -161,17 +163,8 @@ G1CollectorPolicy::G1CollectorPolicy() :
_gc_overhead_perc(0.0) {
- uintx confidence_perc = G1ConfidencePercent;
- // Put an artificial ceiling on this so that it's not set to a silly value.
- if (confidence_perc > 100) {
- confidence_perc = 100;
- warning("G1ConfidencePercent is set to a value that is too large, "
- "it's been updated to %u", confidence_perc);
- }
- // '_sigma' must be initialized before the SurvRateGroups below because they
- // indirecty access '_sigma' trough the 'this' pointer in their constructor.
- _sigma = (double) confidence_perc / 100.0;
-
+ // SurvRateGroups below must be initialized after '_sigma' because they
+ // indirectly access '_sigma' through this object passed to their constructor.
_short_lived_surv_rate_group =
new SurvRateGroup(this, "Short Lived", G1YoungSurvRateNumRegionsSummary);
_survivor_surv_rate_group =
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
index b64f56146ee..e601ac369e4 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -36,11 +36,10 @@ void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
if (default_use_cache()) {
_use_cache = true;
- _hot_cache_size = (1 << G1ConcRSLogCacheSize);
+ _hot_cache_size = (size_t)1 << G1ConcRSLogCacheSize;
_hot_cache = NEW_C_HEAP_ARRAY(jbyte*, _hot_cache_size, mtGC);
- _n_hot = 0;
- _hot_cache_idx = 0;
+ reset_hot_cache_internal();
// For refining the cards in the hot cache in parallel
_hot_cache_par_chunk_size = ClaimChunkSize;
@@ -64,26 +63,21 @@ jbyte* G1HotCardCache::insert(jbyte* card_ptr) {
// return it for immediate refining.
return card_ptr;
}
-
// Otherwise, the card is hot.
- jbyte* res = NULL;
- MutexLockerEx x(HotCardCache_lock, Mutex::_no_safepoint_check_flag);
- if (_n_hot == _hot_cache_size) {
- res = _hot_cache[_hot_cache_idx];
- _n_hot--;
- }
+ size_t index = Atomic::add(1, &_hot_cache_idx) - 1;
+ size_t masked_index = index & (_hot_cache_size - 1);
+ jbyte* current_ptr = _hot_cache[masked_index];
- // Now _n_hot < _hot_cache_size, and we can insert at _hot_cache_idx.
- _hot_cache[_hot_cache_idx] = card_ptr;
- _hot_cache_idx++;
-
- if (_hot_cache_idx == _hot_cache_size) {
- // Wrap around
- _hot_cache_idx = 0;
- }
- _n_hot++;
-
- return res;
+ // Try to store the new card pointer into the cache. Compare-and-swap to guard
+ // against the unlikely event of a race resulting in another card pointer to
+ // have already been written to the cache. In this case we will return
+ // card_ptr in favor of the other option, which would be starting over. This
+ // should be OK since card_ptr will likely be the older card already when/if
+ // this ever happens.
+ jbyte* previous_ptr = (jbyte*)Atomic::cmpxchg_ptr(card_ptr,
+ &_hot_cache[masked_index],
+ current_ptr);
+ return (previous_ptr == current_ptr) ? previous_ptr : card_ptr;
}
void G1HotCardCache::drain(uint worker_i,
@@ -96,38 +90,38 @@ void G1HotCardCache::drain(uint worker_i,
assert(_hot_cache != NULL, "Logic");
assert(!use_cache(), "cache should be disabled");
- int start_idx;
- while ((start_idx = _hot_cache_par_claimed_idx) < _n_hot) { // read once
- int end_idx = start_idx + _hot_cache_par_chunk_size;
+ while (_hot_cache_par_claimed_idx < _hot_cache_size) {
+ size_t end_idx = Atomic::add(_hot_cache_par_chunk_size,
+ &_hot_cache_par_claimed_idx);
+ size_t start_idx = end_idx - _hot_cache_par_chunk_size;
+ // The current worker has successfully claimed the chunk [start_idx..end_idx)
+ end_idx = MIN2(end_idx, _hot_cache_size);
+ for (size_t i = start_idx; i < end_idx; i++) {
+ jbyte* card_ptr = _hot_cache[i];
+ if (card_ptr != NULL) {
+ if (g1rs->refine_card(card_ptr, worker_i, true)) {
+ // The part of the heap spanned by the card contains references
+ // that point into the current collection set.
+ // We need to record the card pointer in the DirtyCardQueueSet
+ // that we use for such cards.
+ //
+ // The only time we care about recording cards that contain
+ // references that point into the collection set is during
+ // RSet updating while within an evacuation pause.
+ // In this case worker_i should be the id of a GC worker thread
+ assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
+ assert(worker_i < ParallelGCThreads,
+ err_msg("incorrect worker id: %u", worker_i));
- if (start_idx ==
- Atomic::cmpxchg(end_idx, &_hot_cache_par_claimed_idx, start_idx)) {
- // The current worker has successfully claimed the chunk [start_idx..end_idx)
- end_idx = MIN2(end_idx, _n_hot);
- for (int i = start_idx; i < end_idx; i++) {
- jbyte* card_ptr = _hot_cache[i];
- if (card_ptr != NULL) {
- if (g1rs->refine_card(card_ptr, worker_i, true)) {
- // The part of the heap spanned by the card contains references
- // that point into the current collection set.
- // We need to record the card pointer in the DirtyCardQueueSet
- // that we use for such cards.
- //
- // The only time we care about recording cards that contain
- // references that point into the collection set is during
- // RSet updating while within an evacuation pause.
- // In this case worker_i should be the id of a GC worker thread
- assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
- assert(worker_i < ParallelGCThreads,
- err_msg("incorrect worker id: %u", worker_i));
-
- into_cset_dcq->enqueue(card_ptr);
- }
+ into_cset_dcq->enqueue(card_ptr);
}
+ } else {
+ break;
}
}
}
+
// The existing entries in the hot card cache, which were just refined
// above, are discarded prior to re-enabling the cache near the end of the GC.
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
index 691966a172f..b065e36ce9a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1HotCardCache.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -54,21 +54,30 @@ class HeapRegion;
// code, increasing throughput.
class G1HotCardCache: public CHeapObj {
- G1CollectedHeap* _g1h;
+
+ G1CollectedHeap* _g1h;
+
+ bool _use_cache;
+
+ G1CardCounts _card_counts;
// The card cache table
- jbyte** _hot_cache;
+ jbyte** _hot_cache;
- int _hot_cache_size;
- int _n_hot;
- int _hot_cache_idx;
+ size_t _hot_cache_size;
- int _hot_cache_par_chunk_size;
- volatile int _hot_cache_par_claimed_idx;
+ int _hot_cache_par_chunk_size;
- bool _use_cache;
+ // Avoids false sharing when concurrently updating _hot_cache_idx or
+ // _hot_cache_par_claimed_idx. These are never updated at the same time
+ // thus it's not necessary to separate them as well
+ char _pad_before[DEFAULT_CACHE_LINE_SIZE];
- G1CardCounts _card_counts;
+ volatile size_t _hot_cache_idx;
+
+ volatile size_t _hot_cache_par_claimed_idx;
+
+ char _pad_after[DEFAULT_CACHE_LINE_SIZE];
// The number of cached cards a thread claims when flushing the cache
static const int ClaimChunkSize = 32;
@@ -113,16 +122,25 @@ class G1HotCardCache: public CHeapObj {
void reset_hot_cache() {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at a safepoint");
assert(Thread::current()->is_VM_thread(), "Current thread should be the VMthread");
- _hot_cache_idx = 0; _n_hot = 0;
+ if (default_use_cache()) {
+ reset_hot_cache_internal();
+ }
}
- bool hot_cache_is_empty() { return _n_hot == 0; }
-
// Zeros the values in the card counts table for entire committed heap
void reset_card_counts();
// Zeros the values in the card counts table for the given region
void reset_card_counts(HeapRegion* hr);
+
+ private:
+ void reset_hot_cache_internal() {
+ assert(_hot_cache != NULL, "Logic");
+ _hot_cache_idx = 0;
+ for (size_t i = 0; i < _hot_cache_size; i++) {
+ _hot_cache[i] = NULL;
+ }
+ }
};
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1HOTCARDCACHE_HPP
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
index c6a1aef2420..13cc179ac94 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
@@ -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
@@ -32,11 +32,8 @@
#include "runtime/orderAccess.inline.hpp"
#include "runtime/thread.inline.hpp"
-G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap)
-{
- _kind = G1SATBCT;
-}
+G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
+ CardTableModRefBS(whole_heap, kind) { }
void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
// Nulls should have been already filtered.
@@ -132,11 +129,10 @@ void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, si
G1SATBCardTableLoggingModRefBS::
G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
- G1SATBCardTableModRefBS(whole_heap),
+ G1SATBCardTableModRefBS(whole_heap, BarrierSet::G1SATBCTLogging),
_dcqs(JavaThread::dirty_card_queue_set()),
_listener()
{
- _kind = G1SATBCTLogging;
_listener.set_card_table(this);
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
index c4d9318b071..50203ce928a 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp
@@ -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
@@ -43,6 +43,9 @@ protected:
g1_young_gen = CT_MR_BS_last_reserved << 1
};
+ G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
+ ~G1SATBCardTableModRefBS() { }
+
public:
static int g1_young_card_val() { return g1_young_gen; }
@@ -50,8 +53,6 @@ public:
// pre-marking object graph.
static void enqueue(oop pre_val);
- G1SATBCardTableModRefBS(MemRegion whole_heap);
-
bool is_a(BarrierSet::Name bsn) {
return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
}
diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
index d5eaf9f8da3..68a67678208 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
@@ -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
@@ -420,7 +420,7 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
oop obj;
HeapWord* next = cur;
- while (next <= start) {
+ do {
cur = next;
obj = oop(cur);
if (obj->klass_or_null() == NULL) {
@@ -429,45 +429,38 @@ oops_on_card_seq_iterate_careful(MemRegion mr,
}
// Otherwise...
next = cur + block_size(cur);
- }
+ } while (next <= start);
// If we finish the above loop...We have a parseable object that
// begins on or before the start of the memory region, and ends
// inside or spans the entire region.
-
- assert(obj == oop(cur), "sanity");
assert(cur <= start, "Loop postcondition");
assert(obj->klass_or_null() != NULL, "Loop postcondition");
- assert((cur + block_size(cur)) > start, "Loop postcondition");
- if (!g1h->is_obj_dead(obj)) {
- obj->oop_iterate(cl, mr);
- }
-
- while (cur < end) {
+ do {
obj = oop(cur);
+ assert((cur + block_size(cur)) > (HeapWord*)obj, "Loop invariant");
if (obj->klass_or_null() == NULL) {
// Ran into an unparseable point.
return cur;
- };
+ }
- // Otherwise:
- next = cur + block_size(cur);
+ // Advance the current pointer. "obj" still points to the object to iterate.
+ cur = cur + block_size(cur);
if (!g1h->is_obj_dead(obj)) {
- if (next < end || !obj->is_objArray()) {
- // This object either does not span the MemRegion
- // boundary, or if it does it's not an array.
- // Apply closure to whole object.
+ // Non-objArrays are sometimes marked imprecise at the object start. We
+ // always need to iterate over them in full.
+ // We only iterate over object arrays in full if they are completely contained
+ // in the memory region.
+ if (!obj->is_objArray() || (((HeapWord*)obj) >= start && cur <= end)) {
obj->oop_iterate(cl);
} else {
- // This obj is an array that spans the boundary.
- // Stop at the boundary.
obj->oop_iterate(cl, mr);
}
}
- cur = next;
- }
+ } while (cur < end);
+
return NULL;
}
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp
index 1fc55ad081b..d2d3319da75 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, 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
@@ -54,7 +54,7 @@ class CardTableExtension : public CardTableModRefBS {
};
CardTableExtension(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap) { }
+ CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) { }
// Too risky for the 4/10/02 putback
// BarrierSet::Name kind() { return BarrierSet::CardTableExtension; }
diff --git a/hotspot/src/share/vm/gc_interface/gcCause.cpp b/hotspot/src/share/vm/gc_interface/gcCause.cpp
index a364214bdd2..3e0b9dd750d 100644
--- a/hotspot/src/share/vm/gc_interface/gcCause.cpp
+++ b/hotspot/src/share/vm/gc_interface/gcCause.cpp
@@ -103,6 +103,9 @@ const char* GCCause::to_string(GCCause::Cause cause) {
case _last_ditch_collection:
return "Last ditch collection";
+ case _dcmd_gc_run:
+ return "Diagnostic Command";
+
case _last_gc_cause:
return "ILLEGAL VALUE - last gc cause - ILLEGAL VALUE";
diff --git a/hotspot/src/share/vm/gc_interface/gcCause.hpp b/hotspot/src/share/vm/gc_interface/gcCause.hpp
index cb304294639..df4a212213f 100644
--- a/hotspot/src/share/vm/gc_interface/gcCause.hpp
+++ b/hotspot/src/share/vm/gc_interface/gcCause.hpp
@@ -74,6 +74,9 @@ class GCCause : public AllStatic {
_g1_humongous_allocation,
_last_ditch_collection,
+
+ _dcmd_gc_run,
+
_last_gc_cause
};
diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp
index 08d354c36df..c27d8f4d6f6 100644
--- a/hotspot/src/share/vm/memory/barrierSet.hpp
+++ b/hotspot/src/share/vm/memory/barrierSet.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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
@@ -39,9 +39,7 @@ public:
CardTableModRef,
CardTableExtension,
G1SATBCT,
- G1SATBCTLogging,
- Other,
- Uninit
+ G1SATBCTLogging
};
enum Flags {
@@ -57,9 +55,11 @@ protected:
static const int _max_covered_regions = 2;
Name _kind;
+ BarrierSet(Name kind) : _kind(kind) { }
+ ~BarrierSet() { }
+
public:
- BarrierSet() { _kind = Uninit; }
// To get around prohibition on RTTI.
BarrierSet::Name kind() { return _kind; }
virtual bool is_a(BarrierSet::Name bsn) = 0;
diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
index d3586332b2f..4539d53c898 100644
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, 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
@@ -53,8 +53,8 @@ size_t CardTableModRefBS::compute_byte_map_size()
return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
}
-CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
- ModRefBarrierSet(),
+CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
+ ModRefBarrierSet(kind),
_whole_heap(whole_heap),
_guard_index(0),
_guard_region(),
@@ -72,8 +72,6 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
_lowest_non_clean_base_chunk_index(NULL),
_last_LNC_resizing_collection(NULL)
{
- _kind = BarrierSet::CardTableModRef;
-
assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary");
diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
index 73f922b47dd..e0890ed1f6e 100644
--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, 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
@@ -284,20 +284,22 @@ public:
return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
}
- CardTableModRefBS(MemRegion whole_heap);
- ~CardTableModRefBS();
-
virtual void initialize();
// *** Barrier set functions.
bool has_write_ref_pre_barrier() { return false; }
+protected:
+
+ CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
+ ~CardTableModRefBS();
+
// Record a reference update. Note that these versions are precise!
// The scanning code has to handle the fact that the write barrier may be
// either precise or imprecise. We make non-virtual inline variants of
// these functions here for performance.
-protected:
+
void write_ref_field_work(oop obj, size_t offset, oop newVal);
virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
public:
@@ -478,7 +480,7 @@ protected:
bool card_may_have_been_dirty(jbyte cv);
public:
CardTableModRefBSForCTRS(MemRegion whole_heap) :
- CardTableModRefBS(whole_heap) {}
+ CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) {}
void set_CTRS(CardTableRS* rs) { _rs = rs; }
};
diff --git a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp
index a320e61c854..394d2c513a6 100644
--- a/hotspot/src/share/vm/memory/modRefBarrierSet.hpp
+++ b/hotspot/src/share/vm/memory/modRefBarrierSet.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, 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,8 +37,6 @@ class Generation;
class ModRefBarrierSet: public BarrierSet {
public:
- ModRefBarrierSet() { _kind = BarrierSet::ModRef; }
-
bool is_a(BarrierSet::Name bsn) {
return bsn == BarrierSet::ModRef;
}
@@ -59,7 +57,12 @@ public:
void read_ref_field(void* field) {}
void read_prim_field(HeapWord* field, size_t bytes) {}
+
protected:
+
+ ModRefBarrierSet(BarrierSet::Name kind) : BarrierSet(kind) { }
+ ~ModRefBarrierSet() { }
+
virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
public:
void write_prim_field(HeapWord* field, size_t bytes,
diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp
index 20932a5bd51..e185d85958f 100644
--- a/hotspot/src/share/vm/opto/graphKit.cpp
+++ b/hotspot/src/share/vm/opto/graphKit.cpp
@@ -1528,7 +1528,6 @@ void GraphKit::pre_barrier(bool do_load,
case BarrierSet::ModRef:
break;
- case BarrierSet::Other:
default :
ShouldNotReachHere();
@@ -1547,7 +1546,6 @@ bool GraphKit::can_move_pre_barrier() const {
case BarrierSet::ModRef:
return true; // There is no pre-barrier
- case BarrierSet::Other:
default :
ShouldNotReachHere();
}
@@ -1578,7 +1576,6 @@ void GraphKit::post_barrier(Node* ctl,
case BarrierSet::ModRef:
break;
- case BarrierSet::Other:
default :
ShouldNotReachHere();
diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp
index 6096c98b29f..9dc0591f0d2 100644
--- a/hotspot/src/share/vm/runtime/arguments.cpp
+++ b/hotspot/src/share/vm/runtime/arguments.cpp
@@ -57,18 +57,6 @@
#define DEFAULT_VENDOR_URL_BUG "http://bugreport.java.com/bugreport/crash.jsp"
#define DEFAULT_JAVA_LAUNCHER "generic"
-// Disable options not supported in this release, with a warning if they
-// were explicitly requested on the command-line
-#define UNSUPPORTED_OPTION(opt, description) \
-do { \
- if (opt) { \
- if (FLAG_IS_CMDLINE(opt)) { \
- warning(description " is disabled in this release."); \
- } \
- FLAG_SET_DEFAULT(opt, false); \
- } \
-} while(0)
-
#define UNSUPPORTED_GC_OPTION(gc) \
do { \
if (gc) { \
@@ -2316,6 +2304,7 @@ bool Arguments::check_vm_args_consistency() {
status = status && verify_percentage(G1MaxNewSizePercent, "G1MaxNewSizePercent");
status = status && verify_interval(G1NewSizePercent, 0, G1MaxNewSizePercent, "G1NewSizePercent");
+ status = status && verify_percentage(G1ConfidencePercent, "G1ConfidencePercent");
status = status && verify_percentage(InitiatingHeapOccupancyPercent,
"InitiatingHeapOccupancyPercent");
status = status && verify_min_value(G1RefProcDrainInterval, 1,
@@ -3853,6 +3842,8 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
#endif
#endif
+ ArgumentsExt::report_unsupported_options();
+
#ifndef PRODUCT
if (TraceBytecodesAt != 0) {
TraceBytecodes = true;
diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp
index ae726b82fdc..9994118577d 100644
--- a/hotspot/src/share/vm/runtime/arguments.hpp
+++ b/hotspot/src/share/vm/runtime/arguments.hpp
@@ -632,4 +632,16 @@ bool Arguments::check_gc_consistency_ergo() {
return check_gc_consistency_user();
}
+// Disable options not supported in this release, with a warning if they
+// were explicitly requested on the command-line
+#define UNSUPPORTED_OPTION(opt, description) \
+do { \
+ if (opt) { \
+ if (FLAG_IS_CMDLINE(opt)) { \
+ warning(description " is disabled in this release."); \
+ } \
+ FLAG_SET_DEFAULT(opt, false); \
+ } \
+} while(0)
+
#endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP
diff --git a/hotspot/src/share/vm/runtime/arguments_ext.hpp b/hotspot/src/share/vm/runtime/arguments_ext.hpp
index 4e7415154bf..9c716bc6581 100644
--- a/hotspot/src/share/vm/runtime/arguments_ext.hpp
+++ b/hotspot/src/share/vm/runtime/arguments_ext.hpp
@@ -37,6 +37,7 @@ public:
// no additional parsing needed in Arguments::parse() for the option.
// Otherwise returns false.
static inline bool process_options(const JavaVMOption *option) { return false; }
+ static inline void report_unsupported_options() { }
};
void ArgumentsExt::select_gc_ergonomically() {
diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp
index 11badd0c17b..351a4eb3702 100644
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -120,7 +120,6 @@ Monitor* SecondaryFreeList_lock = NULL;
Mutex* OldSets_lock = NULL;
Monitor* RootRegionScan_lock = NULL;
Mutex* MMUTracker_lock = NULL;
-Mutex* HotCardCache_lock = NULL;
Monitor* GCTaskManager_lock = NULL;
@@ -199,7 +198,6 @@ void mutex_init() {
def(OldSets_lock , Mutex , leaf , true, Monitor::_safepoint_check_never);
def(RootRegionScan_lock , Monitor, leaf , true, Monitor::_safepoint_check_never);
def(MMUTracker_lock , Mutex , leaf , true, Monitor::_safepoint_check_never);
- def(HotCardCache_lock , Mutex , special , true, Monitor::_safepoint_check_never);
def(EvacFailureStack_lock , Mutex , nonleaf , true, Monitor::_safepoint_check_never);
def(StringDedupQueue_lock , Monitor, leaf, true, Monitor::_safepoint_check_never);
diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp
index 8ec82fc63dd..39b5571e305 100644
--- a/hotspot/src/share/vm/runtime/mutexLocker.hpp
+++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -122,7 +122,6 @@ extern Mutex* OldSets_lock; // protects the old region sets
extern Monitor* RootRegionScan_lock; // used to notify that the CM threads have finished scanning the IM snapshot regions
extern Mutex* MMUTracker_lock; // protects the MMU
// tracker data structures
-extern Mutex* HotCardCache_lock; // protects the hot card cache
extern Mutex* Management_lock; // a lock used to serialize JVM management
extern Monitor* Service_lock; // a lock used for service thread operation
diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp
index 5b3ca8a6b42..e83fe1ab3dc 100644
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, 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
@@ -27,6 +27,7 @@
#include "classfile/javaClasses.hpp"
#include "classfile/loaderConstraints.hpp"
#include "classfile/placeholders.hpp"
+#include "classfile/compactHashtable.hpp"
#include "classfile/stringTable.hpp"
#include "classfile/systemDictionary.hpp"
#include "ci/ciField.hpp"
@@ -243,6 +244,7 @@ typedef TwoOopHashtable KlassTwoOopHashtable;
typedef Hashtable KlassHashtable;
typedef HashtableEntry KlassHashtableEntry;
typedef TwoOopHashtable SymbolTwoOopHashtable;
+typedef CompactHashtable SymbolCompactHashTable;
//--------------------------------------------------------------------------------
// VM_STRUCTS
@@ -624,6 +626,7 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
/***************/ \
\
static_field(SymbolTable, _the_table, SymbolTable*) \
+ static_field(SymbolTable, _shared_table, SymbolCompactHashTable) \
\
/***************/ \
/* StringTable */ \
@@ -632,6 +635,16 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
static_field(StringTable, _the_table, StringTable*) \
\
/********************/ \
+ /* CompactHashTable */ \
+ /********************/ \
+ \
+ nonstatic_field(SymbolCompactHashTable, _base_address, uintx) \
+ nonstatic_field(SymbolCompactHashTable, _entry_count, juint) \
+ nonstatic_field(SymbolCompactHashTable, _bucket_count, juint) \
+ nonstatic_field(SymbolCompactHashTable, _table_end_offset, juint) \
+ nonstatic_field(SymbolCompactHashTable, _buckets, juint*) \
+ \
+ /********************/ \
/* SystemDictionary */ \
/********************/ \
\
@@ -1580,6 +1593,8 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
declare_type(ResourceArea, Arena) \
declare_toplevel_type(Chunk) \
\
+ declare_toplevel_type(SymbolCompactHashTable) \
+ \
/***********************************************************/ \
/* Thread hierarchy (needed for run-time type information) */ \
/***********************************************************/ \
@@ -2213,7 +2228,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable;
declare_constant(BarrierSet::CardTableExtension) \
declare_constant(BarrierSet::G1SATBCT) \
declare_constant(BarrierSet::G1SATBCTLogging) \
- declare_constant(BarrierSet::Other) \
\
declare_constant(BlockOffsetSharedArray::LogN) \
declare_constant(BlockOffsetSharedArray::LogN_words) \
diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp
index a1853ea2464..d5abd05afa6 100644
--- a/hotspot/src/share/vm/services/diagnosticCommand.cpp
+++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp
@@ -267,7 +267,7 @@ int VMUptimeDCmd::num_arguments() {
void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
if (!DisableExplicitGC) {
- Universe::heap()->collect(GCCause::_java_lang_system_gc);
+ Universe::heap()->collect(GCCause::_dcmd_gc_run);
} else {
output()->print_cr("Explicit GC is disabled, no GC has been performed.");
}
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 8c52e3ac175..6a58000bd30 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -97,7 +97,7 @@ needs_jdk = \
runtime/XCheckJniJsig/XCheckJSig.java \
serviceability/attach/AttachWithStalePidFile.java \
serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \
- serviceability/dcmd/DynLibDcmdTest.java
+ serviceability/dcmd/vm/DynLibsTest.java
# JRE adds further tests to compact3
@@ -145,7 +145,8 @@ needs_compact3 = \
gc/survivorAlignment \
runtime/InternalApi/ThreadCpuTimesDeadlock.java \
serviceability/threads/TestFalseDeadLock.java \
- compiler/codecache/jmx
+ compiler/codecache/jmx \
+ serviceability/dcmd
# Compact 2 adds full VM tests
compact2 = \
@@ -224,6 +225,7 @@ needs_g1gc = \
gc/arguments/TestAlignmentToUseLargePages.java \
gc/arguments/TestG1HeapRegionSize.java \
gc/arguments/TestG1HeapSizeFlags.java \
+ gc/arguments/TestG1PercentageOptions.java \
gc/arguments/TestMaxHeapSizeTools.java \
gc/arguments/TestMaxNewSize.java \
gc/arguments/TestParallelGCThreads.java \
diff --git a/hotspot/test/gc/arguments/TestG1PercentageOptions.java b/hotspot/test/gc/arguments/TestG1PercentageOptions.java
new file mode 100644
index 00000000000..f66656f80da
--- /dev/null
+++ b/hotspot/test/gc/arguments/TestG1PercentageOptions.java
@@ -0,0 +1,89 @@
+/*
+* 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 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 TestG1PercentageOptions
+ * @key gc
+ * @bug 8068942
+ * @summary Test argument processing of various percentage options
+ * @library /testlibrary
+ * @run driver TestG1PercentageOptions
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class TestG1PercentageOptions {
+
+ private static final class OptionDescription {
+ public final String name;
+ public final String[] valid;
+ public final String[] invalid;
+
+ OptionDescription(String name_, String[] valid_, String[] invalid_) {
+ name = name_;
+ valid = valid_;
+ invalid = invalid_;
+ }
+ }
+
+ private static final String[] defaultValid = new String[] {
+ "0", "1", "50", "95", "100" };
+ private static final String[] defaultInvalid = new String[] {
+ "-10", "110", "bad" };
+
+ // All of the G1 product arguments that are percentages.
+ private static final OptionDescription[] percentOptions = new OptionDescription[] {
+ new OptionDescription("G1ConfidencePercent", defaultValid, defaultInvalid)
+ // Other percentage options are not yet validated by argument processing.
+ };
+
+ private static void check(String flag, boolean is_valid) throws Exception {
+ String[] flags = new String[] { "-XX:+UseG1GC", flag, "-version" };
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(flags);
+ OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ if (is_valid) {
+ output.shouldHaveExitValue(0);
+ } else {
+ output.shouldHaveExitValue(1);
+ }
+ }
+
+ private static
+ void check(String name, String value, boolean is_valid) throws Exception {
+ check("-XX:" + name + "=" + value, is_valid);
+ }
+
+ public static void main(String args[]) throws Exception {
+ for (OptionDescription option : percentOptions) {
+ for (String value : option.valid) {
+ check(option.name, value, true);
+ }
+ for (String value : option.invalid) {
+ check(option.name, value, false);
+ }
+ check("-XX:" + option.name, false);
+ check("-XX:+" + option.name, false);
+ check("-XX:-" + option.name, false);
+ }
+ }
+}
diff --git a/hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod b/hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod
new file mode 100644
index 00000000000..6fca8eeab51
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/DuplicateLVT.cod
@@ -0,0 +1,293 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// This creates a duplicate LVT entry
+
+class DuplicateLVT {
+ 0xCAFEBABE;
+ 0; // minor version
+ 52; // version
+ [] { // Constant Pool
+ ; // first element is empty
+ Method #34 #68; // #1
+ double 0x3FF199999999999A;; // #2
+ float 0x3F99999A; // #4
+ long 0xFFFFFFFFCAFEBABE;; // #5
+ class #69; // #7
+ Method #7 #68; // #8
+ String #70; // #9
+ Method #7 #71; // #10
+ Field #72 #73; // #11
+ class #74; // #12
+ Method #12 #68; // #13
+ String #75; // #14
+ Method #12 #76; // #15
+ Method #12 #77; // #16
+ Method #12 #78; // #17
+ Method #79 #80; // #18
+ String #81; // #19
+ Method #12 #82; // #20
+ String #83; // #21
+ Method #12 #84; // #22
+ String #85; // #23
+ Method #12 #86; // #24
+ String #87; // #25
+ Method #12 #88; // #26
+ String #89; // #27
+ String #90; // #28
+ Method #12 #91; // #29
+ String #92; // #30
+ String #93; // #31
+ Method #12 #94; // #32
+ class #95; // #33
+ class #96; // #34
+ Utf8 ""; // #35
+ Utf8 "()V"; // #36
+ Utf8 "Code"; // #37
+ Utf8 "LineNumberTable"; // #38
+ Utf8 "LocalVariableTable"; // #39
+ Utf8 "this"; // #40
+ Utf8 "LDuplicateLVT;"; // #41
+ Utf8 "main"; // #42
+ Utf8 "([Ljava/lang/String;)V"; // #43
+ Utf8 "args"; // #44
+ Utf8 "[Ljava/lang/String;"; // #45
+ Utf8 "b"; // #46
+ Utf8 "Z"; // #47
+ Utf8 "by"; // #48
+ Utf8 "B"; // #49
+ Utf8 "c"; // #50
+ Utf8 "C"; // #51
+ Utf8 "d"; // #52
+ Utf8 "D"; // #53
+ Utf8 "f"; // #54
+ Utf8 "F"; // #55
+ Utf8 "i"; // #56
+ Utf8 "I"; // #57
+ Utf8 "l"; // #58
+ Utf8 "J"; // #59
+ Utf8 "s"; // #60
+ Utf8 "S"; // #61
+ Utf8 "list"; // #62
+ Utf8 "Ljava/util/ArrayList;"; // #63
+ Utf8 "LocalVariableTypeTable"; // #64
+ Utf8 "Ljava/util/ArrayList;"; // #65
+ Utf8 "SourceFile"; // #66
+ Utf8 "DuplicateLVT.java"; // #67
+ NameAndType #35 #36; // #68
+ Utf8 "java/util/ArrayList"; // #69
+ Utf8 "me"; // #70
+ NameAndType #97 #98; // #71
+ class #99; // #72
+ NameAndType #100 #101; // #73
+ Utf8 "java/lang/StringBuilder"; // #74
+ Utf8 "b="; // #75
+ NameAndType #102 #103; // #76
+ NameAndType #102 #104; // #77
+ NameAndType #105 #106; // #78
+ class #107; // #79
+ NameAndType #108 #109; // #80
+ Utf8 "by="; // #81
+ NameAndType #102 #110; // #82
+ Utf8 "c="; // #83
+ NameAndType #102 #111; // #84
+ Utf8 "d="; // #85
+ NameAndType #102 #112; // #86
+ Utf8 "f="; // #87
+ NameAndType #102 #113; // #88
+ Utf8 "i="; // #89
+ Utf8 "l="; // #90
+ NameAndType #102 #114; // #91
+ Utf8 "s="; // #92
+ Utf8 "ArrayList="; // #93
+ NameAndType #102 #115; // #94
+ Utf8 "DuplicateLVT"; // #95
+ Utf8 "java/lang/Object"; // #96
+ Utf8 "add"; // #97
+ Utf8 "(Ljava/lang/Object;)Z"; // #98
+ Utf8 "java/lang/System"; // #99
+ Utf8 "out"; // #100
+ Utf8 "Ljava/io/PrintStream;"; // #101
+ Utf8 "append"; // #102
+ Utf8 "(Ljava/lang/String;)Ljava/lang/StringBuilder;"; // #103
+ Utf8 "(Z)Ljava/lang/StringBuilder;"; // #104
+ Utf8 "toString"; // #105
+ Utf8 "()Ljava/lang/String;"; // #106
+ Utf8 "java/io/PrintStream"; // #107
+ Utf8 "println"; // #108
+ Utf8 "(Ljava/lang/String;)V"; // #109
+ Utf8 "(I)Ljava/lang/StringBuilder;"; // #110
+ Utf8 "(C)Ljava/lang/StringBuilder;"; // #111
+ Utf8 "(D)Ljava/lang/StringBuilder;"; // #112
+ Utf8 "(F)Ljava/lang/StringBuilder;"; // #113
+ Utf8 "(J)Ljava/lang/StringBuilder;"; // #114
+ Utf8 "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"; // #115
+ } // Constant Pool
+
+ 0x0021; // access
+ #33;// this_cpx
+ #34;// super_cpx
+
+ [] { // Interfaces
+ } // Interfaces
+
+ [] { // fields
+ } // fields
+
+ [] { // methods
+ { // Member
+ 0x0001; // access
+ #35; // name_cpx
+ #36; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 1; // max_stack
+ 1; // max_locals
+ Bytes[]{
+ 0x2AB70001B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 26;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 5 40 41 0;
+ }
+ } // end LocalVariableTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ ;
+ { // Member
+ 0x0009; // access
+ #42; // name_cpx
+ #43; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 4; // max_stack
+ 12; // max_locals
+ Bytes[]{
+ 0x043C10423D10583E;
+ 0x1400023904120438;
+ 0x06102A3607140005;
+ 0x37081058360ABB00;
+ 0x0759B700083A0B19;
+ 0x0B1209B6000A57B2;
+ 0x000BBB000C59B700;
+ 0x0D120EB6000F1BB6;
+ 0x0010B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D1213B6000F1C;
+ 0xB60014B60011B600;
+ 0x12B2000BBB000C59;
+ 0xB7000D1215B6000F;
+ 0x1DB60016B60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D1217B600;
+ 0x0F1804B60018B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D1219;
+ 0xB6000F1706B6001A;
+ 0xB60011B60012B200;
+ 0x0BBB000C59B7000D;
+ 0x121BB6000F1507B6;
+ 0x0014B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D121CB6000F16;
+ 0x08B6001DB60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D121EB600;
+ 0x0F150AB60014B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D121F;
+ 0xB6000F190BB60020;
+ 0xB60011B60012B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 28;
+ 2 29;
+ 5 30;
+ 8 31;
+ 13 32;
+ 17 33;
+ 21 34;
+ 26 35;
+ 30 36;
+ 39 37;
+ 47 39;
+ 72 40;
+ 97 41;
+ 122 42;
+ 148 43;
+ 174 44;
+ 200 45;
+ 226 46;
+ 252 47;
+ 278 48;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 279 44 45 0;
+ 2 277 46 47 1;
+ 5 274 48 49 2;
+ 5 274 48 49 2;
+ 8 271 50 51 3;
+ 13 266 52 53 4;
+ 17 262 54 55 6;
+ 21 258 56 57 7;
+ 26 253 58 59 8;
+ 30 249 60 61 10;
+ 39 240 62 63 11;
+ }
+ } // end LocalVariableTable
+ ;
+ Attr(#64) { // LocalVariableTypeTable
+ [] { // LocalVariableTypeTable
+ 39 240 62 65 11;
+ }
+ } // end LocalVariableTypeTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ } // methods
+
+ [] { // Attributes
+ Attr(#66) { // SourceFile
+ #67;
+ } // end SourceFile
+ } // Attributes
+} // end class DuplicateLVT
diff --git a/hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod b/hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod
new file mode 100644
index 00000000000..191c115a4e8
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/DuplicateLVTT.cod
@@ -0,0 +1,293 @@
+/*
+ * 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 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.
+ */
+
+// There's a duplicate LVTT entry below.
+
+class DuplicateLVTT {
+ 0xCAFEBABE;
+ 0; // minor version
+ 52; // version
+ [] { // Constant Pool
+ ; // first element is empty
+ Method #34 #68; // #1
+ double 0x3FF199999999999A;; // #2
+ float 0x3F99999A; // #4
+ long 0xFFFFFFFFCAFEBABE;; // #5
+ class #69; // #7
+ Method #7 #68; // #8
+ String #70; // #9
+ Method #7 #71; // #10
+ Field #72 #73; // #11
+ class #74; // #12
+ Method #12 #68; // #13
+ String #75; // #14
+ Method #12 #76; // #15
+ Method #12 #77; // #16
+ Method #12 #78; // #17
+ Method #79 #80; // #18
+ String #81; // #19
+ Method #12 #82; // #20
+ String #83; // #21
+ Method #12 #84; // #22
+ String #85; // #23
+ Method #12 #86; // #24
+ String #87; // #25
+ Method #12 #88; // #26
+ String #89; // #27
+ String #90; // #28
+ Method #12 #91; // #29
+ String #92; // #30
+ String #93; // #31
+ Method #12 #94; // #32
+ class #95; // #33
+ class #96; // #34
+ Utf8 ""; // #35
+ Utf8 "()V"; // #36
+ Utf8 "Code"; // #37
+ Utf8 "LineNumberTable"; // #38
+ Utf8 "LocalVariableTable"; // #39
+ Utf8 "this"; // #40
+ Utf8 "LDuplicateLVTT;"; // #41
+ Utf8 "main"; // #42
+ Utf8 "([Ljava/lang/String;)V"; // #43
+ Utf8 "args"; // #44
+ Utf8 "[Ljava/lang/String;"; // #45
+ Utf8 "b"; // #46
+ Utf8 "Z"; // #47
+ Utf8 "by"; // #48
+ Utf8 "B"; // #49
+ Utf8 "c"; // #50
+ Utf8 "C"; // #51
+ Utf8 "d"; // #52
+ Utf8 "D"; // #53
+ Utf8 "f"; // #54
+ Utf8 "F"; // #55
+ Utf8 "i"; // #56
+ Utf8 "I"; // #57
+ Utf8 "l"; // #58
+ Utf8 "J"; // #59
+ Utf8 "s"; // #60
+ Utf8 "S"; // #61
+ Utf8 "list"; // #62
+ Utf8 "Ljava/util/ArrayList;"; // #63
+ Utf8 "LocalVariableTypeTable"; // #64
+ Utf8 "Ljava/util/ArrayList;"; // #65
+ Utf8 "SourceFile"; // #66
+ Utf8 "DuplicateLVTT.java"; // #67
+ NameAndType #35 #36; // #68
+ Utf8 "java/util/ArrayList"; // #69
+ Utf8 "me"; // #70
+ NameAndType #97 #98; // #71
+ class #99; // #72
+ NameAndType #100 #101; // #73
+ Utf8 "java/lang/StringBuilder"; // #74
+ Utf8 "b="; // #75
+ NameAndType #102 #103; // #76
+ NameAndType #102 #104; // #77
+ NameAndType #105 #106; // #78
+ class #107; // #79
+ NameAndType #108 #109; // #80
+ Utf8 "by="; // #81
+ NameAndType #102 #110; // #82
+ Utf8 "c="; // #83
+ NameAndType #102 #111; // #84
+ Utf8 "d="; // #85
+ NameAndType #102 #112; // #86
+ Utf8 "f="; // #87
+ NameAndType #102 #113; // #88
+ Utf8 "i="; // #89
+ Utf8 "l="; // #90
+ NameAndType #102 #114; // #91
+ Utf8 "s="; // #92
+ Utf8 "ArrayList="; // #93
+ NameAndType #102 #115; // #94
+ Utf8 "DuplicateLVTT"; // #95
+ Utf8 "java/lang/Object"; // #96
+ Utf8 "add"; // #97
+ Utf8 "(Ljava/lang/Object;)Z"; // #98
+ Utf8 "java/lang/System"; // #99
+ Utf8 "out"; // #100
+ Utf8 "Ljava/io/PrintStream;"; // #101
+ Utf8 "append"; // #102
+ Utf8 "(Ljava/lang/String;)Ljava/lang/StringBuilder;"; // #103
+ Utf8 "(Z)Ljava/lang/StringBuilder;"; // #104
+ Utf8 "toString"; // #105
+ Utf8 "()Ljava/lang/String;"; // #106
+ Utf8 "java/io/PrintStream"; // #107
+ Utf8 "println"; // #108
+ Utf8 "(Ljava/lang/String;)V"; // #109
+ Utf8 "(I)Ljava/lang/StringBuilder;"; // #110
+ Utf8 "(C)Ljava/lang/StringBuilder;"; // #111
+ Utf8 "(D)Ljava/lang/StringBuilder;"; // #112
+ Utf8 "(F)Ljava/lang/StringBuilder;"; // #113
+ Utf8 "(J)Ljava/lang/StringBuilder;"; // #114
+ Utf8 "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"; // #115
+ } // Constant Pool
+
+ 0x0021; // access
+ #33;// this_cpx
+ #34;// super_cpx
+
+ [] { // Interfaces
+ } // Interfaces
+
+ [] { // fields
+ } // fields
+
+ [] { // methods
+ { // Member
+ 0x0001; // access
+ #35; // name_cpx
+ #36; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 1; // max_stack
+ 1; // max_locals
+ Bytes[]{
+ 0x2AB70001B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 26;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 5 40 41 0;
+ }
+ } // end LocalVariableTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ ;
+ { // Member
+ 0x0009; // access
+ #42; // name_cpx
+ #43; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 4; // max_stack
+ 12; // max_locals
+ Bytes[]{
+ 0x043C10423D10583E;
+ 0x1400023904120438;
+ 0x06102A3607140005;
+ 0x37081058360ABB00;
+ 0x0759B700083A0B19;
+ 0x0B1209B6000A57B2;
+ 0x000BBB000C59B700;
+ 0x0D120EB6000F1BB6;
+ 0x0010B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D1213B6000F1C;
+ 0xB60014B60011B600;
+ 0x12B2000BBB000C59;
+ 0xB7000D1215B6000F;
+ 0x1DB60016B60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D1217B600;
+ 0x0F1804B60018B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D1219;
+ 0xB6000F1706B6001A;
+ 0xB60011B60012B200;
+ 0x0BBB000C59B7000D;
+ 0x121BB6000F1507B6;
+ 0x0014B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D121CB6000F16;
+ 0x08B6001DB60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D121EB600;
+ 0x0F150AB60014B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D121F;
+ 0xB6000F190BB60020;
+ 0xB60011B60012B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 28;
+ 2 29;
+ 5 30;
+ 8 31;
+ 13 32;
+ 17 33;
+ 21 34;
+ 26 35;
+ 30 36;
+ 39 37;
+ 47 39;
+ 72 40;
+ 97 41;
+ 122 42;
+ 148 43;
+ 174 44;
+ 200 45;
+ 226 46;
+ 252 47;
+ 278 48;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 279 44 45 0;
+ 2 277 46 47 1;
+ 5 274 48 49 2;
+ 8 271 50 51 3;
+ 13 266 52 53 4;
+ 17 262 54 55 6;
+ 21 258 56 57 7;
+ 26 253 58 59 8;
+ 30 249 60 61 10;
+ 39 240 62 63 11;
+ }
+ } // end LocalVariableTable
+ ;
+ Attr(#64) { // LocalVariableTypeTable
+ [] { // LocalVariableTypeTable
+ 39 240 62 65 11;
+ 39 240 62 65 11;
+ }
+ } // end LocalVariableTypeTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ } // methods
+
+ [] { // Attributes
+ Attr(#66) { // SourceFile
+ #67;
+ } // end SourceFile
+ } // Attributes
+} // end class DuplicateLVTT
diff --git a/hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod b/hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod
new file mode 100644
index 00000000000..ebe0c33275f
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/NotFoundLVTT.cod
@@ -0,0 +1,292 @@
+/*
+ * 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 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 LVTT entry points to a non-existant LVT entry
+
+class NotFoundLVTT {
+ 0xCAFEBABE;
+ 0; // minor version
+ 52; // version
+ [] { // Constant Pool
+ ; // first element is empty
+ Method #34 #68; // #1
+ double 0x3FF199999999999A;; // #2
+ float 0x3F99999A; // #4
+ long 0xFFFFFFFFCAFEBABE;; // #5
+ class #69; // #7
+ Method #7 #68; // #8
+ String #70; // #9
+ Method #7 #71; // #10
+ Field #72 #73; // #11
+ class #74; // #12
+ Method #12 #68; // #13
+ String #75; // #14
+ Method #12 #76; // #15
+ Method #12 #77; // #16
+ Method #12 #78; // #17
+ Method #79 #80; // #18
+ String #81; // #19
+ Method #12 #82; // #20
+ String #83; // #21
+ Method #12 #84; // #22
+ String #85; // #23
+ Method #12 #86; // #24
+ String #87; // #25
+ Method #12 #88; // #26
+ String #89; // #27
+ String #90; // #28
+ Method #12 #91; // #29
+ String #92; // #30
+ String #93; // #31
+ Method #12 #94; // #32
+ class #95; // #33
+ class #96; // #34
+ Utf8 ""; // #35
+ Utf8 "()V"; // #36
+ Utf8 "Code"; // #37
+ Utf8 "LineNumberTable"; // #38
+ Utf8 "LocalVariableTable"; // #39
+ Utf8 "this"; // #40
+ Utf8 "LNotFoundLVTT;"; // #41
+ Utf8 "main"; // #42
+ Utf8 "([Ljava/lang/String;)V"; // #43
+ Utf8 "args"; // #44
+ Utf8 "[Ljava/lang/String;"; // #45
+ Utf8 "b"; // #46
+ Utf8 "Z"; // #47
+ Utf8 "by"; // #48
+ Utf8 "B"; // #49
+ Utf8 "c"; // #50
+ Utf8 "C"; // #51
+ Utf8 "d"; // #52
+ Utf8 "D"; // #53
+ Utf8 "f"; // #54
+ Utf8 "F"; // #55
+ Utf8 "i"; // #56
+ Utf8 "I"; // #57
+ Utf8 "l"; // #58
+ Utf8 "J"; // #59
+ Utf8 "s"; // #60
+ Utf8 "S"; // #61
+ Utf8 "list"; // #62
+ Utf8 "Ljava/util/ArrayList;"; // #63
+ Utf8 "LocalVariableTypeTable"; // #64
+ Utf8 "Ljava/util/ArrayList;"; // #65
+ Utf8 "SourceFile"; // #66
+ Utf8 "NotFoundLVTT.java"; // #67
+ NameAndType #35 #36; // #68
+ Utf8 "java/util/ArrayList"; // #69
+ Utf8 "me"; // #70
+ NameAndType #97 #98; // #71
+ class #99; // #72
+ NameAndType #100 #101; // #73
+ Utf8 "java/lang/StringBuilder"; // #74
+ Utf8 "b="; // #75
+ NameAndType #102 #103; // #76
+ NameAndType #102 #104; // #77
+ NameAndType #105 #106; // #78
+ class #107; // #79
+ NameAndType #108 #109; // #80
+ Utf8 "by="; // #81
+ NameAndType #102 #110; // #82
+ Utf8 "c="; // #83
+ NameAndType #102 #111; // #84
+ Utf8 "d="; // #85
+ NameAndType #102 #112; // #86
+ Utf8 "f="; // #87
+ NameAndType #102 #113; // #88
+ Utf8 "i="; // #89
+ Utf8 "l="; // #90
+ NameAndType #102 #114; // #91
+ Utf8 "s="; // #92
+ Utf8 "ArrayList="; // #93
+ NameAndType #102 #115; // #94
+ Utf8 "NotFoundLVTT"; // #95
+ Utf8 "java/lang/Object"; // #96
+ Utf8 "add"; // #97
+ Utf8 "(Ljava/lang/Object;)Z"; // #98
+ Utf8 "java/lang/System"; // #99
+ Utf8 "out"; // #100
+ Utf8 "Ljava/io/PrintStream;"; // #101
+ Utf8 "append"; // #102
+ Utf8 "(Ljava/lang/String;)Ljava/lang/StringBuilder;"; // #103
+ Utf8 "(Z)Ljava/lang/StringBuilder;"; // #104
+ Utf8 "toString"; // #105
+ Utf8 "()Ljava/lang/String;"; // #106
+ Utf8 "java/io/PrintStream"; // #107
+ Utf8 "println"; // #108
+ Utf8 "(Ljava/lang/String;)V"; // #109
+ Utf8 "(I)Ljava/lang/StringBuilder;"; // #110
+ Utf8 "(C)Ljava/lang/StringBuilder;"; // #111
+ Utf8 "(D)Ljava/lang/StringBuilder;"; // #112
+ Utf8 "(F)Ljava/lang/StringBuilder;"; // #113
+ Utf8 "(J)Ljava/lang/StringBuilder;"; // #114
+ Utf8 "(Ljava/lang/Object;)Ljava/lang/StringBuilder;"; // #115
+ } // Constant Pool
+
+ 0x0021; // access
+ #33;// this_cpx
+ #34;// super_cpx
+
+ [] { // Interfaces
+ } // Interfaces
+
+ [] { // fields
+ } // fields
+
+ [] { // methods
+ { // Member
+ 0x0001; // access
+ #35; // name_cpx
+ #36; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 1; // max_stack
+ 1; // max_locals
+ Bytes[]{
+ 0x2AB70001B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 26;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 5 40 41 0;
+ }
+ } // end LocalVariableTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ ;
+ { // Member
+ 0x0009; // access
+ #42; // name_cpx
+ #43; // sig_cpx
+ [] { // Attributes
+ Attr(#37) { // Code
+ 4; // max_stack
+ 12; // max_locals
+ Bytes[]{
+ 0x043C10423D10583E;
+ 0x1400023904120438;
+ 0x06102A3607140005;
+ 0x37081058360ABB00;
+ 0x0759B700083A0B19;
+ 0x0B1209B6000A57B2;
+ 0x000BBB000C59B700;
+ 0x0D120EB6000F1BB6;
+ 0x0010B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D1213B6000F1C;
+ 0xB60014B60011B600;
+ 0x12B2000BBB000C59;
+ 0xB7000D1215B6000F;
+ 0x1DB60016B60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D1217B600;
+ 0x0F1804B60018B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D1219;
+ 0xB6000F1706B6001A;
+ 0xB60011B60012B200;
+ 0x0BBB000C59B7000D;
+ 0x121BB6000F1507B6;
+ 0x0014B60011B60012;
+ 0xB2000BBB000C59B7;
+ 0x000D121CB6000F16;
+ 0x08B6001DB60011B6;
+ 0x0012B2000BBB000C;
+ 0x59B7000D121EB600;
+ 0x0F150AB60014B600;
+ 0x11B60012B2000BBB;
+ 0x000C59B7000D121F;
+ 0xB6000F190BB60020;
+ 0xB60011B60012B1;
+ };
+ [] { // Traps
+ } // end Traps
+ [] { // Attributes
+ Attr(#38) { // LineNumberTable
+ [] { // LineNumberTable
+ 0 28;
+ 2 29;
+ 5 30;
+ 8 31;
+ 13 32;
+ 17 33;
+ 21 34;
+ 26 35;
+ 30 36;
+ 39 37;
+ 47 39;
+ 72 40;
+ 97 41;
+ 122 42;
+ 148 43;
+ 174 44;
+ 200 45;
+ 226 46;
+ 252 47;
+ 278 48;
+ }
+ } // end LineNumberTable
+ ;
+ Attr(#39) { // LocalVariableTable
+ [] { // LocalVariableTable
+ 0 279 44 45 0;
+ 2 277 46 47 1;
+ 5 274 48 49 2;
+ 8 271 50 51 3;
+ 13 266 52 53 4;
+ 17 262 54 55 6;
+ 21 258 56 57 7;
+ 26 253 58 59 8;
+ 30 249 60 61 10;
+ 39 240 62 63 11;
+ }
+ } // end LocalVariableTable
+ ;
+ Attr(#64) { // LocalVariableTypeTable
+ [] { // LocalVariableTypeTable
+ 38 240 62 65 11;
+ }
+ } // end LocalVariableTypeTable
+ } // Attributes
+ } // end Code
+ } // Attributes
+ } // Member
+ } // methods
+
+ [] { // Attributes
+ Attr(#66) { // SourceFile
+ #67;
+ } // end SourceFile
+ } // Attributes
+} // end class NotFoundLVTT
diff --git a/hotspot/test/runtime/LocalVariableTable/TestLVT.java b/hotspot/test/runtime/LocalVariableTable/TestLVT.java
new file mode 100644
index 00000000000..337de2c8750
--- /dev/null
+++ b/hotspot/test/runtime/LocalVariableTable/TestLVT.java
@@ -0,0 +1,83 @@
+/*
+ * 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 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 8049632
+ * @summary Test ClassFileParser::copy_localvariable_table cases
+ * @library /testlibrary
+ * @compile -g -XDignore.symbol.file TestLVT.java
+ * @run main TestLVT
+ */
+
+import com.oracle.java.testlibrary.*;
+import java.util.*;
+
+public class TestLVT {
+ public static void main(String[] args) throws Exception {
+ test(); // Test good LVT in this test
+
+ String jarFile = System.getProperty("test.src") + "/testcase.jar";
+
+ // java -cp $testSrc/testcase.jar DuplicateLVT
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "DuplicateLVT");
+ new OutputAnalyzer(pb.start())
+ .shouldContain("Duplicated LocalVariableTable attribute entry for 'by' in class file DuplicateLVT")
+ .shouldHaveExitValue(1);
+
+ // java -cp $testclasses/testcase.jar DuplicateLVTT
+ pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "DuplicateLVTT");
+ new OutputAnalyzer(pb.start())
+ .shouldContain("Duplicated LocalVariableTypeTable attribute entry for 'list' in class file DuplicateLVTT")
+ .shouldHaveExitValue(1);
+
+ // java -cp $testclasses/testcase.jar NotFoundLVTT
+ pb = ProcessTools.createJavaProcessBuilder("-cp", jarFile, "NotFoundLVTT");
+ new OutputAnalyzer(pb.start())
+ .shouldContain("LVTT entry for 'list' in class file NotFoundLVTT does not match any LVT entry")
+ .shouldHaveExitValue(1);
+ }
+
+ public static void test() {
+ boolean b = true;
+ byte by = 0x42;
+ char c = 'X';
+ double d = 1.1;
+ float f = (float) 1.2;
+ int i = 42;
+ long l = 0xCAFEBABE;
+ short s = 88;
+ ArrayList list = new ArrayList();
+ list.add("me");
+
+ System.out.println("b=" + b);
+ System.out.println("by=" + by);
+ System.out.println("c=" + c);
+ System.out.println("d=" + d);
+ System.out.println("f=" + f);
+ System.out.println("i=" + i);
+ System.out.println("l=" + l);
+ System.out.println("s=" + s);
+ System.out.println("ArrayList=" + list);
+ }
+}
diff --git a/hotspot/test/runtime/LocalVariableTable/testcase.jar b/hotspot/test/runtime/LocalVariableTable/testcase.jar
new file mode 100644
index 00000000000..cec87c8596b
Binary files /dev/null and b/hotspot/test/runtime/LocalVariableTable/testcase.jar differ
diff --git a/hotspot/test/runtime/Unsafe/AllocateMemory.java b/hotspot/test/runtime/Unsafe/AllocateMemory.java
index 0c2b28f3911..9f4cf530bd6 100644
--- a/hotspot/test/runtime/Unsafe/AllocateMemory.java
+++ b/hotspot/test/runtime/Unsafe/AllocateMemory.java
@@ -25,7 +25,7 @@
* @test
* @summary Verifies behaviour of Unsafe.allocateMemory
* @library /testlibrary
- * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=20m AllocateMemory
+ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:MallocMaxTestWords=100m AllocateMemory
*/
import com.oracle.java.testlibrary.*;
@@ -56,7 +56,7 @@ public class AllocateMemory {
// allocateMemory() should throw an OutOfMemoryError when the underlying malloc fails,
// we test this by limiting the malloc using -XX:MallocMaxTestWords
try {
- address = unsafe.allocateMemory(20 * 1024 * 1024 * 8);
+ address = unsafe.allocateMemory(100 * 1024 * 1024 * 8);
} catch (OutOfMemoryError e) {
// Expected
return;
diff --git a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
index 69dff6d9888..51798e6afe0 100644
--- a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
+++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
@@ -26,6 +26,7 @@
* @bug 7162400
* @key regression
* @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
+ * @ignore 8024055
* @library /testlibrary
* @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget
* @run main AttachWithStalePidFile
diff --git a/hotspot/test/serviceability/dcmd/DcmdUtil.java b/hotspot/test/serviceability/dcmd/DcmdUtil.java
deleted file mode 100644
index 39ddb06b274..00000000000
--- a/hotspot/test/serviceability/dcmd/DcmdUtil.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-import sun.management.ManagementFactoryHelper;
-
-import com.sun.management.DiagnosticCommandMBean;
-
-public class DcmdUtil
-{
- public static String executeDcmd(String cmd, String ... args) {
- DiagnosticCommandMBean dcmd = ManagementFactoryHelper.getDiagnosticCommandMBean();
- Object[] dcmdArgs = {args};
- String[] signature = {String[].class.getName()};
-
- try {
- System.out.print("> " + cmd + " ");
- for (String s : args) {
- System.out.print(s + " ");
- }
- System.out.println(":");
- String result = (String) dcmd.invoke(transform(cmd), dcmdArgs, signature);
- System.out.println(result);
- return result;
- } catch(Exception ex) {
- ex.printStackTrace();
- }
- return null;
- }
-
- private static String transform(String name) {
- StringBuilder sb = new StringBuilder();
- boolean toLower = true;
- boolean toUpper = false;
- for (int i = 0; i < name.length(); i++) {
- char c = name.charAt(i);
- if (c == '.' || c == '_') {
- toLower = false;
- toUpper = true;
- } else {
- if (toUpper) {
- toUpper = false;
- sb.append(Character.toUpperCase(c));
- } else if(toLower) {
- sb.append(Character.toLowerCase(c));
- } else {
- sb.append(c);
- }
- }
- }
- return sb.toString();
- }
-
-}
diff --git a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
index 06f7101a35a..f7b4dd6b923 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CodeCacheTest.java
@@ -24,17 +24,23 @@
/*
* @test CodeCacheTest
* @bug 8054889
- * @library ..
- * @build DcmdUtil CodeCacheTest
- * @run main/othervm -XX:+SegmentedCodeCache CodeCacheTest
- * @run main/othervm -XX:-SegmentedCodeCache CodeCacheTest
- * @run main/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+SegmentedCodeCache CodeCacheTest
+ * @run testng/othervm -XX:-SegmentedCodeCache CodeCacheTest
+ * @run testng/othervm -Xint -XX:+SegmentedCodeCache CodeCacheTest
* @summary Test of diagnostic command Compiler.codecache
*/
-import java.io.BufferedReader;
-import java.io.StringReader;
-import java.lang.reflect.Method;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -72,7 +78,7 @@ public class CodeCacheTest {
private static boolean getFlagBool(String flag, String where) {
Matcher m = Pattern.compile(flag + "\\s+:?= (true|false)").matcher(where);
if (!m.find()) {
- throw new RuntimeException("Could not find value for flag " + flag + " in output string");
+ Assert.fail("Could not find value for flag " + flag + " in output string");
}
return m.group(1).equals("true");
}
@@ -80,16 +86,16 @@ public class CodeCacheTest {
private static int getFlagInt(String flag, String where) {
Matcher m = Pattern.compile(flag + "\\s+:?=\\s+\\d+").matcher(where);
if (!m.find()) {
- throw new RuntimeException("Could not find value for flag " + flag + " in output string");
+ Assert.fail("Could not find value for flag " + flag + " in output string");
}
String match = m.group();
return Integer.parseInt(match.substring(match.lastIndexOf(" ") + 1, match.length()));
}
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) {
// Get number of code cache segments
int segmentsCount = 0;
- String flags = DcmdUtil.executeDcmd("VM.flags", "-all");
+ String flags = executor.execute("VM.flags -all").getOutput();
if (!getFlagBool("SegmentedCodeCache", flags) || !getFlagBool("UseCompiler", flags)) {
// No segmentation
segmentsCount = 1;
@@ -102,29 +108,29 @@ public class CodeCacheTest {
}
// Get output from dcmd (diagnostic command)
- String result = DcmdUtil.executeDcmd("Compiler.codecache");
- BufferedReader r = new BufferedReader(new StringReader(result));
+ OutputAnalyzer output = executor.execute("Compiler.codecache");
+ Iterator lines = output.asLines().iterator();
// Validate code cache segments
String line;
Matcher m;
for (int s = 0; s < segmentsCount; ++s) {
// Validate first line
- line = r.readLine();
+ line = lines.next();
m = line1.matcher(line);
if (m.matches()) {
for (int i = 2; i <= 5; i++) {
int val = Integer.parseInt(m.group(i));
if (val < 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
}
} else {
- throw new Exception("Regexp 1 failed");
+ Assert.fail("Regexp 1 failed to match line: " + line);
}
// Validate second line
- line = r.readLine();
+ line = lines.next();
m = line2.matcher(line);
if (m.matches()) {
String start = m.group(1);
@@ -133,44 +139,49 @@ public class CodeCacheTest {
// Lexical compare of hex numbers to check that they look sane.
if (start.compareTo(mark) > 1) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
if (mark.compareTo(top) > 1) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
} else {
- throw new Exception("Regexp 2 failed line: " + line);
+ Assert.fail("Regexp 2 failed to match line: " + line);
}
}
// Validate third line
- line = r.readLine();
+ line = lines.next();
m = line3.matcher(line);
if (m.matches()) {
int blobs = Integer.parseInt(m.group(1));
if (blobs <= 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
int nmethods = Integer.parseInt(m.group(2));
if (nmethods < 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
int adapters = Integer.parseInt(m.group(3));
if (adapters <= 0) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
if (blobs < (nmethods + adapters)) {
- throw new Exception("Failed parsing dcmd codecache output");
+ Assert.fail("Failed parsing dcmd codecache output");
}
} else {
- throw new Exception("Regexp 3 failed");
+ Assert.fail("Regexp 3 failed to match line: " + line);
}
// Validate fourth line
- line = r.readLine();
+ line = lines.next();
m = line4.matcher(line);
if (!m.matches()) {
- throw new Exception("Regexp 4 failed");
+ Assert.fail("Regexp 4 failed to match line: " + line);
}
}
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
}
diff --git a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
index 6dcb3458de8..57f5521094f 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java
@@ -24,14 +24,21 @@
/*
* @test CodelistTest
* @bug 8054889
- * @library ..
- * @build DcmdUtil MethodIdentifierParser CodelistTest
- * @run main CodelistTest
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build MethodIdentifierParser
+ * @run testng CodelistTest
* @summary Test of diagnostic command Compiler.codelist
*/
-import java.io.BufferedReader;
-import java.io.StringReader;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
import java.lang.reflect.Method;
public class CodelistTest {
@@ -51,19 +58,17 @@ public class CodelistTest {
*
*/
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) {
int ok = 0;
int fail = 0;
// Get output from dcmd (diagnostic command)
- String result = DcmdUtil.executeDcmd("Compiler.codelist");
- BufferedReader r = new BufferedReader(new StringReader(result));
+ OutputAnalyzer output = executor.execute("Compiler.codelist");
// Grab a method name from the output
- String line;
int count = 0;
- while((line = r.readLine()) != null) {
+ for (String line : output.asLines()) {
count++;
String[] parts = line.split(" ");
@@ -83,14 +88,16 @@ public class CodelistTest {
}
MethodIdentifierParser mf = new MethodIdentifierParser(methodPrintedInLogFormat);
- Method m;
+ Method m = null;
try {
m = mf.getMethod();
} catch (NoSuchMethodException e) {
m = null;
+ } catch (ClassNotFoundException e) {
+ Assert.fail("Test error: Caught unexpected exception", e);
}
if (m == null) {
- throw new Exception("Test failed on: " + methodPrintedInLogFormat);
+ Assert.fail("Test failed on: " + methodPrintedInLogFormat);
}
if (count > 10) {
// Testing 10 entries is enough. Lets not waste time.
@@ -98,4 +105,9 @@ public class CodelistTest {
}
}
}
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
}
diff --git a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
index 3bd7cf3ede1..0b15dceb1c3 100644
--- a/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
+++ b/hotspot/test/serviceability/dcmd/compiler/CompilerQueueTest.java
@@ -24,17 +24,22 @@
/*
* @test CompilerQueueTest
* @bug 8054889
- * @library ..
+ * @library /testlibrary
* @ignore 8069160
- * @build DcmdUtil CompilerQueueTest
- * @run main CompilerQueueTest
- * @run main/othervm -XX:-TieredCompilation CompilerQueueTest
- * @run main/othervm -Xint CompilerQueueTest
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng CompilerQueueTest
+ * @run testng/othervm -XX:-TieredCompilation CompilerQueueTest
+ * @run testng/othervm -Xint CompilerQueueTest
* @summary Test of diagnostic command Compiler.queue
*/
-import java.io.BufferedReader;
-import java.io.StringReader;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+import java.util.Iterator;
public class CompilerQueueTest {
@@ -60,52 +65,55 @@ public class CompilerQueueTest {
*
**/
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) {
// Get output from dcmd (diagnostic command)
- String result = DcmdUtil.executeDcmd("Compiler.queue");
- BufferedReader r = new BufferedReader(new StringReader(result));
+ OutputAnalyzer output = executor.execute("Compiler.queue");
+ Iterator lines = output.asLines().iterator();
- String str = r.readLine();
-
- while (str != null) {
+ while (lines.hasNext()) {
+ String str = lines.next();
if (str.startsWith("Contents of C")) {
- match(r.readLine(), "----------------------------");
- str = r.readLine();
+ match(lines.next(), "----------------------------");
+ str = lines.next();
if (!str.equals("Empty")) {
while (str.charAt(0) != '-') {
validateMethodLine(str);
- str = r.readLine();
+ str = lines.next();
}
} else {
- str = r.readLine();
+ str = lines.next();
}
match(str,"----------------------------");
- str = r.readLine();
} else {
- throw new Exception("Failed parsing dcmd queue, line: " + str);
+ Assert.fail("Failed parsing dcmd queue, line: " + str);
}
}
}
- private static void validateMethodLine(String str) throws Exception {
+ private static void validateMethodLine(String str) {
// Skip until package/class name begins. Trim to remove whitespace that
// may differ.
String name = str.substring(14).trim();
int sep = name.indexOf("::");
if (sep == -1) {
- throw new Exception("Failed dcmd queue, didn't find separator :: in: " + name);
+ Assert.fail("Failed dcmd queue, didn't find separator :: in: " + name);
}
try {
Class.forName(name.substring(0, sep));
} catch (ClassNotFoundException e) {
- throw new Exception("Failed dcmd queue, Class for name: " + str);
+ Assert.fail("Failed dcmd queue, Class for name: " + str);
}
}
- public static void match(String line, String str) throws Exception {
+ public static void match(String line, String str) {
if (!line.equals(str)) {
- throw new Exception("String equals: " + line + ", " + str);
+ Assert.fail("String equals: " + line + ", " + str);
}
}
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
}
diff --git a/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java b/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java
index f00c0dd9863..b6ef4d370c9 100644
--- a/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java
+++ b/hotspot/test/serviceability/dcmd/compiler/MethodIdentifierParser.java
@@ -51,11 +51,11 @@ public class MethodIdentifierParser {
// Add sanity check for extracted fields
}
- public Method getMethod() throws NoSuchMethodException, SecurityException, ClassNotFoundException, Exception {
+ public Method getMethod() throws NoSuchMethodException, SecurityException, ClassNotFoundException {
try {
return Class.forName(className).getDeclaredMethod(methodName, getParamenterDescriptorArray());
} catch (UnexpectedTokenException e) {
- throw new Exception("Parse failed");
+ throw new RuntimeException("Parse failed");
}
}
diff --git a/hotspot/test/serviceability/dcmd/framework/HelpTest.java b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
new file mode 100644
index 00000000000..fd0a57d607a
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/framework/HelpTest.java
@@ -0,0 +1,69 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of diagnostic command help (tests all DCMD executors)
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+UsePerfData HelpTest
+ */
+public class HelpTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("help");
+
+ output.shouldContain("The following commands are available");
+ output.shouldContain("help");
+ output.shouldContain("VM.version");
+ }
+
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+
+ @Test
+ public void mainClass() {
+ run(new MainClassJcmdExecutor());
+ }
+
+ @Test
+ public void file() {
+ run(new FileJcmdExecutor());
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+
+}
diff --git a/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
new file mode 100644
index 00000000000..b584308ed1a
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/framework/InvalidCommandTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of invalid diagnostic command (tests all DCMD executors)
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+UsePerfData InvalidCommandTest
+ */
+public class InvalidCommandTest {
+
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("asdf");
+ output.shouldContain("Unknown diagnostic command");
+ }
+
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+
+ @Test
+ public void mainClass() {
+ run(new MainClassJcmdExecutor());
+ }
+
+ @Test
+ public void file() {
+ run(new FileJcmdExecutor());
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
new file mode 100644
index 00000000000..c46faae3287
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/framework/VMVersionTest.java
@@ -0,0 +1,66 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.MainClassJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.FileJcmdExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.version (tests all DCMD executors)
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+UsePerfData VMVersionTest
+ */
+public class VMVersionTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.version");
+ output.shouldMatch(".*(?:HotSpot|OpenJDK).*VM.*");
+ }
+
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+
+ @Test
+ public void mainClass() {
+ run(new MainClassJcmdExecutor());
+ }
+
+ @Test
+ public void file() {
+ run(new FileJcmdExecutor());
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
new file mode 100644
index 00000000000..f205dec936a
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramAllTest.java
@@ -0,0 +1,40 @@
+/*
+ * 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 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
+ * @summary Test of diagnostic command GC.class_histogram -all=true
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build ClassHistogramTest
+ * @run testng ClassHistogramAllTest
+ */
+public class ClassHistogramAllTest extends ClassHistogramTest {
+ public ClassHistogramAllTest() {
+ super();
+ classHistogramArgs = "-all=true";
+ }
+
+ /* See ClassHistogramTest for test cases */
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
new file mode 100644
index 00000000000..a4f618acbd1
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/ClassHistogramTest.java
@@ -0,0 +1,89 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+
+import java.util.regex.Pattern;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.class_histogram
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng ClassHistogramTest
+ */
+public class ClassHistogramTest {
+ public static class TestClass {}
+ public static TestClass[] instances = new TestClass[1024];
+ protected String classHistogramArgs = "";
+
+ static {
+ for (int i = 0; i < instances.length; ++i) {
+ instances[i] = new TestClass();
+ }
+ }
+
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("GC.class_histogram " + classHistogramArgs);
+
+ /*
+ * example output:
+ * num #instances #bytes class name
+ * ----------------------------------------------
+ * 1: 1647 1133752 [B
+ * 2: 6198 383168 [C
+ * 3: 1464 165744 java.lang.Class
+ * 4: 6151 147624 java.lang.String
+ * 5: 2304 73728 java.util.concurrent.ConcurrentHashMap$Node
+ * 6: 1199 64280 [Ljava.lang.Object;
+ * ...
+ */
+
+ /* Require at least one java.lang.Class */
+ output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Class\\s*$");
+
+ /* Require at least one java.lang.String */
+ output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.String\\s*$");
+
+ /* Require at least one java.lang.Object */
+ output.shouldMatch("^\\s+\\d+:\\s+\\d+\\s+\\d+\\s+java.lang.Object\\s*$");
+
+ /* Require at exactly one TestClass[] */
+ output.shouldMatch("^\\s+\\d+:\\s+1\\s+\\d+\\s+" +
+ Pattern.quote(TestClass[].class.getName()) + "\\s*$");
+
+ /* Require at exactly 1024 TestClass */
+ output.shouldMatch("^\\s+\\d+:\\s+1024\\s+\\d+\\s+" +
+ Pattern.quote(TestClass.class.getName()) + "\\s*$");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
new file mode 100644
index 00000000000..4894200205f
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpAllTest.java
@@ -0,0 +1,41 @@
+/*
+ * 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 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
+ * @summary Test of diagnostic command GC.heap_dump -all=true
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build HeapDumpTest
+ * @run testng HeapDumpAllTest
+ */
+public class HeapDumpAllTest extends HeapDumpTest {
+ public HeapDumpAllTest() {
+ super();
+ heapDumpArgs = "-all=true";
+ }
+
+ /* See HeapDumpTest for test cases */
+}
+
diff --git a/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
new file mode 100644
index 00000000000..132f9a2e86d
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/HeapDumpTest.java
@@ -0,0 +1,90 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+import org.testng.Assert;
+
+import java.io.IOException;
+
+import com.oracle.java.testlibrary.JDKToolFinder;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.PidJcmdExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.heap_dump
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng HeapDumpTest
+ */
+public class HeapDumpTest {
+ protected String heapDumpArgs = "";
+
+ public void run(CommandExecutor executor) {
+ String fileName = "jcmd.gc.heap_dump." + System.currentTimeMillis() + ".hprof";
+ String cmd = "GC.heap_dump " + heapDumpArgs + " " + fileName;
+ executor.execute(cmd);
+
+ verifyHeapDump(fileName);
+ }
+
+ private void verifyHeapDump(String fileName) {
+ String jhat = JDKToolFinder.getJDKTool("jhat");
+ String[] cmd = { jhat, "-parseonly", "true", fileName };
+
+ ProcessBuilder pb = new ProcessBuilder(cmd);
+ pb.redirectErrorStream(true);
+ Process p = null;
+ OutputAnalyzer output = null;
+
+ try {
+ p = pb.start();
+ output = new OutputAnalyzer(p);
+
+ /*
+ * Some hprof dumps of all objects contain constantPoolOop references that cannot be resolved, so we ignore
+ * failures about resolving constantPoolOop fields using a negative lookahead
+ */
+ output.shouldNotMatch(".*WARNING(?!.*Failed to resolve object.*constantPoolOop.*).*");
+ } catch (IOException e) {
+ Assert.fail("Test error: Caught exception while reading stdout/err of jhat", e);
+ } finally {
+ if (p != null) {
+ p.destroy();
+ }
+ }
+
+ if (output.getExitValue() != 0) {
+ Assert.fail("Test error: jhat exit code was nonzero");
+ }
+ }
+
+ /* GC.heap_dump is not available over JMX, running jcmd pid executor instead */
+ @Test
+ public void pid() {
+ run(new PidJcmdExecutor());
+ }
+}
+
diff --git a/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
new file mode 100644
index 00000000000..6e8f4668302
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/RunFinalizationTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+import org.testng.Assert;
+
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.run_finalization
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng RunFinalizationTest
+ */
+public class RunFinalizationTest {
+ static ReentrantLock lock = new ReentrantLock();
+ static Condition cond = lock.newCondition();
+ static volatile boolean wasFinalized = false;
+ static volatile boolean wasInitialized = false;
+
+ class MyObject {
+ public MyObject() {
+ /* Make sure object allocation/deallocation is not optimized out */
+ wasInitialized = true;
+ }
+
+ protected void finalize() {
+ lock.lock();
+ wasFinalized = true;
+ cond.signalAll();
+ lock.unlock();
+ }
+ }
+
+ public static MyObject o;
+
+ public void run(CommandExecutor executor) {
+ lock.lock();
+ o = new MyObject();
+ o = null;
+ System.gc();
+ executor.execute("GC.run_finalization");
+
+ int waited = 0;
+ int waitTime = 15;
+
+ try {
+ System.out.println("Waiting for signal from finalizer");
+
+ while (!cond.await(waitTime, TimeUnit.SECONDS)) {
+ waited += waitTime;
+ System.out.println(String.format("Waited %d seconds", waited));
+ }
+
+ System.out.println("Received signal");
+ } catch (InterruptedException e) {
+ Assert.fail("Test error: Interrupted while waiting for signal from finalizer", e);
+ } finally {
+ lock.unlock();
+ }
+
+ if (!wasFinalized) {
+ Assert.fail("Test failure: Object was not finalized");
+ }
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
new file mode 100644
index 00000000000..eb90bc0ee8f
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java
@@ -0,0 +1,65 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+import org.testng.Assert;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command GC.run
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog RunGCTest
+ */
+public class RunGCTest {
+ public void run(CommandExecutor executor) {
+ executor.execute("GC.run");
+
+ Path gcLogPath = Paths.get("RunGC.gclog").toAbsolutePath();
+ String gcLog = null;
+
+ try {
+ gcLog = new String(Files.readAllBytes(gcLogPath));
+ } catch (IOException e) {
+ Assert.fail("Test error: Could not read GC log file: " + gcLogPath, e);
+ }
+
+ OutputAnalyzer output = new OutputAnalyzer(gcLog, "");
+ output.shouldMatch(".*\\[Full GC \\(System(\\.gc\\(\\))?.*");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
new file mode 100644
index 00000000000..8d9b8d861f3
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/thread/PrintConcurrentLocksTest.java
@@ -0,0 +1,39 @@
+/*
+ * 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 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
+ * @summary Test of diagnostic command Thread.print -l=true
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @build PrintTest
+ * @run testng PrintConcurrentLocksTest
+ */
+public class PrintConcurrentLocksTest extends PrintTest {
+ public PrintConcurrentLocksTest() {
+ jucLocks = true;
+ }
+
+ /* See PrintTest for test cases */
+}
diff --git a/hotspot/test/serviceability/dcmd/thread/PrintTest.java b/hotspot/test/serviceability/dcmd/thread/PrintTest.java
new file mode 100644
index 00000000000..faf1a71d73f
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/thread/PrintTest.java
@@ -0,0 +1,174 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.util.concurrent.BrokenBarrierException;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.regex.Pattern;
+
+/*
+ * @test
+ * @summary Test of diagnostic command Thread.print
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng PrintTest
+ */
+public class PrintTest {
+ protected boolean jucLocks = false;
+
+ CyclicBarrier readyBarrier = new CyclicBarrier(3);
+ CyclicBarrier doneBarrier = new CyclicBarrier(3);
+
+ private void waitForBarrier(CyclicBarrier b) {
+ try {
+ b.await();
+ } catch (InterruptedException | BrokenBarrierException e) {
+ Assert.fail("Test error: Caught unexpected exception:", e);
+ }
+ }
+
+ class MonitorThread extends Thread {
+ Object lock = new Object();
+
+ public void run() {
+ /* Hold lock on "lock" to show up in thread dump */
+ synchronized (lock) {
+ /* Signal that we're ready for thread dump */
+ waitForBarrier(readyBarrier);
+
+ /* Released when the thread dump has been taken */
+ waitForBarrier(doneBarrier);
+ }
+ }
+ }
+
+ class LockThread extends Thread {
+ ReentrantLock lock = new ReentrantLock();
+
+ public void run() {
+ /* Hold lock "lock" to show up in thread dump */
+ lock.lock();
+
+ /* Signal that we're ready for thread dump */
+ waitForBarrier(readyBarrier);
+
+ /* Released when the thread dump has been taken */
+ waitForBarrier(doneBarrier);
+
+ lock.unlock();
+ }
+ }
+
+ public void run(CommandExecutor executor) {
+ MonitorThread mThread = new MonitorThread();
+ mThread.start();
+ LockThread lThread = new LockThread();
+ lThread.start();
+
+ /* Wait for threads to get ready */
+ waitForBarrier(readyBarrier);
+
+ /* Execute */
+ OutputAnalyzer output = executor.execute("Thread.print" + (jucLocks ? " -l=true" : ""));
+
+ /* Signal that we've got the thread dump */
+ waitForBarrier(doneBarrier);
+
+ /*
+ * Example output (trimmed) with arrows indicating the rows we are looking for:
+ *
+ * ...
+ * "Thread-2" #24 prio=5 os_prio=0 tid=0x00007f913411f800 nid=0x4fc9 waiting on condition [0x00007f91fbffe000]
+ * java.lang.Thread.State: WAITING (parking)
+ * at sun.misc.Unsafe.park(Native Method)
+ * - parking to wait for <0x000000071a0868a8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
+ * at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
+ * at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
+ * at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:234)
+ * at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:362)
+ * at Print.waitForBarrier(Print.java:26)
+ * at Print.access$000(Print.java:18)
+ * at Print$LockThread.run(Print.java:58)
+ *
+ * --> Locked ownable synchronizers:
+ * --> - <0x000000071a294930> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
+ *
+ * "Thread-1" #23 prio=5 os_prio=0 tid=0x00007f913411e800 nid=0x4fc8 waiting on condition [0x00007f9200113000]
+ * java.lang.Thread.State: WAITING (parking)
+ * at sun.misc.Unsafe.park(Native Method)
+ * - parking to wait for <0x000000071a0868a8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
+ * at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
+ * at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
+ * at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:234)
+ * at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:362)
+ * at Print.waitForBarrier(Print.java:26)
+ * at Print.access$000(Print.java:18)
+ * at Print$MonitorThread.run(Print.java:42)
+ * --> - locked <0x000000071a294390> (a java.lang.Object)
+ *
+ * Locked ownable synchronizers:
+ * - None
+ *
+ * "MainThread" #22 prio=5 os_prio=0 tid=0x00007f923015b000 nid=0x4fc7 in Object.wait() [0x00007f9200840000]
+ * java.lang.Thread.State: WAITING (on object monitor)
+ * at java.lang.Object.wait(Native Method)
+ * - waiting on <0x000000071a70ad98> (a java.lang.UNIXProcess)
+ * at java.lang.Object.wait(Object.java:502)
+ * at java.lang.UNIXProcess.waitFor(UNIXProcess.java:397)
+ * - locked <0x000000071a70ad98> (a java.lang.UNIXProcess)
+ * at com.oracle.java.testlibrary.dcmd.JcmdExecutor.executeImpl(JcmdExecutor.java:32)
+ * at com.oracle.java.testlibrary.dcmd.CommandExecutor.execute(CommandExecutor.java:24)
+ * --> at Print.run(Print.java:74)
+ * at Print.file(Print.java:112)
+ * ...
+
+ */
+ output.shouldMatch(".*at " + Pattern.quote(PrintTest.class.getName()) + "\\.run.*");
+ output.shouldMatch(".*- locked <0x\\p{XDigit}+> \\(a " + Pattern.quote(mThread.lock.getClass().getName()) + "\\).*");
+
+ String jucLockPattern1 = ".*Locked ownable synchronizers:.*";
+ String jucLockPattern2 = ".*- <0x\\p{XDigit}+> \\(a " + Pattern.quote(lThread.lock.getClass().getName()) + ".*";
+
+ if (jucLocks) {
+ output.shouldMatch(jucLockPattern1);
+ output.shouldMatch(jucLockPattern2);
+ } else {
+ output.shouldNotMatch(jucLockPattern1);
+ output.shouldNotMatch(jucLockPattern2);
+ }
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/ClassLoaderStatsTest.java b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
similarity index 79%
rename from hotspot/test/serviceability/dcmd/ClassLoaderStatsTest.java
rename to hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
index 0b229a8a9a1..50c4f6cf5f1 100644
--- a/hotspot/test/serviceability/dcmd/ClassLoaderStatsTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/ClassLoaderStatsTest.java
@@ -23,18 +23,26 @@
/*
* @test
- *
- * @build ClassLoaderStatsTest DcmdUtil
- * @run main ClassLoaderStatsTest
+ * @summary Test of diagnostic command VM.classloader_stats
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng ClassLoaderStatsTest
*/
-import java.io.BufferedReader;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
-import java.io.StringReader;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
+import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -57,36 +65,36 @@ public class ClassLoaderStatsTest {
public static DummyClassLoader dummyloader;
- public static void main(String arg[]) throws Exception {
+ public void run(CommandExecutor executor) throws ClassNotFoundException {
// create a classloader and load our special class
dummyloader = new DummyClassLoader();
Class> c = Class.forName("TestClass", true, dummyloader);
if (c.getClassLoader() != dummyloader) {
- throw new RuntimeException("TestClass defined by wrong classloader: " + c.getClassLoader());
+ Assert.fail("TestClass defined by wrong classloader: " + c.getClassLoader());
}
- String result = DcmdUtil.executeDcmd("VM.classloader_stats");
- BufferedReader r = new BufferedReader(new StringReader(result));
- String line;
- while((line = r.readLine()) != null) {
+ OutputAnalyzer output = executor.execute("VM.classloader_stats");
+ Iterator lines = output.asLines().iterator();
+ while (lines.hasNext()) {
+ String line = lines.next();
Matcher m = clLine.matcher(line);
if (m.matches()) {
// verify that DummyClassLoader has loaded 1 class and 1 anonymous class
if (m.group(4).equals("ClassLoaderStatsTest$DummyClassLoader")) {
System.out.println("line: " + line);
if (!m.group(1).equals("1")) {
- throw new Exception("Should have loaded 1 class: " + line);
+ Assert.fail("Should have loaded 1 class: " + line);
}
checkPositiveInt(m.group(2));
checkPositiveInt(m.group(3));
- String next = r.readLine();
+ String next = lines.next();
System.out.println("next: " + next);
Matcher m1 = anonLine.matcher(next);
m1.matches();
if (!m1.group(1).equals("1")) {
- throw new Exception("Should have loaded 1 anonymous class, but found : " + m1.group(1));
+ Assert.fail("Should have loaded 1 anonymous class, but found : " + m1.group(1));
}
checkPositiveInt(m1.group(2));
checkPositiveInt(m1.group(3));
@@ -95,9 +103,9 @@ public class ClassLoaderStatsTest {
}
}
- private static void checkPositiveInt(String s) throws Exception {
+ private static void checkPositiveInt(String s) {
if (Integer.parseInt(s) <= 0) {
- throw new Exception("Value should have been > 0: " + s);
+ Assert.fail("Value should have been > 0: " + s);
}
}
@@ -114,8 +122,11 @@ public class ClassLoaderStatsTest {
{
return fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
} catch (IOException e) {
- throw new RuntimeException("Can't open file: " + name, e);
+ Assert.fail("Can't open file: " + name, e);
}
+
+ /* Will not reach here as Assert.fail() throws exception */
+ return null;
}
protected Class> loadClass(String name, boolean resolve)
@@ -144,6 +155,10 @@ public class ClassLoaderStatsTest {
}
} /* DummyClassLoader */
+ @Test
+ public void jmx() throws ClassNotFoundException {
+ run(new JMXExecutor());
+ }
}
class TestClass {
diff --git a/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
new file mode 100644
index 00000000000..cf22153f640
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/CommandLineTest.java
@@ -0,0 +1,49 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import org.testng.annotations.Test;
+
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.command_line
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis CommandLineTest
+ */
+public class CommandLineTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.command_line");
+ output.shouldContain("-XX:+IgnoreUnrecognizedVMOptions");
+ output.shouldContain("-XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
similarity index 67%
rename from hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
rename to hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
index 2f6b08ddd94..3f8c8ddfca7 100644
--- a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
+++ b/hotspot/test/serviceability/dcmd/vm/DynLibsTest.java
@@ -1,6 +1,10 @@
-import java.util.HashSet;
-import java.util.Set;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
import com.oracle.java.testlibrary.Platform;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
@@ -29,14 +33,15 @@ import com.oracle.java.testlibrary.Platform;
* @test
* @summary Test of VM.dynlib diagnostic command via MBean
* @library /testlibrary
- * @build com.oracle.java.testlibrary.* DcmdUtil
- * @run main DynLibDcmdTest
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng DynLibsTest
*/
-public class DynLibDcmdTest {
+public class DynLibsTest {
- public static void main(String[] args) throws Exception {
- String result = DcmdUtil.executeDcmd("VM.dynlibs");
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.dynlibs");
String osDependentBaseString = null;
if (Platform.isAix()) {
@@ -52,18 +57,16 @@ public class DynLibDcmdTest {
}
if (osDependentBaseString == null) {
- throw new Exception("Unsupported OS");
+ Assert.fail("Unsupported OS");
}
- Set expectedContent = new HashSet<>();
- expectedContent.add(String.format(osDependentBaseString, "jvm"));
- expectedContent.add(String.format(osDependentBaseString, "java"));
- expectedContent.add(String.format(osDependentBaseString, "management"));
+ output.shouldContain(String.format(osDependentBaseString, "jvm"));
+ output.shouldContain(String.format(osDependentBaseString, "java"));
+ output.shouldContain(String.format(osDependentBaseString, "management"));
+ }
- for(String expected : expectedContent) {
- if (!result.contains(expected)) {
- throw new Exception("Dynamic library list output did not contain the expected string: '" + expected + "'");
- }
- }
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
}
}
diff --git a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
new file mode 100644
index 00000000000..960104e4415
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java
@@ -0,0 +1,56 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+import org.testng.annotations.Test;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.flags
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng/othervm -Xmx129m -XX:+PrintGC -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest
+ */
+public class FlagsTest {
+ public void run(CommandExecutor executor) {
+ OutputAnalyzer output = executor.execute("VM.flags");
+
+ /* The following are interpreted by the JVM as actual "flags" */
+ output.shouldContain("-XX:+PrintGC");
+ output.shouldContain("-XX:+UnlockDiagnosticVMOptions");
+ output.shouldContain("-XX:+IgnoreUnrecognizedVMOptions");
+ output.shouldContain("-XX:-TieredCompilation");
+
+ /* The following are not */
+ output.shouldNotContain("-Xmx129m");
+ output.shouldNotContain("-XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right");
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
new file mode 100644
index 00000000000..8b21ae9f28c
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/SystemPropertiesTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.system_properties
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng SystemPropertiesTest
+ */
+public class SystemPropertiesTest {
+ private final static String PROPERTY_NAME = "SystemPropertiesTestPropertyName";
+ private final static String PROPERTY_VALUE = "SystemPropertiesTestPropertyValue";
+
+ public void run(CommandExecutor executor) {
+ System.setProperty(PROPERTY_NAME, PROPERTY_VALUE);
+
+ OutputAnalyzer output = executor.execute("VM.system_properties");
+ output.shouldContain(PROPERTY_NAME + "=" + PROPERTY_VALUE);
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/serviceability/dcmd/vm/UptimeTest.java b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
new file mode 100644
index 00000000000..b646f570faa
--- /dev/null
+++ b/hotspot/test/serviceability/dcmd/vm/UptimeTest.java
@@ -0,0 +1,89 @@
+/*
+ * 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 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 org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.dcmd.CommandExecutor;
+import com.oracle.java.testlibrary.dcmd.JMXExecutor;
+
+import java.text.NumberFormat;
+import java.text.ParseException;
+
+/*
+ * @test
+ * @summary Test of diagnostic command VM.uptime
+ * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
+ * @build com.oracle.java.testlibrary.dcmd.*
+ * @run testng UptimeTest
+ */
+public class UptimeTest {
+ public void run(CommandExecutor executor) {
+ double someUptime = 1.0;
+ long startTime = System.currentTimeMillis();
+ try {
+ synchronized (this) {
+ /* Loop to guard against spurious wake ups */
+ while (System.currentTimeMillis() < (startTime + someUptime * 1000)) {
+ wait((int) someUptime * 1000);
+ }
+ }
+ } catch (InterruptedException e) {
+ Assert.fail("Test error: Exception caught when sleeping:", e);
+ }
+
+ OutputAnalyzer output = executor.execute("VM.uptime");
+
+ output.stderrShouldBeEmpty();
+
+ /*
+ * Output should be:
+ * [pid]:
+ * xx.yyy s
+ *
+ * If there is only one line in output there is no "[pid]:" printout;
+ * skip first line, split on whitespace and grab first half
+ */
+ int index = output.asLines().size() == 1 ? 0 : 1;
+ String uptimeString = output.asLines().get(index).split("\\s+")[0];
+
+ try {
+ double uptime = NumberFormat.getNumberInstance().parse(uptimeString).doubleValue();
+ if (uptime < someUptime) {
+ Assert.fail(String.format(
+ "Test failure: Uptime was less than intended sleep time: %.3f s < %.3f s",
+ uptime, someUptime));
+ }
+ } catch (ParseException e) {
+ Assert.fail("Test failure: Could not parse uptime string: " +
+ uptimeString, e);
+ }
+ }
+
+ @Test
+ public void jmx() {
+ run(new JMXExecutor());
+ }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
index b81f21a0184..191a75c5b92 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/OutputAnalyzer.java
@@ -24,6 +24,8 @@
package com.oracle.java.testlibrary;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -69,6 +71,58 @@ public final class OutputAnalyzer {
}
/**
+ * Verify that the stdout contents of output buffer is empty
+ *
+ * @throws RuntimeException
+ * If stdout was not empty
+ */
+ public void stdoutShouldBeEmpty() {
+ if (!getStdout().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stdout was not empty");
+ }
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer is empty
+ *
+ * @throws RuntimeException
+ * If stderr was not empty
+ */
+ public void stderrShouldBeEmpty() {
+ if (!getStderr().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stderr was not empty");
+ }
+ }
+
+ /**
+ * Verify that the stdout contents of output buffer is not empty
+ *
+ * @throws RuntimeException
+ * If stdout was empty
+ */
+ public void stdoutShouldNotBeEmpty() {
+ if (getStdout().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stdout was empty");
+ }
+ }
+
+ /**
+ * Verify that the stderr contents of output buffer is not empty
+ *
+ * @throws RuntimeException
+ * If stderr was empty
+ */
+ public void stderrShouldNotBeEmpty() {
+ if (getStderr().isEmpty()) {
+ reportDiagnosticSummary();
+ throw new RuntimeException("stderr was empty");
+ }
+ }
+
+ /**
* Verify that the stdout and stderr contents of output buffer contains the string
*
* @param expectedString String that buffer should contain
@@ -365,4 +419,18 @@ public final class OutputAnalyzer {
public int getExitValue() {
return exitValue;
}
+
+ /**
+ * Get the contents of the output buffer (stdout and stderr) as list of strings.
+ * Output will be split by newlines.
+ *
+ * @return Contents of the output buffer as list of strings
+ */
+ public List asLines() {
+ return asLines(getOutput());
+ }
+
+ private List asLines(String buffer) {
+ return Arrays.asList(buffer.split("(\\r\\n|\\n|\\r)"));
+ }
}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
index c63076ec8e6..167d6d134b1 100644
--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java
@@ -184,23 +184,36 @@ public final class ProcessTools {
return executeProcess(pb);
}
- /**
- * Executes a process, waits for it to finish and returns the process output.
- * @param pb The ProcessBuilder to execute.
- * @return The output from the process.
- */
- public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Throwable {
- OutputAnalyzer output = null;
- try {
- output = new OutputAnalyzer(pb.start());
- return output;
- } catch (Throwable t) {
- System.out.println("executeProcess() failed: " + t);
- throw t;
- } finally {
- System.out.println(getProcessLog(pb, output));
+ /**
+ * Executes a process, waits for it to finish and returns the process output.
+ * The process will have exited before this method returns.
+ * @param pb The ProcessBuilder to execute.
+ * @return The {@linkplain OutputAnalyzer} instance wrapping the process.
+ */
+ public static OutputAnalyzer executeProcess(ProcessBuilder pb) throws Exception {
+ OutputAnalyzer output = null;
+ Process p = null;
+ boolean failed = false;
+ try {
+ p = pb.start();
+ output = new OutputAnalyzer(p);
+ p.waitFor();
+
+ return output;
+ } catch (Throwable t) {
+ if (p != null) {
+ p.destroyForcibly().waitFor();
+ }
+
+ failed = true;
+ System.out.println("executeProcess() failed: " + t);
+ throw t;
+ } finally {
+ if (failed) {
+ System.err.println(getProcessLog(pb, output));
+ }
+ }
}
- }
/**
* Executes a process, waits for it to finish and returns the process output.
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java
new file mode 100644
index 00000000000..dd2d3b83cc9
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutor.java
@@ -0,0 +1,57 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+/**
+ * Abstract base class for Diagnostic Command executors
+ */
+public abstract class CommandExecutor {
+
+ /**
+ * Execute a diagnostic command
+ *
+ * @param cmd The diagnostic command to execute
+ * @return an {@link jdk.testlibrary.OutputAnalyzer} encapsulating the output of the command
+ * @throws CommandExecutorException if there is an exception on the "calling side" while trying to execute the
+ * Diagnostic Command. Exceptions thrown on the remote side are available as textual representations in
+ * stderr, regardless of the specific executor used.
+ */
+ public final OutputAnalyzer execute(String cmd) throws CommandExecutorException {
+ System.out.printf("Running DCMD '%s' through '%s'%n", cmd, this.getClass().getSimpleName());
+ OutputAnalyzer oa = executeImpl(cmd);
+
+ System.out.println("---------------- stdout ----------------");
+ System.out.println(oa.getStdout());
+ System.out.println("---------------- stderr ----------------");
+ System.out.println(oa.getStderr());
+ System.out.println("----------------------------------------");
+ System.out.println();
+
+ return oa;
+ }
+
+ protected abstract OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException;
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java
new file mode 100644
index 00000000000..67b37d1de61
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/CommandExecutorException.java
@@ -0,0 +1,36 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+/**
+ * CommandExecutorException encapsulates exceptions thrown (on the "calling side") from the execution of Diagnostic
+ * Commands
+ */
+public class CommandExecutorException extends RuntimeException {
+ private static final long serialVersionUID = -7039597746579144280L;
+
+ public CommandExecutorException(String message, Throwable e) {
+ super(message, e);
+ }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java
new file mode 100644
index 00000000000..947edad1d84
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/FileJcmdExecutor.java
@@ -0,0 +1,81 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool and its ability to read
+ * Diagnostic Commands from a file.
+ */
+public class FileJcmdExecutor extends PidJcmdExecutor {
+
+ /**
+ * Instantiates a new FileJcmdExecutor targeting the current VM
+ */
+ public FileJcmdExecutor() {
+ super();
+ }
+
+ /**
+ * Instantiates a new FileJcmdExecutor targeting the VM indicated by the given pid
+ *
+ * @param target Pid of the target VM
+ */
+ public FileJcmdExecutor(String target) {
+ super(target);
+ }
+
+ protected List createCommandLine(String cmd) throws CommandExecutorException {
+ File cmdFile = createTempFile();
+ writeCommandToTemporaryFile(cmd, cmdFile);
+
+ return Arrays.asList(jcmdBinary, Integer.toString(pid),
+ "-f", cmdFile.getAbsolutePath());
+ }
+
+ private void writeCommandToTemporaryFile(String cmd, File cmdFile) {
+ try (PrintWriter pw = new PrintWriter(cmdFile)) {
+ pw.println(cmd);
+ } catch (IOException e) {
+ String message = "Could not write to file: " + cmdFile.getAbsolutePath();
+ throw new CommandExecutorException(message, e);
+ }
+ }
+
+ private File createTempFile() {
+ try {
+ File cmdFile = File.createTempFile("input", "jcmd");
+ cmdFile.deleteOnExit();
+ return cmdFile;
+ } catch (IOException e) {
+ throw new CommandExecutorException("Could not create temporary file", e);
+ }
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java
new file mode 100644
index 00000000000..46c92054fdf
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JMXExecutor.java
@@ -0,0 +1,187 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.OutputAnalyzer;
+
+import javax.management.*;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import java.lang.management.ManagementFactory;
+
+import java.util.HashMap;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by a host/port combination or a full JMX Service URL) using
+ * the JMX interface. If the target is not the current VM, the JMX Remote interface must be enabled beforehand.
+ */
+public class JMXExecutor extends CommandExecutor {
+
+ private final MBeanServerConnection mbs;
+
+ /**
+ * Instantiates a new JMXExecutor targeting the current VM
+ */
+ public JMXExecutor() {
+ super();
+ mbs = ManagementFactory.getPlatformMBeanServer();
+ }
+
+ /**
+ * Instantiates a new JMXExecutor targeting the VM indicated by the given host/port combination or a full JMX
+ * Service URL
+ *
+ * @param target a host/port combination on the format "host:port" or a full JMX Service URL of the target VM
+ */
+ public JMXExecutor(String target) {
+ String urlStr;
+
+ if (target.matches("^\\w[\\w\\-]*(\\.[\\w\\-]+)*:\\d+$")) {
+ /* Matches "hostname:port" */
+ urlStr = String.format("service:jmx:rmi:///jndi/rmi://%s/jmxrmi", target);
+ } else if (target.startsWith("service:")) {
+ urlStr = target;
+ } else {
+ throw new IllegalArgumentException("Could not recognize target string: " + target);
+ }
+
+ try {
+ JMXServiceURL url = new JMXServiceURL(urlStr);
+ JMXConnector c = JMXConnectorFactory.connect(url, new HashMap<>());
+ mbs = c.getMBeanServerConnection();
+ } catch (IOException e) {
+ throw new CommandExecutorException("Could not initiate connection to target: " + target, e);
+ }
+ }
+
+ protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
+ String stdout = "";
+ String stderr = "";
+
+ String[] cmdParts = cmd.split(" ", 2);
+ String operation = commandToMethodName(cmdParts[0]);
+ Object[] dcmdArgs = produceArguments(cmdParts);
+ String[] signature = {String[].class.getName()};
+
+ ObjectName beanName = getMBeanName();
+
+ try {
+ stdout = (String) mbs.invoke(beanName, operation, dcmdArgs, signature);
+ }
+
+ /* Failures on the "local" side, the one invoking the command. */
+ catch (ReflectionException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof NoSuchMethodException) {
+ /* We want JMXExecutor to match the behavior of the other CommandExecutors */
+ String message = "Unknown diagnostic command: " + operation;
+ stderr = exceptionTraceAsString(new IllegalArgumentException(message, e));
+ } else {
+ rethrowExecutorException(operation, dcmdArgs, e);
+ }
+ }
+
+ /* Failures on the "local" side, the one invoking the command. */
+ catch (InstanceNotFoundException | IOException e) {
+ rethrowExecutorException(operation, dcmdArgs, e);
+ }
+
+ /* Failures on the remote side, the one executing the invoked command. */
+ catch (MBeanException e) {
+ stdout = exceptionTraceAsString(e);
+ }
+
+ return new OutputAnalyzer(stdout, stderr);
+ }
+
+ private void rethrowExecutorException(String operation, Object[] dcmdArgs,
+ Exception e) throws CommandExecutorException {
+ String message = String.format("Could not invoke: %s %s", operation,
+ String.join(" ", (String[]) dcmdArgs[0]));
+ throw new CommandExecutorException(message, e);
+ }
+
+ private ObjectName getMBeanName() throws CommandExecutorException {
+ String MBeanName = "com.sun.management:type=DiagnosticCommand";
+
+ try {
+ return new ObjectName(MBeanName);
+ } catch (MalformedObjectNameException e) {
+ String message = "MBean not found: " + MBeanName;
+ throw new CommandExecutorException(message, e);
+ }
+ }
+
+ private Object[] produceArguments(String[] cmdParts) {
+ Object[] dcmdArgs = {new String[0]}; /* Default: No arguments */
+
+ if (cmdParts.length == 2) {
+ dcmdArgs[0] = cmdParts[1].split(" ");
+ }
+ return dcmdArgs;
+ }
+
+ /**
+ * Convert from diagnostic command to MBean method name
+ *
+ * Examples:
+ * help --> help
+ * VM.version --> vmVersion
+ * VM.command_line --> vmCommandLine
+ */
+ private static String commandToMethodName(String cmd) {
+ String operation = "";
+ boolean up = false; /* First letter is to be lower case */
+
+ /*
+ * If a '.' or '_' is encountered it is not copied,
+ * instead the next character will be converted to upper case
+ */
+ for (char c : cmd.toCharArray()) {
+ if (('.' == c) || ('_' == c)) {
+ up = true;
+ } else if (up) {
+ operation = operation.concat(Character.toString(c).toUpperCase());
+ up = false;
+ } else {
+ operation = operation.concat(Character.toString(c).toLowerCase());
+ }
+ }
+
+ return operation;
+ }
+
+ private static String exceptionTraceAsString(Throwable cause) {
+ StringWriter sw = new StringWriter();
+ cause.printStackTrace(new PrintWriter(sw));
+ return sw.toString();
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java
new file mode 100644
index 00000000000..3ef8ba810e8
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/JcmdExecutor.java
@@ -0,0 +1,58 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.JDKToolFinder;
+import com.oracle.java.testlibrary.OutputAnalyzer;
+import com.oracle.java.testlibrary.ProcessTools;
+
+import java.util.List;
+
+/**
+ * Base class for Diagnostic Command Executors using the jcmd tool
+ */
+public abstract class JcmdExecutor extends CommandExecutor {
+ protected String jcmdBinary;
+
+ protected abstract List createCommandLine(String cmd) throws CommandExecutorException;
+
+ protected JcmdExecutor() {
+ jcmdBinary = JDKToolFinder.getJDKTool("jcmd");
+ }
+
+ protected OutputAnalyzer executeImpl(String cmd) throws CommandExecutorException {
+ List commandLine = createCommandLine(cmd);
+
+ try {
+ System.out.printf("Executing command '%s'%n", commandLine);
+ OutputAnalyzer output = ProcessTools.executeProcess(new ProcessBuilder(commandLine));
+ System.out.printf("Command returned with exit code %d%n", output.getExitValue());
+
+ return output;
+ } catch (Exception e) {
+ String message = String.format("Caught exception while executing '%s'", commandLine);
+ throw new CommandExecutorException(message, e);
+ }
+ }
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java
new file mode 100644
index 00000000000..6f298c412e2
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/MainClassJcmdExecutor.java
@@ -0,0 +1,57 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by main class) using the jcmd tool
+ */
+public class MainClassJcmdExecutor extends JcmdExecutor {
+ private final String mainClass;
+
+ /**
+ * Instantiates a new MainClassJcmdExecutor targeting the current VM
+ */
+ public MainClassJcmdExecutor() {
+ super();
+ mainClass = System.getProperty("sun.java.command").split(" ")[0];
+ }
+
+ /**
+ * Instantiates a new MainClassJcmdExecutor targeting the VM indicated by the given main class
+ *
+ * @param target Main class of the target VM
+ */
+ public MainClassJcmdExecutor(String target) {
+ super();
+ mainClass = target;
+ }
+
+ protected List createCommandLine(String cmd) throws CommandExecutorException {
+ return Arrays.asList(jcmdBinary, mainClass, cmd);
+ }
+
+}
diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java
new file mode 100644
index 00000000000..cc00518a4a3
--- /dev/null
+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/dcmd/PidJcmdExecutor.java
@@ -0,0 +1,63 @@
+/*
+ * 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 file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.oracle.java.testlibrary.dcmd;
+
+import com.oracle.java.testlibrary.ProcessTools;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Executes Diagnostic Commands on the target VM (specified by pid) using the jcmd tool
+ */
+public class PidJcmdExecutor extends JcmdExecutor {
+ protected final int pid;
+
+ /**
+ * Instantiates a new PidJcmdExecutor targeting the current VM
+ */
+ public PidJcmdExecutor() {
+ super();
+ try {
+ pid = ProcessTools.getProcessId();
+ } catch (Exception e) {
+ throw new CommandExecutorException("Could not determine own pid", e);
+ }
+ }
+
+ /**
+ * Instantiates a new PidJcmdExecutor targeting the VM indicated by the given pid
+ *
+ * @param target Pid of the target VM
+ */
+ public PidJcmdExecutor(String target) {
+ super();
+ pid = Integer.valueOf(target);
+ }
+
+ protected List createCommandLine(String cmd) throws CommandExecutorException {
+ return Arrays.asList(jcmdBinary, Integer.toString(pid), cmd);
+ }
+
+}
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 2e3d8c48f55..d76e077b8d0 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -292,3 +292,4 @@ a12d347f84176200593999f4da91ae2bb86865b2 jdk9-b39
e391de88e69b59d7c618387e3cf91032f6991ce9 jdk9-b47
833051855168a973780fafeb6fc59e7370bcf400 jdk9-b48
786058752e0ac3e48d7aef79e0885d29d6a2a7eb jdk9-b49
+74ead7bddde19263fd463bc1bd87de84f27d1b5e jdk9-b50
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index 07c5de85edc..854df15ceda 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -295,3 +295,4 @@ e529374fbe526dbd668e5e98fc047b42b3bc6d33 jdk9-b45
6c17d648d03e4bf4729c3645f8db55d34115e0b7 jdk9-b47
33e7e699804892c0496adf60ad67cc12855aeb61 jdk9-b48
435a49db1de0589acc86b2cc5fd61d546f94b56c jdk9-b49
+45a30e7ee623031a1532685512dd2c2d8e8fa0ad jdk9-b50
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java
index 77d84390c93..6f435457687 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBContext.java
@@ -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
@@ -45,14 +45,14 @@ import java.io.InputStream;
* specialized forms of the method available:
*
*
{@link #newInstance(String,ClassLoader) JAXBContext.newInstance( "com.acme.foo:com.acme.bar" )}
* The JAXBContext instance is initialized from a list of colon
* separated Java package names. Each java package contains
* JAXB mapped classes, schema-derived classes and/or user annotated
* classes. Additionally, the java package may contain JAXB package annotations
* that must be processed. (see JLS, Section 7.4.1 "Named Packages").
*
{@link #newInstance(Class...) JAXBContext.newInstance( com.acme.foo.Foo.class )}
* The JAXBContext instance is initialized with class(es)
* passed as parameter(s) and classes that are statically reachable from
* these class(es). See {@link #newInstance(Class...)} for details.
@@ -64,8 +64,8 @@ import java.io.InputStream;
* class containing the following method signatures:
*
*
* @see Marshaller
* @see Unmarshaller
- * @see S 7.4.1 "Named Packages" in Java Language Specification
+ * @see S 7.4.1 "Named Packages" in Java Language Specification
* @since 1.6, JAXB 1.0
*/
public abstract class JAXBContext {
@@ -352,7 +352,7 @@ public abstract class JAXBContext {
*
* To maintain compatibility with JAXB 1.0 schema to java
* interface/implementation binding, enabled by schema customization
- * <jaxb:globalBindings valueClass="false">,
+ * <jaxb:globalBindings valueClass="false">,
* the JAXB provider will ensure that each package on the context path
* has a jaxb.properties file which contains a value for the
* javax.xml.bind.context.factory property and that all values
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java
index 432f0531d39..7686dfbe671 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, 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
@@ -48,7 +48,7 @@ public class JAXBException extends Exception {
* Exception reference
*
*/
- private Throwable linkedException;
+ private volatile Throwable linkedException;
static final long serialVersionUID = -5621384651494307979L;
@@ -133,7 +133,7 @@ public class JAXBException extends Exception {
* indicates that the linked exception does not exist or
* is unknown).
*/
- public synchronized void setLinkedException( Throwable exception ) {
+ public void setLinkedException( Throwable exception ) {
this.linkedException = exception;
}
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java
index ed75427b442..ad897aeb00c 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/JAXBIntrospector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -51,7 +51,7 @@ public abstract class JAXBIntrospector {
*
*
It is an instance of javax.xml.bind.JAXBElement.
*
The class of object is annotated with
- * @XmlRootElement.
+ * @XmlRootElement.
*
*
*
@@ -74,7 +74,7 @@ public abstract class JAXBIntrospector {
*
*
Convenience method to abstract whether working with either
* a javax.xml.bind.JAXBElement instance or an instance of
- * @XmlRootElement annotated Java class.
+ * @XmlRootElement annotated Java class.
*
* @param jaxbElement object that #isElement(Object) returns true.
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java
index abb41042479..827425efd3a 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Marshaller.java
@@ -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
@@ -175,7 +175,7 @@ import java.io.File;
* encoding used during these marshal operations. Client applications are
* expected to supply a valid character encoding name as defined in the
* W3C XML 1.0
- * Recommendation and supported by your Java Platform.
+ * Recommendation and supported by your Java Platform.
*
*
*
@@ -664,7 +664,7 @@ public interface Marshaller {
*
*
* Every marshaller internally maintains a
- * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
* which it uses for marshalling classes whose fields/methods are annotated
* with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
*
@@ -750,17 +750,17 @@ public interface Marshaller {
public Schema getSchema();
/**
- *
+ *
* Register an instance of an implementation of this class with a {@link Marshaller} to externally listen
* for marshal events.
- *
- *
+ *
+ *
* This class enables pre and post processing of each marshalled object.
* The event callbacks are called when marshalling from an instance that maps to an xml element or
* complex type definition. The event callbacks are not called when marshalling from an instance of a
* Java datatype that represents a simple type definition.
- *
- *
+ *
+ *
* External listener is one of two different mechanisms for defining marshal event callbacks.
* See Marshal Event Callbacks for an overview.
*
@@ -770,10 +770,10 @@ public interface Marshaller {
*/
public static abstract class Listener {
/**
- *
+ *
* Callback method invoked before marshalling from source to XML.
- *
- *
+ *
+ *
* This method is invoked just before marshalling process starts to marshal source.
* Note that if the class of source defines its own beforeMarshal method,
* the class specific callback method is invoked just before this method is invoked.
@@ -784,10 +784,10 @@ public interface Marshaller {
}
/**
- *
+ *
* Callback method invoked after marshalling source to XML.
- *
- *
+ *
+ *
* This method is invoked after source and all its descendants have been marshalled.
* Note that if the class of source defines its own afterMarshal method,
* the class specific callback method is invoked just before this method is invoked.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java
index c39b78c870d..0e36f72591a 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/SchemaOutputResolver.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -70,11 +70,11 @@ public abstract class SchemaOutputResolver {
*
* If the {@link Result} object has a system ID, it must be an
* absolute system ID. Those system IDs are relativized by the caller and used
- * for <xs:import> statements.
+ * for <xs:import> statements.
*
* If the {@link Result} object does not have a system ID, a schema
* for the namespace URI is generated but it won't be explicitly
- * <xs:import>ed from other schemas.
+ * <xs:import>ed from other schemas.
*
* If {@code null} is returned, the schema generation for this
* namespace URI will be skipped.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java
index fa9ae393635..1137443bcb5 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/TypeConstraintException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, 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
@@ -57,8 +57,9 @@ public class TypeConstraintException extends java.lang.RuntimeException {
* Exception reference
*
*/
- private Throwable linkedException;
+ private volatile Throwable linkedException;
+ static final long serialVersionUID = -3059799699420143848L;
/**
* Construct a TypeConstraintException with the specified detail message. The
@@ -141,7 +142,7 @@ public class TypeConstraintException extends java.lang.RuntimeException {
* indicates that the linked exception does not exist or
* is unknown).
*/
- public synchronized void setLinkedException( Throwable exception ) {
+ public void setLinkedException( Throwable exception ) {
this.linkedException = exception;
}
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
index 19dfb6e6f4b..d966659fd2d 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Unmarshaller.java
@@ -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
@@ -238,13 +238,12 @@ import java.io.Reader;
* to a JAXB mapped class by {@link JAXBContext}, that the root
* element's xsi:type attribute takes
* precedence over the unmarshal methods declaredType parameter.
- * These methods always return a JAXBElement<declaredType>
+ * These methods always return a JAXBElement<declaredType>
* instance. The table below shows how the properties of the returned JAXBElement
* instance are set.
*
*
- *
- *
+ *
*
*
*
@@ -284,19 +283,19 @@ import java.io.Reader;
*
*
* Schema fragment for example
- * <xs:schema>
- * <xs:complexType name="FooType">...<\xs:complexType>
- * <!-- global element declaration "PurchaseOrder" -->
- * <xs:element name="PurchaseOrder">
- * <xs:complexType>
- * <xs:sequence>
- * <!-- local element declaration "foo" -->
- * <xs:element name="foo" type="FooType"/>
+ * <xs:schema>
+ * <xs:complexType name="FooType">...<\xs:complexType>
+ * <!-- global element declaration "PurchaseOrder" -->
+ * <xs:element name="PurchaseOrder">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <!-- local element declaration "foo" -->
+ * <xs:element name="foo" type="FooType"/>
* ...
- * </xs:sequence>
- * </xs:complexType>
- * </xs:element>
- * </xs:schema>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:schema>
*
* JAXBContext jc = JAXBContext.newInstance( "com.acme.foo" );
* Unmarshaller u = jc.createUnmarshaller();
@@ -309,7 +308,7 @@ import java.io.Reader;
* // local element declaration in schema.
*
* // FooType is the JAXB mapping of the type of local element declaration foo.
- * JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
+ * JAXBElement<FooType> foo = u.unmarshal( fooSubtree, FooType.class);
*
*
*
@@ -390,7 +389,7 @@ import java.io.Reader;
* The external listener callback mechanism enables the registration of a {@link Listener}
* instance with an {@link Unmarshaller#setListener(Listener)}. The external listener receives all callback events,
* allowing for more centralized processing than per class defined callback methods. The external listener
- * receives events when unmarshalling proces is marshalling to a JAXB element or to JAXB mapped class.
+ * receives events when unmarshalling process is marshalling to a JAXB element or to JAXB mapped class.
*
* The 'class defined' and external listener event callback methods are independent of each other,
* both can be called for one event. The invocation ordering when both listener callback methods exist is
@@ -1010,7 +1009,7 @@ public interface Unmarshaller {
*
*
* Every unmarshaller internally maintains a
- * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
+ * {@link java.util.Map}<{@link Class},{@link XmlAdapter}>,
* which it uses for unmarshalling classes whose fields/methods are annotated
* with {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
*
@@ -1050,7 +1049,6 @@ public interface Unmarshaller {
/**
*
Associate a context that resolves cid's, content-id URIs, to
* binary data passed as attachments.
- *
*
Unmarshal time validation, enabled via {@link #setSchema(Schema)},
* must be supported even when unmarshaller is performing XOP processing.
*
* Register an instance of an implementation of this class with {@link Unmarshaller} to externally listen
* for unmarshal events.
- *
- *
+ *
+ *
* This class enables pre and post processing of an instance of a JAXB mapped class
* as XML data is unmarshalled into it. The event callbacks are called when unmarshalling
* XML content into a JAXBElement instance or a JAXB mapped class that represents a complex type definition.
* The event callbacks are not called when unmarshalling to an instance of a
* Java datatype that represents a simple type definition.
- *
- *
+ *
+ *
* External listener is one of two different mechanisms for defining unmarshal event callbacks.
* See Unmarshal Event Callbacks for an overview.
- *
+ *
* (@link #setListener(Listener)}
* (@link #getListener()}
*
@@ -1085,10 +1083,10 @@ public interface Unmarshaller {
*/
public static abstract class Listener {
/**
- *
+ *
* Callback method invoked before unmarshalling into target.
- *
- *
+ *
+ *
* This method is invoked immediately after target was created and
* before the unmarshalling of this object begins. Note that
* if the class of target defines its own beforeUnmarshal method,
@@ -1102,10 +1100,10 @@ public interface Unmarshaller {
}
/**
- *
+ *
* Callback method invoked after unmarshalling XML data into target.
- *
- *
+ *
+ *
* This method is invoked after all the properties (except IDREF) are unmarshalled into target,
* but before target is set into its parent object.
* Note that if the class of target defines its own afterUnmarshal method,
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java
index ff9c13778de..b237b80221b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyAttribute.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -62,7 +62,7 @@ import static java.lang.annotation.ElementType.METHOD;
* each attribute that is not statically associated with another
* JavaBean property, via {@link XmlAttribute}, is entered into the
* wildcard attribute map represented by
- * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the
+ * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the
* map's key. The key's value is the String value of the attribute.
*
* @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java
index 3ca62ccd61b..0fcd2dc372f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAnyElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -50,7 +50,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* annotation for the other JavaBean properties on the class, is added to this
* "catch-all" property.
*
- *
- * <foo xmlns:e="extra">
- * <a>1
- * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
- * <b>3
- * <e:other />
- * <c>5 // this will be bound to DOM, because the annotation doesn't remember namespaces.
- * </foo>
+ * <foo xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this will be bound to DOM, because the annotation doesn't remember namespaces.
+ * </foo>
*
*
*
*
* The following schema would produce the following Java class:
*
@@ -152,14 +151,14 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* It can unmarshal instances like
*
*
- * <bar xmlns:e="extra">
- * <a>1
- * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
- * <b>3
- * <e:other />
- * <c>5 // this now goes to Bar.c
- * <e:other /> // this will go to Foo.any
- * </bar>
+ * <bar xmlns:e="extra">
+ * <a>1</a>
+ * <e:other /> // this will be bound to DOM, because unmarshalling is orderless
+ * <b>3</b>
+ * <e:other />
+ * <c>5</c> // this now goes to Bar.c
+ * <e:other /> // this will go to Foo.any
+ * </bar>
*
- * <foo xmlns:e="extra">
- * <a>1 // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * <e:other /> // this will unmarshal to a DOM {@link Element}.
- * <b>3 // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
- * </foo>
+ * <foo xmlns:e="extra">
+ * <a>1</a> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * <e:other /> // this will unmarshal to a DOM {@link Element}.
+ * <b>3</b> // this will unmarshal to a {@link JAXBElement} instance whose value is 1.
+ * </foo>
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java
index b37ca5d2898..8e367582ca3 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlAttribute.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -56,8 +56,8 @@ import static java.lang.annotation.RetentionPolicy.*;
* simple type.
*
* // Examples
- * @XmlAttribute List<Integer> items; //legal
- * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
+ * @XmlAttribute List<Integer> items; //legal
+ * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type
*
*
*
If the type of the field or the property is a non
@@ -80,7 +80,6 @@ import static java.lang.annotation.RetentionPolicy.*;
* {@link XmlInlineBinaryData},
* {@link javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter}.
*
- *
*
*
Example 1: Map a JavaBean property to an XML attribute.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
index 00be7a5cc15..9f99ca3d80b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementRef.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -57,8 +57,8 @@ import static java.lang.annotation.ElementType.METHOD;
* (section 5.5.5, "Element Property" of JAXB 2.0 specification). An
* element property method signature is of the form:
*
- * public void setTerm(JAXBElement extends Operator>);
- * public JAXBElement extends Operator> getTerm();
+ * public void setTerm(JAXBElement<? extends Operator>);
+ * public JAXBElement<? extends Operator> getTerm();
*
*
* An element factory method annotated with {@link XmlElementDecl} is
@@ -106,7 +106,7 @@ import static java.lang.annotation.ElementType.METHOD;
* // element name will be derived from the @XmlRootElement
* // annotation on the type (for e.g. "jar" for JarTask).
* @XmlElementRef
- * List<Task> tasks;
+ * List<Task> tasks;
* }
*
* abstract class Task {
@@ -122,16 +122,16 @@ import static java.lang.annotation.ElementType.METHOD;
* ...
* }
*
- * <!-- XML Schema fragment -->
- * <xs:element name="target" type="Target">
- * <xs:complexType name="Target">
- * <xs:sequence>
- * <xs:choice maxOccurs="unbounded">
- * <xs:element ref="jar">
- * <xs:element ref="javac">
- * </xs:choice>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:element name="target" type="Target">
+ * <xs:complexType name="Target">
+ * <xs:sequence>
+ * <xs:choice maxOccurs="unbounded">
+ * <xs:element ref="jar">
+ * <xs:element ref="javac">
+ * </xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
@@ -144,14 +144,14 @@ import static java.lang.annotation.ElementType.METHOD;
*
* will produce the following XML output:
*
*
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
index 71aeec1141a..fc7d09c05e8 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElementWrapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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,15 +44,15 @@ import java.lang.annotation.Target;
* int[] names;
*
* // XML Serialization Form 1 (Unwrapped collection)
- * <names> ... </names>
- * <names> ... </names>
+ * <names> ... </names>
+ * <names> ... </names>
*
* // XML Serialization Form 2 ( Wrapped collection )
- * <wrapperElement>
- * <names> value-of-item </names>
- * <names> value-of-item </names>
+ * <wrapperElement>
+ * <names> value-of-item </names>
+ * <names> value-of-item </names>
* ....
- * </wrapperElement>
+ * </wrapperElement>
*
*
*
The two serialized XML forms allow a null collection to be
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
index 4d52a73c037..e15bb1e4146 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlElements.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -83,21 +83,21 @@ import java.lang.annotation.Target;
* }
*
* <!-- XML Representation for a List of {1,2.5}
- * XML output is not wrapped using another element -->
+ * XML output is not wrapped using another element -->
* ...
- * <A> 1 </A>
- * <B> 2.5 </B>
+ * <A> 1 </A>
+ * <B> 2.5 </B>
* ...
*
- * <!-- XML Schema fragment -->
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:choice minOccurs="0" maxOccurs="unbounded">
- * <xs:element name="A" type="xs:int"/>
- * <xs:element name="B" type="xs:float"/>
- * <xs:choice>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * <xs:choice>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
@@ -115,19 +115,19 @@ import java.lang.annotation.Target;
* public List items;
* }
*
- * <!-- XML Schema fragment -->
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:element name="bar">
- * <xs:complexType>
- * <xs:choice minOccurs="0" maxOccurs="unbounded">
- * <xs:element name="A" type="xs:int"/>
- * <xs:element name="B" type="xs:float"/>
- * </xs:choice>
- * </xs:complexType>
- * </xs:element>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="xs:int"/>
+ * <xs:element name="B" type="xs:float"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
Example 3: Change element name based on type using an adapter.
@@ -146,19 +146,19 @@ import java.lang.annotation.Target;
* @XmlType(name="PX") class PX extends P {...}
* @XmlType(name="PY") class PY extends P {...}
*
- * <!-- XML Schema fragment -->
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:element name="bar">
- * <xs:complexType>
- * <xs:choice minOccurs="0" maxOccurs="unbounded">
- * <xs:element name="A" type="PX"/>
- * <xs:element name="B" type="PY"/>
- * </xs:choice>
- * </xs:complexType>
- * </xs:element>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema fragment -->
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="bar">
+ * <xs:complexType>
+ * <xs:choice minOccurs="0" maxOccurs="unbounded">
+ * <xs:element name="A" type="PX"/>
+ * <xs:element name="B" type="PY"/>
+ * </xs:choice>
+ * </xs:complexType>
+ * </xs:element>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
* @author
Kohsuke Kawaguchi, Sun Microsystems, Inc.
Sekhar Vajjhala, Sun Microsystems, Inc.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java
index 1948f3670a2..bcdebcb1a5f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlEnumValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -56,23 +56,23 @@ import static java.lang.annotation.ElementType.FIELD;
*
In the absence of this annotation, {@link Enum#name()} is used
* as the XML representation.
*
- *
Example 1: Map enum constant name -> enumeration facet
+ *
Example 1: Map enum constant name -> enumeration facet
*
* @XmlList annotation, on the other hand, allows multiple values to be
@@ -74,16 +74,16 @@ import static java.lang.annotation.ElementType.PARAMETER;
* class Foo {
* @XmlElement
* @XmlList
- * List<String> data;
+ * List<String> data;
* }
*
*
* the above code will produce XML like this:
*
*
This annotation can be used with the following annotations:
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java
index 8259b59540f..83c5da66d12 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlMixed.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -57,16 +57,16 @@ import javax.xml.bind.JAXBElement;
*
* Below is an example of binding and creation of mixed content.
*
* The following is an XML instance document with mixed content
*
- * <letterBody>
- * Dear Mr.<name>Robert Smith</name>
- * Your order of <quantity>1</quantity> <productName>Baby
- * Monitor</productName> shipped from our warehouse. ....
- * </letterBody>
+ * <letterBody>
+ * Dear Mr.<name>Robert Smith</name>
+ * Your order of <quantity>1</quantity> <productName>Baby
+ * Monitor</productName> shipped from our warehouse. ....
+ * </letterBody>
*
* that can be constructed using following JAXB API calls.
*
* LetterBody lb = ObjectFactory.createLetterBody();
- * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
+ * JAXBElement<LetterBody> lbe = ObjectFactory.createLetterBody(lb);
* List gcl = lb.getContent(); //add mixed content to general content property.
* gcl.add("Dear Mr."); // add text information item as a String.
*
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java
index 769df76146a..4dfd5fa1176 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlNsForm.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -36,8 +36,7 @@ package javax.xml.bind.annotation;
* The namespace qualification values are used in the annotations
* defined in this packge. The enumeration values are mapped as follows:
*
- *
- *
+ *
*
*
*
Enum Value
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java
index 80506a4d05a..b84e71beca2 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlRootElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -54,7 +54,7 @@ import static java.lang.annotation.ElementType.TYPE;
*
This annotation can be used with the following annotations:
* {@link XmlType}, {@link XmlEnum}, {@link XmlAccessorType},
* {@link XmlAccessorOrder}.
- *
+ *
*
* Example 1: Associate an element with XML Schema type
@@ -74,11 +74,11 @@ import static java.lang.annotation.ElementType.TYPE;
*
*
*
*
* The annotation causes an global element declaration to be produced
@@ -86,14 +86,14 @@ import static java.lang.annotation.ElementType.TYPE;
* the XML schema type to which the class is mapped.
*
*
Example 2: Customize namespace prefix, namespace URI
@@ -90,11 +89,11 @@ import static java.lang.annotation.RetentionPolicy.*;
* )
* )
*
- * <!-- XML Schema fragment -->
+ * <!-- XML Schema fragment -->
* <schema
* xmlns:xs="http://www.w3.org/2001/XMLSchema"
* xmlns:po="http://www.example.com/PO1"
- * targetNamespace="http://www.example.com/PO1">
+ * targetNamespace="http://www.example.com/PO1">
*
*
*
@@ -105,11 +104,11 @@ import static java.lang.annotation.RetentionPolicy.*;
* ...
* )
*
- * <!-- XML Schema fragment -->
+ * <!-- XML Schema fragment -->
* <schema
* xmlns="http://www.w3.org/2001/XMLSchema"
* xmlns:po="http://www.example.com/PO1"
- * elementFormDefault="unqualified">
+ * elementFormDefault="unqualified">
*
*
@@ -180,11 +179,11 @@ public @interface XmlSchema {
* More precisely, the value must be either "", "##generate", or
*
* a valid lexical representation of xs:anyURI that begins
- * with <scheme>:.
+ * with <scheme>:.
*
*
* A schema generator is expected to generate a corresponding
- * <xs:import namespace="..." schemaLocation="..."/> (or
+ * <xs:import namespace="..." schemaLocation="..."/> (or
* no schemaLocation attribute at all if the empty string is specified.)
* However, the schema generator is allowed to use a different value in
* the schemaLocation attribute (including not generating
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java
index eac31a6533f..a25b291df06 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlSchemaType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -66,12 +66,12 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* public XMLGregorianCalendar date;
* }
*
- * <!-- Example: Local XML Schema element -->
- * <xs:complexType name="USPrice"/>
- * <xs:sequence>
- * <xs:element name="date" type="xs:date"/>
- * </sequence>
- * </xs:complexType>
+ * <!-- Example: Local XML Schema element -->
+ * <xs:complexType name="USPrice"/>
+ * <xs:sequence>
+ * <xs:element name="date" type="xs:date"/>
+ * </sequence>
+ * </xs:complexType>
*
*
*
Example 2: Customize mapping of XMLGregorianCalendar at package
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java
index fbd4d6eaa3c..055e90e3ca0 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlTransient.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -79,12 +79,12 @@ import static java.lang.annotation.RetentionPolicy.*;
* }
*
*
- * <!-- Example: XML Schema fragment -->
- * <xs:complexType name="USAddress">
- * <xs:sequence>
- * <xs:element name="name" type="xs:string"/>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
* @author Sekhar Vajjhala, Sun Microsystems, Inc.
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java
index 0f4b2506927..42e71396338 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -64,7 +64,7 @@ import java.lang.annotation.Target;
* mapping of JavaBean properties and fields contained within the
* class. The schema type to which the class is mapped can either be
* named or anonymous. A class can be mapped to an anonymous schema
- * type by annotating the class with @XmlType(name="").
+ * type by annotating the class with @XmlType(name="").
*
* Either a global element, local element or a local attribute can be
* associated with an anonymous type as follows:
@@ -112,14 +112,14 @@ import java.lang.annotation.Target;
* The following table shows the mapping of the class to a XML Schema
* complex type or simple type. The notational symbols used in the table are:
*
- *
-> : represents a mapping
+ *
-> : represents a mapping
*
[x]+ : one or more occurances of x
*
[ @XmlValue property ]: JavaBean property annotated with
* @XmlValue
Example 6: Define a factoryClass and factoryMethod
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
index ecf23aceb49..1ab10854a4f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -67,7 +67,6 @@ import static java.lang.annotation.RetentionPolicy.*;
* type, then the type must map to a XML Schema simple type.
*
*
- *
*
* If the annotated JavaBean property is the sole class member being
* mapped to XML Schema construct, then the class is mapped to a
@@ -89,10 +88,10 @@ import static java.lang.annotation.RetentionPolicy.*;
* public java.math.BigDecimal price;
* }
*
- * <!-- Example 1: XML Schema fragment -->
- * <xs:simpleType name="USPrice">
- * <xs:restriction base="xs:decimal"/>
- * </xs:simpleType>
+ * <!-- Example 1: XML Schema fragment -->
+ * <xs:simpleType name="USPrice">
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
*
*
*
@@ -110,17 +109,16 @@ import static java.lang.annotation.RetentionPolicy.*;
* public String currency;
* }
*
- * <!-- Example 2: XML Schema fragment -->
- * <xs:complexType name="InternationalPrice">
- * <xs:simpleContent>
- * <xs:extension base="xs:decimal">
- * <xs:attribute name="currency" type="xs:string"/>
- * </xs:extension>
- * </xs:simpleContent>
- * </xs:complexType>
+ * <!-- Example 2: XML Schema fragment -->
+ * <xs:complexType name="InternationalPrice">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:decimal">
+ * <xs:attribute name="currency" type="xs:string"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
*
*
- *
*
* @author Sekhar Vajjhala, Sun Microsystems, Inc.
* @see XmlType
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
index 4ca79b0358d..4a500814f02 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -76,11 +76,11 @@ package javax.xml.bind.annotation.adapters;
*
Step 1: Determine the desired XML representation for HashMap.
*
*
- * <hashmap>
- * <entry key="id123">this is a value</entry>
- * <entry key="id312">this is another value</entry>
+ * <hashmap>
+ * <entry key="id123">this is a value</entry>
+ * <entry key="id312">this is another value</entry>
* ...
- * </hashmap>
+ * </hashmap>
*
*
*
Step 2: Determine the schema definition that the
@@ -88,20 +88,20 @@ package javax.xml.bind.annotation.adapters;
*
*
*
* @param
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
index 548f3c9bafe..3ce6621a44b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -70,7 +70,7 @@ public abstract class AttachmentUnmarshaller {
*
*
The returned DataHandler instance must be configured
* to meet the following required mapping constaint.
- *
+ *
*
*
*
@@ -100,7 +100,7 @@ public abstract class AttachmentUnmarshaller {
*
*
*
- * Note that it is allowable to support additional mappings.
+ * Note that it is allowable to support additional mappings.
*
* @param cid It is expected to be a valid lexical form of the XML Schema
* xs:anyURI datatype. If {@link #isXOPPackage()}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
index 1ae4b3cd94f..b18bbc710b0 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
index d8194d0aa17..427db1f466e 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
@@ -30,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \
Non-existent directory: {0}
VERSION = \
- schemagen 2.2.12-b141016.1821
+ schemagen 2.2.12-b150126.1924
FULLVERSION = \
- schemagen full version "2.2.12-b141016.1821"
+ schemagen full version "2.2.12-b150126.1924"
USAGE = \
Usage: schemagen [-options ...] \n\
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
index fff47122d87..435ed7150a6 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2}
BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b141016.1821"
+FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b150126.1924"
USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
index 60ecdc915a5..c6d5aad27fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu
BASEDIR_DOESNT_EXIST = Directorio no existente: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b141016.1821"
+FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b150126.1924"
USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
index 1b9109796f0..756a94788fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0
BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b141016.1821"
+FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b150126.1924"
USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
index ba82f11fe95..992b68e2c77 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2}
BASEDIR_DOESNT_EXIST = Directory non esistente: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = versione completa schemagen "2.2.12-b141016.1821"
+FULLVERSION = versione completa schemagen "2.2.12-b150126.1924"
USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
index bd3107c2387..bf3e933ce1c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u
BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
index 642294c211d..31ba0ab9637 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD
BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
index c4284ad4ff2..c2f4155d874 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2}
BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0}
-VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b141016.1821
+VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b150126.1924
-FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b141016.1821"
+FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b150126.1924"
USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
index c89cc1ebf51..cec06517656 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
index f6e5241eebc..938aef76528 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
index adbe668bfb0..fd88f7f2d7f 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
@@ -171,20 +171,20 @@ Driver.CompilingSchema = \
Driver.FailedToGenerateCode = \
Failed to produce code.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
Driver.FilePrologComment = \
- This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \n\
+ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \n\
See http://java.sun.com/xml/jaxb \n\
Any modifications to this file will be lost upon recompilation of the source schema. \n\
Generated on: {0} \n
Driver.Version = \
- xjc 2.2.12-b141016.1821
+ xjc 2.2.12-b150126.1924
Driver.FullVersion = \
- xjc full version "2.2.12-b141016.1821"
+ xjc full version "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
index df277d39716..97271e9de79 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ...
Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b141016.1821"
+Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
index d27e3ef36d3..eadb52fac88 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = Compilando un esquema...
Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b141016.1821 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b150126.1924 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
index 8f3deded4f1..dd19a1687df 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma...
Driver.FailedToGenerateCode = Echec de la production du code.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b141016.1821 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b150126.1924 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b141016.1821"
+Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
index 21f60a899e8..f259cb3d291 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilazione di uno schema in corso...
Driver.FailedToGenerateCode = Produzione del codice non riuscita.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b141016.1821 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b150126.1924 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = versione completa xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versione completa xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
index 342dbcaca62..9674081427e 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\
Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b141016.1821\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b150126.1924\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
index 97cf258262e..3715185d805 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294
Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b141016.1821 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b150126.1924 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
-Driver.Version = XJC 2.2.12-b141016.1821
+Driver.Version = XJC 2.2.12-b150126.1924
-Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
index 395ede3aefc..9f44278b4eb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilando um esquema...
Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b141016.1821 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b150126.1924 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
index 048488a1500..11276a8352a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f...
Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b141016.1821 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b150126.1924 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
index 185fc08bdb7..27227f5b5c5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981...
Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
index fefa33f9830..275dfd70ced 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
@@ -32,18 +32,18 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
+import java.util.ServiceLoader;
import java.util.Set;
import com.sun.codemodel.internal.CodeWriter;
@@ -354,9 +354,7 @@ public class Options
*/
public List getAllPlugins() {
if(allPlugins==null) {
- allPlugins = new ArrayList();
- ClassLoader ucl = getUserClassLoader(SecureLoader.getClassClassLoader(getClass()));
- allPlugins.addAll(Arrays.asList(findServices(Plugin.class,ucl)));
+ allPlugins = findServices(Plugin.class);
}
return allPlugins;
@@ -924,118 +922,44 @@ public class Options
/**
* If a plugin failed to load, report.
*/
- private static String pluginLoadFailure;
+ private String pluginLoadFailure;
/**
* Looks for all "META-INF/services/[className]" files and
* create one instance for each class name found inside this file.
*/
- private static T[] findServices( Class clazz, ClassLoader classLoader ) {
- // if true, print debug output
- final boolean debug = com.sun.tools.internal.xjc.util.Util.getSystemProperty(Options.class,"findServices")!=null;
-
- // if we are running on Mustang or Dolphin, use ServiceLoader
- // so that we can take advantage of JSR-277 module system.
+ private List findServices( Class clazz) {
+ final List result = new ArrayList();
+ final boolean debug = getDebugPropertyValue();
try {
- Class> serviceLoader = Class.forName("java.util.ServiceLoader");
- if(debug)
- System.out.println("Using java.util.ServiceLoader");
- Iterable itr = (Iterable)serviceLoader.getMethod("load",Class.class,ClassLoader.class).invoke(null,clazz,classLoader);
- List r = new ArrayList();
- for (T t : itr)
- r.add(t);
- return r.toArray((T[])Array.newInstance(clazz,r.size()));
- } catch (ClassNotFoundException e) {
- // fall through
- } catch (IllegalAccessException e) {
- Error x = new IllegalAccessError();
- x.initCause(e);
- throw x;
- } catch (InvocationTargetException e) {
- Throwable x = e.getTargetException();
- if (x instanceof RuntimeException)
- throw (RuntimeException) x;
- if (x instanceof Error)
- throw (Error) x;
- throw new Error(x);
- } catch (NoSuchMethodException e) {
- Error x = new NoSuchMethodError();
- x.initCause(e);
- throw x;
- }
-
- String serviceId = "META-INF/services/" + clazz.getName();
-
- // used to avoid creating the same instance twice
- Set classNames = new HashSet();
-
- if(debug) {
- System.out.println("Looking for "+serviceId+" for add-ons");
- }
-
- // try to find services in CLASSPATH
- try {
- Enumeration e = classLoader.getResources(serviceId);
- if(e==null) return (T[])Array.newInstance(clazz,0);
-
- ArrayList a = new ArrayList();
- while(e.hasMoreElements()) {
- URL url = e.nextElement();
- BufferedReader reader=null;
-
- if(debug) {
- System.out.println("Checking "+url+" for an add-on");
- }
-
- try {
- reader = new BufferedReader(new InputStreamReader(url.openStream()));
- String impl;
- while((impl = reader.readLine())!=null ) {
- // try to instanciate the object
- impl = impl.trim();
- if(classNames.add(impl)) {
- Class implClass = classLoader.loadClass(impl);
- if(!clazz.isAssignableFrom(implClass)) {
- pluginLoadFailure = impl+" is not a subclass of "+clazz+". Skipping";
- if(debug)
- System.out.println(pluginLoadFailure);
- continue;
- }
- if(debug) {
- System.out.println("Attempting to instanciate "+impl);
- }
- a.add(clazz.cast(implClass.newInstance()));
- }
- }
- reader.close();
- } catch( Exception ex ) {
- // let it go.
- StringWriter w = new StringWriter();
- ex.printStackTrace(new PrintWriter(w));
- pluginLoadFailure = w.toString();
- if(debug) {
- System.out.println(pluginLoadFailure);
- }
- if( reader!=null ) {
- try {
- reader.close();
- } catch( IOException ex2 ) {
- // ignore
- }
- }
- }
- }
-
- return a.toArray((T[])Array.newInstance(clazz,a.size()));
+ // TCCL allows user plugins to be loaded even if xjc is in jdk
+ // We have to use our SecureLoader to obtain it because we are trying to avoid SecurityException
+ final ClassLoader tccl = SecureLoader.getContextClassLoader();
+ final ServiceLoader sl = ServiceLoader.load(clazz, tccl);
+ for (T t : sl)
+ result.add(t);
} catch( Throwable e ) {
// ignore any error
StringWriter w = new StringWriter();
e.printStackTrace(new PrintWriter(w));
pluginLoadFailure = w.toString();
- if(debug) {
+ if(debug)
System.out.println(pluginLoadFailure);
- }
- return (T[])Array.newInstance(clazz,0);
+ }
+ return result;
+ }
+
+ private static boolean getDebugPropertyValue() {
+ final String debugPropertyName = Options.class.getName() + ".findServices";
+ if (System.getSecurityManager() != null) {
+ return AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Boolean run() {
+ return Boolean.getBoolean(debugPropertyName);
+ }
+ });
+ } else {
+ return Boolean.getBoolean(debugPropertyName);
}
}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
index 426a06b1b39..d17afa13387 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
@@ -40,7 +40,7 @@ import com.sun.codemodel.internal.JForEach;
import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.model.CElementInfo;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
index cad3f700def..77a63b152d7 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
@@ -33,7 +33,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.codemodel.internal.JConditional;
import com.sun.codemodel.internal.JExpr;
import com.sun.codemodel.internal.JExpression;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldOutline;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.model.CElementInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
index 444a5576175..a9182ec74ae 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
@@ -36,7 +36,7 @@ import com.sun.tools.internal.xjc.generator.annotation.spec.XmlJavaTypeAdapterWr
import com.sun.tools.internal.xjc.model.CAdapter;
import com.sun.tools.internal.xjc.model.TypeUse;
import com.sun.tools.internal.xjc.model.nav.NType;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
index a8082b3eb35..6b383810edd 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
@@ -25,7 +25,7 @@
package com.sun.tools.internal.xjc.generator.bean;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import java.io.Serializable;
import java.net.URL;
@@ -90,7 +90,7 @@ import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.model.CClassRef;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.ClassOutline;
import com.sun.tools.internal.xjc.outline.EnumConstantOutline;
import com.sun.tools.internal.xjc.outline.EnumOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
index c0ed6134d6a..8d71f17ad36 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
@@ -39,7 +39,7 @@ import com.sun.codemodel.internal.JMethod;
import com.sun.codemodel.internal.JMod;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.CElementInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.ElementOutline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
index 5e3a32d0876..9a9a559831a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
@@ -42,7 +42,7 @@ import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.annotation.spec.XmlAccessorTypeWriter;
import com.sun.tools.internal.xjc.model.CClassInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
index 71d6a5d551a..6ed5b8327bb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
@@ -51,7 +51,7 @@ import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.Constructor;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
import com.sun.xml.internal.bind.v2.TODO;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
index 04d024c3b87..5ffc3e31150 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
@@ -49,7 +49,7 @@ import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.outline.PackageOutline;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
/**
* {@link PackageOutline} enhanced with schema2java specific
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
index b43bd348af9..0d28eb4cc23 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
@@ -32,7 +32,7 @@ import com.sun.codemodel.internal.JPackage;
import com.sun.codemodel.internal.fmt.JPropertyFile;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.runtime.JAXBContextFactory;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
index 31afd1df0ee..f0105e59806 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
@@ -28,7 +28,7 @@ package com.sun.tools.internal.xjc.generator.bean;
import com.sun.codemodel.internal.JPackage;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
/**
* Generates public ObjectFactory.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
index 79a7c2084d3..318fa4271d9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
@@ -63,8 +63,8 @@ import com.sun.tools.internal.xjc.model.CTypeInfo;
import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
import com.sun.tools.internal.xjc.model.nav.NClass;
-import com.sun.tools.internal.xjc.model.Aspect;
-import static com.sun.tools.internal.xjc.model.Aspect.IMPLEMENTATION;
+import com.sun.tools.internal.xjc.outline.Aspect;
+import static com.sun.tools.internal.xjc.outline.Aspect.IMPLEMENTATION;
import com.sun.tools.internal.xjc.outline.ClassOutline;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
index 0535385cefe..331ca3ed8c2 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
@@ -38,7 +38,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import java.io.Serializable;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
index b1fe84d32de..28c061fe9e9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
@@ -40,7 +40,7 @@ import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CElement;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import java.io.Serializable;
import java.util.Set;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
index d1d60072d9e..97eaabdb59c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
@@ -35,7 +35,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.xml.internal.bind.api.impl.NameConverter;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
index fb5ce6a5f5c..b4f90f58249 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
@@ -34,6 +34,7 @@ import com.sun.tools.internal.xjc.model.nav.EagerNClass;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.Adapter;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
index 2fc179cf2da..d1d3c142a63 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
@@ -28,6 +28,7 @@ package com.sun.tools.internal.xjc.model;
import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
index d4f50da7f3c..48ee3c7b1b3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
@@ -49,6 +49,7 @@ import com.sun.codemodel.internal.JExpr;
import com.sun.codemodel.internal.JExpression;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
import com.sun.xml.internal.bind.v2.model.core.Element;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
index c74ee55c578..9dcb52738da 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
@@ -45,6 +45,7 @@ import com.sun.istack.internal.Nullable;
import com.sun.tools.internal.xjc.Language;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.Ring;
import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
index f546e28ce2e..9e22dfd60b3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
@@ -30,6 +30,7 @@ import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JClass;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIClass;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIEnum;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
index 6a7419bdddd..8526bfaff7b 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
@@ -43,6 +43,7 @@ import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMo
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIInlineBinaryData;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIFactoryMethod;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
index 2914606bc84..463f8d3df26 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
@@ -34,6 +34,7 @@ import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JExpression;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.EnumLeafInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
index d5c64a83679..d7bbf3b38e5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model;
import java.util.Collection;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.Set;
import java.util.Map;
@@ -60,7 +60,7 @@ public final class CReferencePropertyInfo extends CPropertyInfo implements Refer
/**
* List of referenced elements.
*/
- private final Set elements = new HashSet();
+ private final Set elements = new LinkedHashSet();
private final boolean isMixed;
private WildcardMode wildcard;
@@ -87,7 +87,7 @@ public final class CReferencePropertyInfo extends CPropertyInfo implements Refer
// so the Java types of the substitution members need to be taken into account
// when computing the signature
- final class RefList extends HashSet {
+ final class RefList extends LinkedHashSet {
RefList() {
super(elements.size());
addAll(elements);
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
index a987439c694..53fec35534c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
@@ -29,6 +29,7 @@ import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
@@ -44,7 +45,7 @@ public interface CTypeInfo extends TypeInfo, CCustomizable {
* Returns the {@link JClass} that represents the class being bound,
* under the given {@link Outline}.
*
- * @see NType#toType(Outline, Aspect)
+ * @see NType#toType(Outline, com.sun.tools.internal.xjc.outline.Aspect)
*/
JType toType(Outline o, Aspect aspect);
}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
index 58506956982..8da2c69a2cf 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
@@ -29,6 +29,7 @@ import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.WildcardTypeInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
index 2fadd1cfea5..979269f345a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
@@ -30,7 +30,7 @@ import java.util.HashSet;
import java.util.Set;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
index dbb598c0db4..fc7f2058fd3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
@@ -28,7 +28,7 @@ package com.sun.tools.internal.xjc.model.nav;
import java.lang.reflect.Type;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
index 3499949bdb2..9a48f0f08ce 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
index 558f15740ea..61b82533b67 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
index b7a2c9a647d..1747c735b92 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
index 4e30ccf7c38..e95c2084386 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
similarity index 91%
rename from jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
rename to jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
index 7d825b60844..f8fa0b13355 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -23,7 +23,7 @@
* questions.
*/
-package com.sun.tools.internal.xjc.model;
+package com.sun.tools.internal.xjc.outline;
import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
@@ -35,6 +35,8 @@ import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
* This is an enumeration of all possible aspects.
*
* @author Kohsuke Kawaguchi
+ *
+ * TODO: move this to the model package. We cannot do this before JAXB3 because of old plugins
*/
public enum Aspect {
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
index 49a8b911e93..d49f2c0ba04 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
@@ -33,7 +33,6 @@ import com.sun.codemodel.internal.JCodeModel;
import com.sun.codemodel.internal.JPackage;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.ErrorReceiver;
-import com.sun.tools.internal.xjc.model.Aspect;
import com.sun.tools.internal.xjc.model.CClassInfo;
import com.sun.tools.internal.xjc.model.CClassInfoParent;
import com.sun.tools.internal.xjc.model.CElementInfo;
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
index 1ae4b3cd94f..b18bbc710b0 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 4977aaab0a3..728bca6d5e6 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -292,3 +292,4 @@ efedac7f44ed41cea2b1038138047271f55aacba jdk9-b46
b641c14730ac05d9ec8b4f66e6fca3dc21adb403 jdk9-b47
ebb2eb7f1aec78eb6d8cc4c96f018afa11093cde jdk9-b48
541a8cef4e0d54c3e4b52a98c6af3c31e2096669 jdk9-b49
+f6b8edd397ee463be208fee27517c99101293267 jdk9-b50
diff --git a/jdk/make/Tools.gmk b/jdk/make/Tools.gmk
index 32174efec0c..0165341c491 100644
--- a/jdk/make/Tools.gmk
+++ b/jdk/make/Tools.gmk
@@ -147,6 +147,15 @@ $(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \
EXCLUDES := jdk/internal/jimage/concurrent, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
+# Because of the explicit INCLUDES in the compilation setup above, the service provider
+# file will not be copied unless META-INF/services would also be added to the INCLUDES.
+# Adding META-INF/services would include all files in that directory when only the one
+# is needed, which is why this explicit copy is defined instead.
+$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
+ SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+ DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
+ FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
+
##########################################################################################
# Tools needed on solaris because OBJCOPY is broken.
@@ -173,7 +182,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
PROGRAM := fix_empty_sec_hdr_flags))
endif
-$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE)
+$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
java-tools: $(BUILD_TOOLS_JDK)
diff --git a/jdk/make/data/charsetmapping/DoubleByte-X.java.template b/jdk/make/data/charsetmapping/DoubleByte-X.java.template
index 17476e0bff1..4ef582c9317 100644
--- a/jdk/make/data/charsetmapping/DoubleByte-X.java.template
+++ b/jdk/make/data/charsetmapping/DoubleByte-X.java.template
@@ -32,7 +32,8 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.ext.DoubleByte;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
public class $NAME_CLZ$ extends Charset
$IMPLEMENTS$
diff --git a/jdk/make/data/charsetmapping/charsets b/jdk/make/data/charsetmapping/charsets
new file mode 100644
index 00000000000..682a14ca46c
--- /dev/null
+++ b/jdk/make/data/charsetmapping/charsets
@@ -0,0 +1,1818 @@
+#
+# 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
+# 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.
+#
+
+########################################################
+#
+# Standard charsets provided by StandardCharsets provider.
+#
+# Note that these "standard" charsets listed here are not
+# necessary to be the "Standard charsets" defined in the
+# specification of java.nio.charset.Charset. Instead these
+# are the charsets that this implementation believes should
+# be packaged into the charsets provider class "StandardCharsets"
+# which is initialized at startup time by java.nio.charset.Charset,
+# compared to the charsets packaged in "ExtendedCharsets" provider,
+# which is lazy initialized.
+########################################################
+
+charset US-ASCII US_ASCII
+ package sun.nio.cs
+ type source
+ alias iso-ir-6 # IANA aliases
+ alias ANSI_X3.4-1986
+ alias ISO_646.irv:1991
+ alias ASCII
+ alias ISO646-US
+ alias us
+ alias IBM367
+ alias cp367
+ alias csASCII
+ alias default
+ # Other aliases
+ alias 646 # Solaris POSIX locale
+ alias iso_646.irv:1983
+ alias ANSI_X3.4-1968 # Linux POSIX locale (RedHat)
+ alias ascii7
+
+charset UTF-8 UTF_8
+ package sun.nio.cs
+ type source
+ alias UTF8 # JDK historical
+ alias unicode-1-1-utf-8
+
+charset CESU-8 CESU_8
+ package sun.nio.cs
+ type source
+ alias CESU8
+ alias csCESU-8
+
+charset UTF-16 UTF_16
+ package sun.nio.cs
+ type source
+ alias UTF_16 # JDK historical
+ alias utf16
+ alias unicode
+ alias UnicodeBig
+
+charset UTF-16BE UTF_16BE
+ package sun.nio.cs
+ type source
+ alias UTF_16BE
+ alias ISO-10646-UCS-2
+ alias X-UTF-16BE
+ alias UnicodeBigUnmarked
+
+charset UTF-16LE UTF_16LE
+ package sun.nio.cs
+ type source
+ alias UTF_16LE
+ alias X-UTF-16LE
+ alias UnicodeLittleUnmarked
+
+charset x-UTF-16LE-BOM UTF_16LE_BOM
+ package sun.nio.cs
+ type source
+ alias UnicodeLittle
+
+charset UTF-32 UTF_32
+ package sun.nio.cs
+ type source
+ alias UTF_32
+ alias UTF32
+
+charset UTF-32LE UTF_32LE
+ package sun.nio.cs
+ type source
+ alias UTF_32LE
+ alias X-UTF-32LE
+
+charset UTF-32BE UTF_32BE
+ package sun.nio.cs
+ type source
+ alias UTF_32BE
+ alias X-UTF-32BE
+
+charset X-UTF-32LE-BOM UTF_32LE_BOM
+ package sun.nio.cs
+ type source
+ alias UTF_32LE_BOM
+ alias UTF-32LE-BOM
+
+charset X-UTF-32BE-BOM UTF_32BE_BOM
+ package sun.nio.cs
+ type source
+ alias UTF_32BE_BOM
+ alias UTF-32BE-BOM
+
+charset ISO-8859-1 ISO_8859_1
+ package sun.nio.cs
+ type source
+ alias iso-ir-100 # IANA aliases
+ alias ISO_8859-1
+ alias latin1
+ alias l1
+ alias IBM819
+ alias cp819
+ alias csISOLatin1
+ alias 819 # Other aliases
+ alias IBM-819
+ alias ISO8859_1
+ alias ISO_8859-1:1987
+ alias ISO_8859_1
+ alias 8859_1
+ alias ISO8859-1
+
+charset ISO-8859-2 ISO_8859_2
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_2
+ ascii true
+ alias iso8859_2 # JDK historical
+ alias 8859_2
+ alias iso-ir-101
+ alias ISO_8859-2
+ alias ISO_8859-2:1987
+ alias ISO8859-2
+ alias latin2
+ alias l2
+ alias ibm912
+ alias ibm-912
+ alias cp912
+ alias 912
+ alias csISOLatin2
+
+charset ISO-8859-4 ISO_8859_4
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_4
+ ascii true
+ alias iso8859_4 # JDK historical
+ alias iso8859-4
+ alias 8859_4
+ alias iso-ir-110
+ alias ISO_8859-4
+ alias ISO_8859-4:1988
+ alias latin4
+ alias l4
+ alias ibm914
+ alias ibm-914
+ alias cp914
+ alias 914
+ alias csISOLatin4
+
+charset ISO-8859-5 ISO_8859_5
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_5
+ ascii true
+ alias iso8859_5 # JDK historical
+ alias 8859_5
+ alias iso-ir-144
+ alias ISO_8859-5
+ alias ISO_8859-5:1988
+ alias ISO8859-5
+ alias cyrillic
+ alias ibm915
+ alias ibm-915
+ alias cp915
+ alias 915
+ alias csISOLatinCyrillic
+
+charset ISO-8859-7 ISO_8859_7
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_7
+ ascii true
+ alias iso8859_7 # JDK historical
+ alias 8859_7
+ alias iso-ir-126
+ alias ISO_8859-7
+ alias ISO_8859-7:1987
+ alias ELOT_928
+ alias ECMA-118
+ alias greek
+ alias greek8
+ alias csISOLatinGreek
+ alias sun_eu_greek # Solaris 7/8 compatibility
+ alias ibm813
+ alias ibm-813
+ alias 813
+ alias cp813
+ alias iso8859-7 # Solaris 9 compatibility
+
+charset ISO-8859-9 ISO_8859_9
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_9
+ ascii true
+ alias iso8859_9 # JDK historical
+ alias 8859_9
+ alias iso-ir-148
+ alias ISO_8859-9
+ alias ISO_8859-9:1989
+ alias ISO8859-9
+ alias latin5
+ alias l5
+ alias ibm920
+ alias ibm-920
+ alias 920
+ alias cp920
+ alias csISOLatin5
+
+charset ISO-8859-13 ISO_8859_13
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_13
+ ascii true
+ alias iso8859_13 # JDK historical
+ alias 8859_13
+ alias iso_8859-13
+ alias ISO8859-13
+
+charset ISO-8859-15 ISO_8859_15
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_15
+ ascii true
+ alias ISO_8859-15 # IANA alias
+ alias 8859_15 # Other aliases
+ alias ISO-8859-15
+ alias ISO8859_15
+ alias ISO8859-15
+ alias IBM923
+ alias IBM-923
+ alias cp923
+ alias 923
+ alias LATIN0
+ alias LATIN9
+ alias L9
+ alias csISOlatin0
+ alias csISOlatin9
+ alias ISO8859_15_FDIS
+
+charset KOI8-R KOI8_R
+ package sun.nio.cs
+ type sbcs
+ hisname KOI8_R
+ ascii true
+ alias koi8_r # JDK historical
+ alias koi8
+ alias cskoi8r
+
+charset KOI8-U KOI8_U
+ package sun.nio.cs
+ type sbcs
+ hisname KOI8_U
+ ascii true
+ alias koi8_u
+
+charset windows-1250 MS1250
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1250
+ ascii true
+ alias cp1250 # JDK historical
+ alias cp5346 # Euro IBM CCSID
+
+charset windows-1251 MS1251
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1251
+ ascii true
+ alias cp1251 # JDK historical
+ alias cp5347 # Euro IBM CCSID
+ alias ansi-1251 # Solaris compatibility
+
+charset windows-1252 MS1252
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1252
+ ascii true
+ alias cp1252 # JDK historical
+ alias cp5348 # Euro IBM CCSID
+
+charset windows-1253 MS1253
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1253
+ ascii true
+ alias cp1253 # JDK historical
+ alias cp5349 # Euro IBM CCSID
+
+charset windows-1254 MS1254
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1254
+ ascii true
+ alias cp1254 # JDK historical
+ alias cp5350 # Euro IBM CCSID
+
+charset windows-1257 MS1257
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1257
+ ascii true
+ alias cp1257 # JDK historical
+ alias cp5353 # Euro IBM CCSID
+
+
+charset IBM437 IBM437
+ package sun.nio.cs
+ type sbcs
+ hisname Cp437
+ ascii false
+ alias cp437 #JDK historical
+ alias ibm437
+ alias ibm-437
+ alias 437
+ alias cspc8codepage437
+ alias windows-437
+
+charset x-IBM737 IBM737
+ package sun.nio.cs
+ type sbcs
+ hisname Cp737
+ ascii false
+ alias cp737 #JDK historical
+ alias ibm737
+ alias ibm-737
+ alias 737
+
+charset IBM775 IBM775
+ package sun.nio.cs
+ type sbcs
+ hisname Cp775
+ ascii false
+ alias cp775 #JDK historical
+ alias ibm775
+ alias ibm-775
+ alias 775
+
+charset IBM850 IBM850
+ package sun.nio.cs
+ type sbcs
+ hisname Cp850
+ ascii false
+ alias cp850 #JDK historical
+ alias ibm-850
+ alias ibm850
+ alias 850
+ alias cspc850multilingual
+
+charset IBM852 IBM852
+ package sun.nio.cs
+ type sbcs
+ hisname Cp852
+ ascii false
+ alias cp852 #JDK historical
+ alias ibm852
+ alias ibm-852
+ alias 852
+ alias csPCp852
+
+charset IBM855 IBM855
+ package sun.nio.cs
+ type sbcs
+ hisname Cp855
+ ascii false
+ alias cp855 #JDK historical
+ alias ibm-855
+ alias ibm855
+ alias 855
+ alias cspcp855
+
+charset IBM857 IBM857
+ package sun.nio.cs
+ type sbcs
+ hisname Cp857
+ ascii false
+ alias cp857 #JDK historical
+ alias ibm857
+ alias ibm-857
+ alias 857
+ alias csIBM857
+
+charset IBM00858 IBM858
+ package sun.nio.cs
+ type sbcs
+ hisname Cp858
+ ascii false
+ alias cp858 #JDK historical
+ alias ccsid00858
+ alias cp00858
+ alias 858
+ alias PC-Multilingual-850+euro
+
+charset IBM862 IBM862
+ package sun.nio.cs
+ type sbcs
+ hisname Cp862
+ ascii false
+ alias cp862 #JDK historical
+ alias ibm862
+ alias ibm-862
+ alias 862
+ alias csIBM862
+ alias cspc862latinhebrew
+
+charset IBM866 IBM866
+ package sun.nio.cs
+ type sbcs
+ hisname Cp866
+ ascii false
+ alias cp866 #JDK historical
+ alias ibm866
+ alias ibm-866
+ alias 866
+ alias csIBM866
+
+charset x-IBM874 IBM874
+ package sun.nio.cs
+ type sbcs
+ hisname Cp874
+ ascii false
+ alias cp874 #JDK historical
+ alias ibm874
+ alias ibm-874
+ alias 874
+
+########################################################
+#
+# charsets provided by ExtendedCharsets provider.
+#
+########################################################
+charset Big5 Big5
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Big5
+ ascii true
+ minmax 0xa1 0xf9 0x40 0xfe
+ alias csBig5 # IANA aliases
+
+charset x-MS950-HKSCS-XP MS950_HKSCS_XP
+ package sun.nio.cs.ext
+ type template
+ alias MS950_HKSCS_XP # JDK historical;
+
+charset x-MS950-HKSCS MS950_HKSCS
+ package sun.nio.cs.ext
+ type source
+ hisname MS950_HKSCS
+ ascii true
+ alias MS950_HKSCS # JDK historical;
+
+charset x-windows-950 MS950
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS950
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias ms950 # JDK historical
+ alias windows-950
+
+charset x-windows-874 MS874
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MS874
+ ascii true
+ alias ms874 # JDK historical
+ alias ms-874
+ alias windows-874
+
+charset x-EUC-TW EUC_TW
+ package sun.nio.cs.ext
+ type source
+ alias euc_tw # JDK historical
+ alias euctw
+ alias cns11643
+ alias EUC-TW
+
+charset Big5-HKSCS Big5_HKSCS
+ package sun.nio.cs.ext
+ type template
+ hisname Big5_HKSCS
+ ascii true
+ alias Big5_HKSCS # JDK historical
+ alias big5hk
+ alias big5-hkscs
+ alias big5hkscs # Linux alias
+
+charset x-Big5-HKSCS-2001 Big5_HKSCS_2001
+ package sun.nio.cs.ext
+ type source
+ alias Big5_HKSCS_2001
+ alias big5hk-2001
+ alias big5-hkscs-2001
+ alias big5-hkscs:unicode3.0
+ alias big5hkscs-2001
+
+charset x-Big5-Solaris Big5_Solaris
+ package sun.nio.cs.ext
+ type template
+ hisname Big5_Solaris
+ ascii true
+ alias Big5_Solaris # JDK historical
+
+
+charset GBK GBK # Simplified Chinese
+ package sun.nio.cs.ext
+ type dbcs
+ hisname GBK
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias windows-936
+ alias CP936
+
+charset GB18030 GB18030
+ package sun.nio.cs.ext
+ type source
+ alias gb18030-2000
+
+charset GB2312 EUC_CN
+ package sun.nio.cs.ext
+ type dbcs
+ hisname EUC_CN
+ ascii true
+ minmax 0xa1 0xf7 0xa1 0xfe
+ # IANA aliases
+ alias gb2312
+ alias gb2312-80
+ alias gb2312-1980
+ alias euc-cn
+ alias euccn
+ alias x-EUC-CN # 1.4 compatibility
+ alias EUC_CN # JDK historical
+
+charset x-mswin-936 MS936
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS936
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias ms936 # JDK historical
+ alias ms_936 // IANA aliases
+
+# The definition of this charset may be overridden by the init method,
+# below, if the sun.nio.cs.map property is defined.
+#
+charset Shift_JIS SJIS
+ package sun.nio.cs.ext
+ type dbcs
+ hisname SJIS
+ ascii true
+ minmax 0x81 0xfc 0x40 0xfc
+ # IANA aliases
+ alias sjis # historical
+ alias shift_jis
+ alias shift-jis
+ alias ms_kanji
+ alias x-sjis
+ alias csShiftJIS
+
+# The definition of this charset may be overridden by the init method,
+# below, if the sun.nio.cs.map property is defined.
+charset windows-31j MS932
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS932
+ ascii true
+ minmax 0x81 0xfc 0x40 0xfc
+ alias MS932 # JDK historical
+ alias windows-932
+ alias csWindows31J
+
+charset JIS_X0201 JIS_X_0201
+ package sun.nio.cs.ext
+ type sbcs
+ hisname JIS_X0201
+ ascii true
+ alias JIS0201 # JDK historical
+ # IANA aliases
+ alias JIS_X0201
+ alias X0201
+ alias csHalfWidthKatakana
+
+charset x-JIS0208 JIS_X_0208
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS0208
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ alias JIS0208 # JDK historical
+ # IANA aliases
+ alias JIS_C6226-1983
+ alias iso-ir-87
+ alias x0208
+ alias JIS_X0208-1983
+ alias csISO87JISX0208
+
+charset JIS_X0212-1990 JIS_X_0212
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS0212
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ alias JIS0212 # JDK historical
+ # IANA aliases
+ alias jis_x0212-1990
+ alias x0212
+ alias iso-ir-159
+ alias csISO159JISX02121990
+
+charset x-SJIS_0213 SJIS_0213
+ package sun.nio.cs.ext
+ type source
+ alias sjis-0213
+ alias sjis_0213
+ alias sjis:2004
+ alias sjis_0213:2004
+ alias shift_jis_0213:2004
+ alias shift_jis:2004
+
+charset x-MS932_0213 MS932_0213
+ package sun.nio.cs.ext
+ type source
+ alias MS932-0213
+ alias MS932_0213
+ alias MS932:2004
+ alias windows-932-0213
+ alias windows-932:2004
+
+charset EUC-JP EUC_JP
+ package sun.nio.cs.ext
+ type template
+ hisname EUC_JP
+ ascii true
+ alias euc_jp # JDK historical
+ alias eucjis # IANA aliases
+ alias eucjp
+ alias Extended_UNIX_Code_Packed_Format_for_Japanese
+ alias csEUCPkdFmtjapanese
+ alias x-euc-jp
+ alias x-eucjp
+
+charset x-euc-jp-linux EUC_JP_LINUX
+ package sun.nio.cs.ext
+ type template
+ hisname EUC_JP_LINUX
+ ascii true
+ alias euc_jp_linux # JDK historical
+ alias euc-jp-linux
+
+charset x-eucjp-open EUC_JP_Open
+ package sun.nio.cs.ext
+ type template
+ hisname EUC_JP_Solari
+ ascii true
+ alias EUC_JP_Solaris # JDK historical
+ alias eucJP-open
+
+charset x-PCK PCK
+ package sun.nio.cs.ext
+ type dbcs
+ hisname PCK
+ ascii true
+ minmax 0x81 0xfc 0x40 0xfc
+ # IANA aliases
+ alias pck # JDK historical
+
+charset ISO-2022-JP ISO2022_JP
+ package sun.nio.cs.ext
+ type source
+ # IANA aliases
+ alias iso2022jp # JDK historical
+ alias jis
+ alias csISO2022JP
+ alias jis_encoding
+ alias csjisencoding
+
+charset ISO-2022-JP-2 ISO2022_JP_2
+ package sun.nio.cs.ext
+ type source
+ # IANA aliases
+ alias csISO2022JP2
+ alias iso2022jp2
+
+charset x-windows-50221 MS50221
+ package sun.nio.cs.ext
+ type source
+ alias ms50221 # JDK historical
+ alias cp50221
+
+charset x-windows-50220 MS50220
+ package sun.nio.cs.ext
+ type source
+ alias ms50220 # JDK historical
+ alias cp50220
+
+charset x-windows-iso2022jp MSISO2022JP
+ package sun.nio.cs.ext
+ type source
+ alias windows-iso2022jp # JDK historical
+
+charset x-JISAutoDetect JISAutoDetect
+ package sun.nio.cs.ext
+ type source
+ alias JISAutoDetect # JDK historical
+
+
+charset EUC-KR EUC_KR # Korean
+ package sun.nio.cs.ext
+ type dbcs
+ hisname EUC_KR
+ ascii true
+ minmax 0xa1 0xfd 0xa1 0xfe
+ alias euc_kr # JDK historical
+ # IANA aliases
+ alias ksc5601
+ alias euckr
+ alias ks_c_5601-1987
+ alias ksc5601-1987
+ alias ksc5601_1987
+ alias ksc_5601
+ alias csEUCKR
+ alias 5601
+
+charset x-windows-949 MS949
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS949
+ ascii true
+ minmax 0x81 0xfe 0x41 0xfe
+ alias ms949 # JDK historical
+ alias windows949
+ alias windows-949
+ alias ms_949 # IANA aliases
+
+charset x-Johab Johab
+ package sun.nio.cs.ext
+ type dbcs
+ hisname x-Johab
+ ascii true
+ minmax 0x84 0xf9 0x31 0xfe
+ alias ksc5601-1992
+ alias ksc5601_1992
+ alias ms1361
+ alias johab # JDK historical
+
+charset ISO-2022-KR ISO2022_KR
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022KR # JDK historical
+ alias csISO2022KR
+
+charset ISO-2022-CN ISO2022_CN
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022CN # JDK historical
+ alias csISO2022CN
+
+charset x-ISO-2022-CN-CNS ISO2022_CN_CNS
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022CN_CNS # JDK historical
+ alias ISO-2022-CN-CNS
+
+charset x-ISO-2022-CN-GB ISO2022_CN_GB
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022CN_GB # JDK historical
+ alias ISO-2022-CN-GB
+
+charset x-ISCII91 ISCII91
+ package sun.nio.cs.ext
+ type source
+ alias iscii
+ alias ST_SEV_358-88
+ alias iso-ir-153
+ alias csISO153GOST1976874
+ alias ISCII91 # JDK historical
+
+charset ISO-8859-3 ISO_8859_3
+ package sun.nio.cs.ext
+ type sbcs
+ hisname ISO8859_3
+ ascii true
+ alias iso8859_3 # JDK historical
+ alias 8859_3
+ alias ISO_8859-3:1988
+ alias iso-ir-109
+ alias ISO_8859-3
+ alias ISO8859-3
+ alias latin3
+ alias l3
+ alias ibm913
+ alias ibm-913
+ alias cp913
+ alias 913
+ alias csISOLatin3
+
+charset ISO-8859-6 ISO_8859_6
+ package sun.nio.cs.ext
+ type sbcs
+ hisname ISO8859_6
+ ascii true
+ alias iso8859_6 # JDK historical
+ alias 8859_6
+ alias iso-ir-127
+ alias ISO_8859-6
+ alias ISO_8859-6:1987
+ alias ISO8859-6
+ alias ECMA-114
+ alias ASMO-708
+ alias arabic
+ alias ibm1089
+ alias ibm-1089
+ alias cp1089
+ alias 1089
+ alias csISOLatinArabic
+
+charset ISO-8859-8 ISO_8859_8
+ package sun.nio.cs.ext
+ type sbcs
+ hisname ISO8859_8
+ ascii true
+ alias iso8859_8 # JDK historical
+ alias 8859_8
+ alias iso-ir-138
+ alias ISO_8859-8
+ alias ISO_8859-8:1988
+ alias ISO8859-8
+ alias cp916
+ alias 916
+ alias ibm916
+ alias ibm-916
+ alias hebrew
+ alias csISOLatinHebrew
+
+charset x-iso-8859-11 ISO_8859_11
+ package sun.nio.cs.ext
+ type sbcs
+ hisname x-iso-8859-11
+ ascii true
+ alias iso-8859-11
+ alias iso8859_11
+
+charset TIS-620 TIS_620
+ package sun.nio.cs.ext
+ type sbcs
+ hisname TIS620
+ ascii true
+ alias tis620 # JDK historical
+ alias tis620.2533
+
+# Microsoft Windows codepages
+
+charset windows-1255 MS1255
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1255
+ ascii true
+ alias cp1255 # JDK historical
+
+charset windows-1256 MS1256
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1256
+ ascii true
+ alias cp1256 # JDK historical
+
+charset windows-1258 MS1258
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1258
+ ascii true
+ alias cp1258 # JDK historical
+
+charset x-IBM942 IBM942 # IBM & PC/MSDOS encodings
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp942
+ ascii false
+ minmax 0x81 0xfc 0x40 0xfc
+ alias cp942 # JDK historical
+ alias ibm942
+ alias ibm-942
+ alias 942
+
+charset x-IBM942C IBM942C
+ package sun.nio.cs.ext
+ type source
+ alias cp942C # JDK historical
+ alias ibm942C
+ alias ibm-942C
+ alias 942C
+
+charset x-IBM943 IBM943
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp943
+ ascii false
+ minmax 0x81 0xfc 0x40 0xfc
+ alias cp943 # JDK historical
+ alias ibm943
+ alias ibm-943
+ alias 943
+
+charset x-IBM943C IBM943C
+ package sun.nio.cs.ext
+ type source
+ alias cp943C # JDK historical
+ alias ibm943C
+ alias ibm-943C
+ alias 943C
+
+charset x-IBM948 IBM948
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp948
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfc
+ alias cp948 # JDK historical
+ alias ibm948
+ alias ibm-948
+ alias 948
+
+charset x-IBM950 IBM950
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp950
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias cp950 # JDK historical
+ alias ibm950
+ alias ibm-950
+ alias 950
+
+charset x-IBM930 IBM930
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp930
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp930 # JDK historical
+ alias ibm930
+ alias ibm-930
+ alias 930
+
+charset x-IBM935 IBM935
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp935
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp935 # JDK historical
+ alias ibm935
+ alias ibm-935
+ alias 935
+
+charset x-IBM937 IBM937
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp937
+ ascii false
+ minmax 0x40 0xe2 0x40 0xfe
+ alias cp937 # JDK historical
+ alias ibm937
+ alias ibm-937
+ alias 937
+
+charset x-IBM856 IBM856
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp856
+ ascii false
+ alias cp856 # JDK historical
+ alias ibm-856
+ alias ibm856
+ alias 856
+
+charset IBM860 IBM860
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp860
+ ascii false
+ alias cp860 # JDK historical
+ alias ibm860
+ alias ibm-860
+ alias 860
+ alias csIBM860
+
+charset IBM861 IBM861
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp861
+ ascii false
+ alias cp861 # JDK historical
+ alias ibm861
+ alias ibm-861
+ alias 861
+ alias csIBM861
+ alias cp-is
+
+charset IBM863 IBM863
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp863
+ ascii false
+ alias cp863 # JDK historical
+ alias ibm863
+ alias ibm-863
+ alias 863
+ alias csIBM863
+
+charset IBM864 IBM864
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp864
+ ascii false
+ alias cp864 # JDK historical
+ alias ibm864
+ alias ibm-864
+ alias 864
+ alias csIBM864
+
+
+charset IBM865 IBM865
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp865
+ ascii false
+ alias cp865 # JDK historical
+ alias ibm865
+ alias ibm-865
+ alias 865
+ alias csIBM865
+
+charset IBM868 IBM868
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp868
+ ascii false
+ alias cp868 # JDK historical
+ alias ibm868
+ alias ibm-868
+ alias 868
+ alias cp-ar
+ alias csIBM868
+
+charset IBM869 IBM869
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp869
+ ascii false
+ alias cp869 # JDK historical
+ alias ibm869
+ alias ibm-869
+ alias 869
+ alias cp-gr
+ alias csIBM869
+
+charset x-IBM921 IBM921
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp921
+ ascii false
+ alias cp921 # JDK historical
+ alias ibm921
+ alias ibm-921
+ alias 921
+
+charset x-IBM1006 IBM1006
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1006
+ ascii false
+ alias cp1006 # JDK historical
+ alias ibm1006
+ alias ibm-1006
+ alias 1006
+
+charset x-IBM1046 IBM1046
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1046
+ ascii false
+ alias cp1046 # JDK historical
+ alias ibm1046
+ alias ibm-1046
+ alias 1046
+
+charset IBM1047 IBM1047
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1047
+ ascii false
+ alias cp1047 # JDK historical
+ alias ibm-1047
+ alias 1047
+
+charset x-IBM1098 IBM1098
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1098
+ ascii false
+ alias cp1098 # JDK historical
+ alias ibm1098
+ alias ibm-1098
+ alias 1098
+
+charset IBM037 IBM037
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp037
+ ascii false
+ alias cp037 # JDK historical
+ alias ibm037
+ alias ebcdic-cp-us
+ alias ebcdic-cp-ca
+ alias ebcdic-cp-wt
+ alias ebcdic-cp-nl
+ alias csIBM037
+ alias cs-ebcdic-cp-us
+ alias cs-ebcdic-cp-ca
+ alias cs-ebcdic-cp-wt
+ alias cs-ebcdic-cp-nl
+ alias ibm-037
+ alias ibm-37
+ alias cpibm37
+ alias 037
+
+charset x-IBM1025 IBM1025
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1025
+ ascii false
+ alias cp1025 # JDK historical
+ alias ibm1025
+ alias ibm-1025
+ alias 1025
+
+charset IBM1026 IBM1026
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1026
+ ascii false
+ alias cp1026 # JDK historical
+ alias ibm1026
+ alias ibm-1026
+ alias 1026
+
+charset x-IBM1112 IBM1112
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1112
+ ascii false
+ alias cp1112 # JDK historical
+ alias ibm1112
+ alias ibm-1112
+ alias 1112
+
+charset x-IBM1122 IBM1122
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1122
+ ascii false
+ alias cp1122 # JDK historical
+ alias ibm1122
+ alias ibm-1122
+ alias 1122
+
+charset x-IBM1123 IBM1123
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1123
+ ascii false
+ alias cp1123 # JDK historical
+ alias ibm1123
+ alias ibm-1123
+ alias 1123
+
+charset x-IBM1124 IBM1124
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1124
+ ascii false
+ alias cp1124 # JDK historical
+ alias ibm1124
+ alias ibm-1124
+ alias 1124
+
+charset x-IBM1364 IBM1364
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp1364
+ ascii false
+ minmax 0x40 0xde 0x40 0xfe
+ alias cp1364
+ alias ibm1364
+ alias ibm-1364
+ alias 1364
+
+charset IBM273 IBM273
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp273
+ ascii false
+ alias cp273 # JDK historical
+ alias ibm273
+ alias ibm-273
+ alias 273
+
+charset IBM277 IBM277
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp277
+ ascii false
+ alias cp277 # JDK historical
+ alias ibm277
+ alias ibm-277
+ alias 277
+
+charset IBM278 IBM278
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp278
+ ascii false
+ alias cp278 # JDK historical
+ alias ibm278
+ alias ibm-278
+ alias 278
+ alias ebcdic-sv
+ alias ebcdic-cp-se
+ alias csIBM278
+
+charset IBM280 IBM280
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp280
+ ascii false
+ alias cp280 # JDK historical
+ alias ibm280
+ alias ibm-280
+ alias 280
+
+charset IBM284 IBM284
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp284
+ ascii false
+ alias cp284 # JDK historical
+ alias ibm284
+ alias ibm-284
+ alias 284
+ alias csIBM284
+ alias cpibm284
+
+charset IBM285 IBM285
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp285
+ ascii false
+ alias cp285 # JDK historical
+ alias ibm285
+ alias ibm-285
+ alias 285
+ alias ebcdic-cp-gb
+ alias ebcdic-gb
+ alias csIBM285
+ alias cpibm285
+
+charset IBM297 IBM297
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp297
+ ascii false
+ alias cp297 # JDK historical
+ alias ibm297
+ alias ibm-297
+ alias 297
+ alias ebcdic-cp-fr
+ alias cpibm297
+ alias csIBM297
+
+charset IBM420 IBM420
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp420
+ ascii false
+ alias cp420 # JDK historical
+ alias ibm420
+ alias ibm-420
+ alias ebcdic-cp-ar1
+ alias 420
+ alias csIBM420
+
+charset IBM424 IBM424
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp424
+ ascii false
+ alias cp424 # JDK historical
+ alias ibm424
+ alias ibm-424
+ alias 424
+ alias ebcdic-cp-he
+ alias csIBM424
+
+charset IBM500 IBM500
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp500
+ ascii false
+ alias cp500 # JDK historical
+ alias ibm500
+ alias ibm-500
+ alias 500
+ alias ebcdic-cp-ch
+ alias ebcdic-cp-bh
+ alias csIBM500
+
+charset x-IBM833 IBM833
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp833
+ ascii false
+ alias cp833
+ alias ibm833
+ alias ibm-833
+
+
+charset x-IBM834 IBM834 # EBCDIC DBCS-only Korean
+ package sun.nio.cs.ext
+ type source
+ alias cp834
+ alias ibm834
+ alias 834
+ alias ibm-834
+
+charset IBM-Thai IBM838
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp838
+ ascii false
+ alias cp838 # JDK historical
+ alias ibm838
+ alias ibm-838
+ alias 838
+
+charset IBM870 IBM870
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp870
+ ascii false
+ alias cp870 # JDK historical
+ alias ibm870
+ alias ibm-870
+ alias 870
+ alias ebcdic-cp-roece
+ alias ebcdic-cp-yu
+ alias csIBM870
+
+charset IBM871 IBM871
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp871
+ ascii false
+ alias cp871 # JDK historical
+ alias ibm871
+ alias ibm-871
+ alias 871
+ alias ebcdic-cp-is
+ alias csIBM871
+
+charset x-IBM875 IBM875
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp875
+ ascii false
+ alias cp875 # JDK historical
+ alias ibm875
+ alias ibm-875
+ alias 875
+
+charset IBM918 IBM918
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp918
+ ascii false
+ alias cp918 # JDK historical
+ alias ibm-918
+ alias 918
+ alias ebcdic-cp-ar2
+
+charset x-IBM922 IBM922
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp922
+ ascii false
+ alias cp922 # JDK historical
+ alias ibm922
+ alias ibm-922
+ alias 922
+
+charset x-IBM1097 IBM1097
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1097
+ ascii false
+ alias cp1097 # JDK historical
+ alias ibm1097
+ alias ibm-1097
+ alias 1097
+
+charset x-IBM949 IBM949
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp949
+ ascii false
+ minmax 0x8f 0xfe 0xa1 0xfe
+ alias cp949 # JDK historical
+ alias ibm949
+ alias ibm-949
+ alias 949
+
+charset x-IBM949C IBM949C
+ package sun.nio.cs.ext
+ type source
+ alias cp949C # JDK historical
+ alias ibm949C
+ alias ibm-949C
+ alias 949C
+
+charset x-IBM939 IBM939
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp939
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp939 # JDK historical
+ alias ibm939
+ alias ibm-939
+ alias 939
+
+charset x-IBM933 IBM933
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp933
+ ascii false
+ minmax 0x40 0xdd 0x40 0xfe
+ alias cp933 # JDK historical
+ alias ibm933
+ alias ibm-933
+ alias 933
+
+charset x-IBM1381 IBM1381
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp1381
+ ascii true
+ minmax 0x8c 0xf7 0xa1 0xfe
+ alias cp1381 # JDK historical
+ alias ibm1381
+ alias ibm-1381
+ alias 1381
+
+charset x-IBM1383 IBM1383
+ package sun.nio.cs.ext
+ type euc_sim
+ hisname Cp1383
+ ascii true
+ minmax 0xa1 0xfe 0xa1 0xfe
+ alias cp1383 # JDK historical
+ alias ibm1383
+ alias ibm-1383
+ alias 1383
+
+charset x-IBM970 IBM970
+ package sun.nio.cs.ext
+ type euc_sim
+ hisname Cp970
+ ascii true
+ minmax 0xa1 0xfe 0xa1 0xfe
+ alias cp970 # JDK historical
+ alias ibm970
+ alias ibm-970
+ alias ibm-eucKR
+ alias 970
+
+charset x-IBM964 IBM964
+ package sun.nio.cs.ext
+ type source
+ alias cp964 # JDK historical
+ alias ibm964
+ alias ibm-964
+ alias 964
+
+charset x-IBM33722 IBM33722
+ package sun.nio.cs.ext
+ type source
+ alias cp33722 # JDK historical
+ alias ibm33722
+ alias ibm-33722
+ alias ibm-5050 # from IBM alias list
+ alias ibm-33722_vascii_vpua # from IBM alias list
+ alias 33722
+
+charset IBM01140 IBM1140
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1140
+ ascii false
+ alias cp1140 # JDK historical
+ alias ccsid01140
+ alias cp01140
+ alias 1140
+ alias ebcdic-us-037+euro
+
+charset IBM01141 IBM1141
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1141
+ ascii false
+ alias cp1141 # JDK historical
+ alias ccsid01141
+ alias cp01141
+ alias 1141
+ alias ebcdic-de-273+euro
+
+charset IBM01142 IBM1142
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1142
+ ascii false
+ alias cp1142 # JDK historical
+ alias ccsid01142
+ alias cp01142
+ alias 1142
+ alias ebcdic-no-277+euro
+ alias ebcdic-dk-277+euro
+
+charset IBM01143 IBM1143
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1143
+ ascii false
+ alias cp1143 # JDK historical
+ alias ccsid01143
+ alias cp01143
+ alias 1143
+ alias ebcdic-fi-278+euro
+ alias ebcdic-se-278+euro
+
+charset IBM01144 IBM1144
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1144
+ ascii false
+ alias cp1144 # JDK historical
+ alias ccsid01144
+ alias cp01144
+ alias 1144
+ alias ebcdic-it-280+euro
+
+charset IBM01145 IBM1145
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1145
+ ascii false
+ alias cp1145 # JDK historical
+ alias ccsid01145
+ alias cp01145
+ alias 1145
+ alias ebcdic-es-284+euro
+
+charset IBM01146 IBM1146
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1146
+ ascii false
+ alias cp1146 # JDK historical
+ alias ccsid01146
+ alias cp01146
+ alias 1146
+ alias ebcdic-gb-285+euro
+
+charset IBM01147 IBM1147
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1147
+ ascii false
+ alias cp1147 # JDK historical
+ alias ccsid01147
+ alias cp01147
+ alias 1147
+ alias ebcdic-fr-277+euro
+
+charset IBM01148 IBM1148
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1148
+ ascii false
+ alias cp1148 # JDK historical
+ alias ccsid01148
+ alias cp01148
+ alias 1148
+ alias ebcdic-international-500+euro
+
+charset IBM01149 IBM1149
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1149
+ ascii false
+ alias cp1149 # JDK historical
+ alias ccsid01149
+ alias cp01149
+ alias 1149
+ alias ebcdic-s-871+euro
+
+charset IBM290 IBM290
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp290
+ ascii false
+ alias cp290
+ alias ibm290
+ alias ibm-290
+ alias csIBM290
+ alias EBCDIC-JP-kana
+ alias 290
+
+charset x-IBM300 IBM300
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname Cp300
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp300
+ alias ibm300
+ alias ibm-300
+ alias 300
+
+# Macintosh MacOS/Apple char encodingd
+
+charset x-MacRoman MacRoman
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacRoman
+ ascii false
+ alias MacRoman # JDK historical
+
+charset x-MacCentralEurope MacCentralEurope
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacCentralEurope
+ ascii false
+ alias MacCentralEurope # JDK historical
+
+charset x-MacCroatian MacCroatian
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacCroatian
+ ascii false
+ alias MacCroatian # JDK historical
+
+charset x-MacGreek MacGreek
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacGreek
+ ascii false
+ alias MacGreek # JDK historical
+
+charset x-MacCyrillic MacCyrillic
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacCyrillic
+ ascii false
+ alias MacCyrillic # JDK historical
+
+charset x-MacUkraine MacUkraine
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacUkraine
+ ascii false
+ alias MacUkraine # JDK historical
+
+charset x-MacTurkish MacTurkish
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacTurkish
+ ascii false
+ alias MacTurkish # JDK historical
+
+charset x-MacArabic MacArabic
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacArabic
+ ascii false
+ alias MacArabic # JDK historical
+
+charset x-MacHebrew MacHebrew
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacHebrew
+ ascii false
+ alias MacHebrew # JDK historical
+
+charset x-MacIceland MacIceland
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacIceland
+ ascii false
+ alias MacIceland # JDK historical
+
+charset x-MacRomania MacRomania
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacRomania
+ ascii false
+ alias MacRomania # JDK historical
+
+charset x-MacThai MacThai
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacThai
+ ascii false
+ alias MacThai # JDK historical
+
+charset x-MacSymbol MacSymbol
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacSymbol
+ ascii false
+ alias MacSymbol # JDK historical
+
+charset x-MacDingbat MacDingbat
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacDingbat
+ ascii false
+ alias MacDingbat # JDK historical
+
+########################################################
+#
+# internal use, not to be registered into spi
+#
+########################################################
+
+charset x-JIS0208_Solaris JIS_X_0208_Solaris
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS0208
+ ascii false
+ minmax 0x21 0x9e 0x21 0x7e
+ internal true
+
+charset x-JIS0208_MS5022X JIS_X_0208_MS5022X
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0208_MS5022X
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true
+
+charset x-JIS0208_MS932 JIS_X_0208_MS932
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0208_MS932
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true # "internal implementation
+
+charset x-JIS0212_Solaris JIS_X_0212_Solaris
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0212_Solaris
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true # "internal implementation
+
+charset x-JIS0212_MS5022X JIS_X_0212_MS5022X
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0212_MS5022X
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true # "internal implementation
diff --git a/jdk/make/data/charsetmapping/dbcs b/jdk/make/data/charsetmapping/dbcs
deleted file mode 100644
index a22e886977f..00000000000
--- a/jdk/make/data/charsetmapping/dbcs
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
-#
-Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe
-Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
-EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
-EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
-MS932 windows-31j MS932 basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
-MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
-MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-SJIS Shift_JIS SJIS basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
-PCK x-PCK PCK basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
-IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
-IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
-IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
-IBM300 x-IBM300 Cp300 dbcsonly sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM933 x-IBM933 Cp933 ebcdic sun.nio.cs.ext false 0x40 0xdd 0x40 0xfe
-IBM935 x-IBM935 Cp935 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM937 x-IBM937 Cp937 ebcdic sun.nio.cs.ext false 0x40 0xe2 0x40 0xfe
-IBM939 x-IBM939 Cp939 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM942 x-IBM942 Cp942 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
-IBM943 x-IBM943 Cp943 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
-IBM948 x-IBM948 Cp948 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfc
-IBM949 x-IBM949 Cp949 basic sun.nio.cs.ext false 0x8f 0xfe 0xa1 0xfe
-IBM950 x-IBM950 Cp950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-IBM970 x-IBM970 Cp970 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
-JIS_X_0208 x-JIS0208 JIS0208 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0212 JIS_X0212-1990 JIS0212 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0208_Solaris x-JIS0208_Solaris JIS0208_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x9e 0x21 0x7e
-JIS_X_0208_MS5022X x-JIS0208_MS5022X JIS0208_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0208_MS932 x-JIS0208_MS932 JIS0208_MS932 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0212_Solaris x-JIS0212_Solaris JIS0212_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0212_MS5022X x-JIS0212_MS5022X JIS0212_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
diff --git a/jdk/make/data/charsetmapping/extsbcs b/jdk/make/data/charsetmapping/extsbcs
deleted file mode 100644
index ed82dbe82d9..00000000000
--- a/jdk/make/data/charsetmapping/extsbcs
+++ /dev/null
@@ -1,76 +0,0 @@
-# clzName csName hisName containASCII pkg
-IBM037 IBM037 Cp037 false sun.nio.cs.ext
-IBM1006 x-IBM1006 Cp1006 false sun.nio.cs.ext
-IBM1025 x-IBM1025 Cp1025 false sun.nio.cs.ext
-IBM1026 IBM1026 Cp1026 false sun.nio.cs.ext
-IBM1046 x-IBM1046 Cp1046 false sun.nio.cs.ext
-IBM1047 IBM1047 Cp1047 false sun.nio.cs.ext
-IBM1097 x-IBM1097 Cp1097 false sun.nio.cs.ext
-IBM1098 x-IBM1098 Cp1098 false sun.nio.cs.ext
-IBM1112 x-IBM1112 Cp1112 false sun.nio.cs.ext
-IBM1122 x-IBM1122 Cp1122 false sun.nio.cs.ext
-IBM1123 x-IBM1123 Cp1123 false sun.nio.cs.ext
-IBM1124 x-IBM1124 Cp1124 false sun.nio.cs.ext
-# map tables for 1140-1149 are updated manualy with the u+20ac entry
-IBM1140 IBM01140 Cp1140 false sun.nio.cs.ext
-IBM1141 IBM01141 Cp1141 false sun.nio.cs.ext
-IBM1142 IBM01142 Cp1142 false sun.nio.cs.ext
-IBM1143 IBM01143 Cp1143 false sun.nio.cs.ext
-IBM1144 IBM01144 Cp1144 false sun.nio.cs.ext
-IBM1145 IBM01145 Cp1145 false sun.nio.cs.ext
-IBM1146 IBM01146 Cp1146 false sun.nio.cs.ext
-IBM1147 IBM01147 Cp1147 false sun.nio.cs.ext
-IBM1148 IBM01148 Cp1148 false sun.nio.cs.ext
-IBM1149 IBM01149 Cp1149 false sun.nio.cs.ext
-IBM273 IBM273 Cp273 false sun.nio.cs.ext
-IBM277 IBM277 Cp277 false sun.nio.cs.ext
-IBM278 IBM278 Cp278 false sun.nio.cs.ext
-IBM280 IBM280 Cp280 false sun.nio.cs.ext
-IBM284 IBM284 Cp284 false sun.nio.cs.ext
-IBM285 IBM285 Cp285 false sun.nio.cs.ext
-IBM290 IBM290 Cp290 false sun.nio.cs.ext
-IBM297 IBM297 Cp297 false sun.nio.cs.ext
-IBM420 IBM420 Cp420 false sun.nio.cs.ext
-IBM424 IBM424 Cp424 false sun.nio.cs.ext
-IBM500 IBM500 Cp500 false sun.nio.cs.ext
-IBM833 x-IBM833 Cp833 false sun.nio.cs.ext
-IBM838 IBM-Thai Cp838 false sun.nio.cs.ext
-IBM856 x-IBM856 Cp856 false sun.nio.cs.ext
-IBM860 IBM860 Cp860 false sun.nio.cs.ext
-IBM861 IBM861 Cp861 false sun.nio.cs.ext
-IBM863 IBM863 Cp863 false sun.nio.cs.ext
-IBM864 IBM864 Cp864 false sun.nio.cs.ext
-IBM865 IBM865 Cp865 false sun.nio.cs.ext
-IBM868 IBM868 Cp868 false sun.nio.cs.ext
-IBM869 IBM869 Cp869 false sun.nio.cs.ext
-IBM870 IBM870 Cp870 false sun.nio.cs.ext
-IBM871 IBM871 Cp871 false sun.nio.cs.ext
-IBM875 x-IBM875 Cp875 false sun.nio.cs.ext
-IBM918 IBM918 Cp918 false sun.nio.cs.ext
-IBM921 x-IBM921 Cp921 false sun.nio.cs.ext
-IBM922 x-IBM922 Cp922 false sun.nio.cs.ext
-# use name as hisname as well, cs did not support hisname prevously
-ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext
-ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext
-ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext
-ISO_8859_8 ISO-8859-8 ISO8859_8 true sun.nio.cs.ext
-JIS_X_0201 JIS_X0201 JIS_X0201 true sun.nio.cs.ext
-MS1255 windows-1255 Cp1255 true sun.nio.cs.ext
-MS1256 windows-1256 Cp1256 true sun.nio.cs.ext
-MS1258 windows-1258 Cp1258 true sun.nio.cs.ext
-MS874 x-windows-874 MS874 true sun.nio.cs.ext
-MacArabic x-MacArabic MacArabic false sun.nio.cs.ext
-MacCentralEurope x-MacCentralEurope MacCentralEurope false sun.nio.cs.ext
-MacCroatian x-MacCroatian MacCroatian false sun.nio.cs.ext
-MacCyrillic x-MacCyrillic MacCyrillic false sun.nio.cs.ext
-MacDingbat x-MacDingbat MacDingbat false sun.nio.cs.ext
-MacGreek x-MacGreek MacGreek false sun.nio.cs.ext
-MacHebrew x-MacHebrew MacHebrew false sun.nio.cs.ext
-MacIceland x-MacIceland MacIceland false sun.nio.cs.ext
-MacRoman x-MacRoman MacRoman false sun.nio.cs.ext
-MacRomania x-MacRomania MacRomania false sun.nio.cs.ext
-MacSymbol x-MacSymbol MacSymbol false sun.nio.cs.ext
-MacThai x-MacThai MacThai false sun.nio.cs.ext
-MacTurkish x-MacTurkish MacTurkish false sun.nio.cs.ext
-MacUkraine x-MacUkraine MacUkraine false sun.nio.cs.ext
-TIS_620 TIS-620 TIS620 true sun.nio.cs.ext
diff --git a/jdk/make/data/charsetmapping/list_old b/jdk/make/data/charsetmapping/list_old
new file mode 100644
index 00000000000..ca03b40921b
--- /dev/null
+++ b/jdk/make/data/charsetmapping/list_old
@@ -0,0 +1,149 @@
+#
+# This is the copy of the old configuration files sbcs, dbcs and extsbcs
+# used in jdk8.
+############################### sbcs #########################################
+#
+# clzName csName hisName containASCII pkg
+#
+IBM437 IBM437 Cp437 false sun.nio.cs
+IBM737 x-IBM737 Cp737 false sun.nio.cs
+IBM775 IBM775 Cp775 false sun.nio.cs
+IBM850 IBM850 Cp850 false sun.nio.cs
+IBM852 IBM852 Cp852 false sun.nio.cs
+IBM855 IBM855 Cp855 false sun.nio.cs
+IBM857 IBM857 Cp857 false sun.nio.cs
+IBM858 IBM00858 Cp858 false sun.nio.cs
+IBM862 IBM862 Cp862 false sun.nio.cs
+IBM866 IBM866 Cp866 false sun.nio.cs
+IBM874 x-IBM874 Cp874 false sun.nio.cs
+ISO_8859_2 ISO-8859-2 ISO8859_2 true sun.nio.cs
+ISO_8859_4 ISO-8859-4 ISO8859_4 true sun.nio.cs
+ISO_8859_5 ISO-8859-5 ISO8859_5 true sun.nio.cs
+ISO_8859_7 ISO-8859-7 ISO8859_7 true sun.nio.cs
+ISO_8859_9 ISO-8859-9 ISO8859_9 true sun.nio.cs
+ISO_8859_13 ISO-8859-13 ISO8859_13 true sun.nio.cs
+ISO_8859_15 ISO-8859-15 ISO8859_15 true sun.nio.cs
+KOI8_R KOI8-R KOI8_R true sun.nio.cs
+KOI8_U KOI8-U KOI8_U true sun.nio.cs
+MS1250 windows-1250 Cp1250 true sun.nio.cs
+MS1251 windows-1251 Cp1251 true sun.nio.cs
+MS1252 windows-1252 Cp1252 true sun.nio.cs
+MS1253 windows-1253 Cp1253 true sun.nio.cs
+MS1254 windows-1254 Cp1254 true sun.nio.cs
+MS1257 windows-1257 Cp1257 true sun.nio.cs
+#
+############################### extsbcs #######################################
+#
+IBM037 IBM037 Cp037 false sun.nio.cs.ext
+IBM1006 x-IBM1006 Cp1006 false sun.nio.cs.ext
+IBM1025 x-IBM1025 Cp1025 false sun.nio.cs.ext
+IBM1026 IBM1026 Cp1026 false sun.nio.cs.ext
+IBM1046 x-IBM1046 Cp1046 false sun.nio.cs.ext
+IBM1047 IBM1047 Cp1047 false sun.nio.cs.ext
+IBM1097 x-IBM1097 Cp1097 false sun.nio.cs.ext
+IBM1098 x-IBM1098 Cp1098 false sun.nio.cs.ext
+IBM1112 x-IBM1112 Cp1112 false sun.nio.cs.ext
+IBM1122 x-IBM1122 Cp1122 false sun.nio.cs.ext
+IBM1123 x-IBM1123 Cp1123 false sun.nio.cs.ext
+IBM1124 x-IBM1124 Cp1124 false sun.nio.cs.ext
+# map tables for 1140-1149 are updated manualy with the u+20ac entry
+IBM1140 IBM01140 Cp1140 false sun.nio.cs.ext
+IBM1141 IBM01141 Cp1141 false sun.nio.cs.ext
+IBM1142 IBM01142 Cp1142 false sun.nio.cs.ext
+IBM1143 IBM01143 Cp1143 false sun.nio.cs.ext
+IBM1144 IBM01144 Cp1144 false sun.nio.cs.ext
+IBM1145 IBM01145 Cp1145 false sun.nio.cs.ext
+IBM1146 IBM01146 Cp1146 false sun.nio.cs.ext
+IBM1147 IBM01147 Cp1147 false sun.nio.cs.ext
+IBM1148 IBM01148 Cp1148 false sun.nio.cs.ext
+IBM1149 IBM01149 Cp1149 false sun.nio.cs.ext
+IBM273 IBM273 Cp273 false sun.nio.cs.ext
+IBM277 IBM277 Cp277 false sun.nio.cs.ext
+IBM278 IBM278 Cp278 false sun.nio.cs.ext
+IBM280 IBM280 Cp280 false sun.nio.cs.ext
+IBM284 IBM284 Cp284 false sun.nio.cs.ext
+IBM285 IBM285 Cp285 false sun.nio.cs.ext
+IBM290 IBM290 Cp290 false sun.nio.cs.ext
+IBM297 IBM297 Cp297 false sun.nio.cs.ext
+IBM420 IBM420 Cp420 false sun.nio.cs.ext
+IBM424 IBM424 Cp424 false sun.nio.cs.ext
+IBM500 IBM500 Cp500 false sun.nio.cs.ext
+IBM833 x-IBM833 Cp833 false sun.nio.cs.ext
+IBM838 IBM-Thai Cp838 false sun.nio.cs.ext
+IBM856 x-IBM856 Cp856 false sun.nio.cs.ext
+IBM860 IBM860 Cp860 false sun.nio.cs.ext
+IBM861 IBM861 Cp861 false sun.nio.cs.ext
+IBM863 IBM863 Cp863 false sun.nio.cs.ext
+IBM864 IBM864 Cp864 false sun.nio.cs.ext
+IBM865 IBM865 Cp865 false sun.nio.cs.ext
+IBM868 IBM868 Cp868 false sun.nio.cs.ext
+IBM869 IBM869 Cp869 false sun.nio.cs.ext
+IBM870 IBM870 Cp870 false sun.nio.cs.ext
+IBM871 IBM871 Cp871 false sun.nio.cs.ext
+IBM875 x-IBM875 Cp875 false sun.nio.cs.ext
+IBM918 IBM918 Cp918 false sun.nio.cs.ext
+IBM921 x-IBM921 Cp921 false sun.nio.cs.ext
+IBM922 x-IBM922 Cp922 false sun.nio.cs.ext
+# use name as hisname as well, cs did not support hisname prevously
+ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext
+ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext
+ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext
+ISO_8859_8 ISO-8859-8 ISO8859_8 true sun.nio.cs.ext
+JIS_X_0201 JIS_X0201 JIS_X0201 true sun.nio.cs.ext
+MS1255 windows-1255 Cp1255 true sun.nio.cs.ext
+MS1256 windows-1256 Cp1256 true sun.nio.cs.ext
+MS1258 windows-1258 Cp1258 true sun.nio.cs.ext
+MS874 x-windows-874 MS874 true sun.nio.cs.ext
+MacArabic x-MacArabic MacArabic false sun.nio.cs.ext
+MacCentralEurope x-MacCentralEurope MacCentralEurope false sun.nio.cs.ext
+MacCroatian x-MacCroatian MacCroatian false sun.nio.cs.ext
+MacCyrillic x-MacCyrillic MacCyrillic false sun.nio.cs.ext
+MacDingbat x-MacDingbat MacDingbat false sun.nio.cs.ext
+MacGreek x-MacGreek MacGreek false sun.nio.cs.ext
+MacHebrew x-MacHebrew MacHebrew false sun.nio.cs.ext
+MacIceland x-MacIceland MacIceland false sun.nio.cs.ext
+MacRoman x-MacRoman MacRoman false sun.nio.cs.ext
+MacRomania x-MacRomania MacRomania false sun.nio.cs.ext
+MacSymbol x-MacSymbol MacSymbol false sun.nio.cs.ext
+MacThai x-MacThai MacThai false sun.nio.cs.ext
+MacTurkish x-MacTurkish MacTurkish false sun.nio.cs.ext
+MacUkraine x-MacUkraine MacUkraine false sun.nio.cs.ext
+TIS_620 TIS-620 TIS620 true sun.nio.cs.ext
+#
+############################### dbcs #########################################
+#
+#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
+#
+Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe
+Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
+EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
+EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
+MS932 windows-31j MS932 basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
+MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
+MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+SJIS Shift_JIS SJIS basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
+PCK x-PCK PCK basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
+IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
+IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
+IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
+IBM300 x-IBM300 Cp300 dbcsonly sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM933 x-IBM933 Cp933 ebcdic sun.nio.cs.ext false 0x40 0xdd 0x40 0xfe
+IBM935 x-IBM935 Cp935 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM937 x-IBM937 Cp937 ebcdic sun.nio.cs.ext false 0x40 0xe2 0x40 0xfe
+IBM939 x-IBM939 Cp939 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM942 x-IBM942 Cp942 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
+IBM943 x-IBM943 Cp943 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
+IBM948 x-IBM948 Cp948 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfc
+IBM949 x-IBM949 Cp949 basic sun.nio.cs.ext false 0x8f 0xfe 0xa1 0xfe
+IBM950 x-IBM950 Cp950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+IBM970 x-IBM970 Cp970 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
+JIS_X_0208 x-JIS0208 JIS0208 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0212 JIS_X0212-1990 JIS0212 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0208_Solaris x-JIS0208_Solaris JIS0208_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x9e 0x21 0x7e
+JIS_X_0208_MS5022X x-JIS0208_MS5022X JIS0208_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0208_MS932 x-JIS0208_MS932 JIS0208_MS932 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0212_Solaris x-JIS0212_Solaris JIS0212_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0212_MS5022X x-JIS0212_MS5022X JIS0212_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
diff --git a/jdk/make/data/charsetmapping/sbcs b/jdk/make/data/charsetmapping/sbcs
deleted file mode 100644
index 0b11960411b..00000000000
--- a/jdk/make/data/charsetmapping/sbcs
+++ /dev/null
@@ -1,28 +0,0 @@
-# clzName csName hisName containASCII pkg
-IBM437 IBM437 Cp437 false sun.nio.cs
-IBM737 x-IBM737 Cp737 false sun.nio.cs
-IBM775 IBM775 Cp775 false sun.nio.cs
-IBM850 IBM850 Cp850 false sun.nio.cs
-IBM852 IBM852 Cp852 false sun.nio.cs
-IBM855 IBM855 Cp855 false sun.nio.cs
-IBM857 IBM857 Cp857 false sun.nio.cs
-IBM858 IBM00858 Cp858 false sun.nio.cs
-IBM862 IBM862 Cp862 false sun.nio.cs
-IBM866 IBM866 Cp866 false sun.nio.cs
-IBM874 x-IBM874 Cp874 false sun.nio.cs
-ISO_8859_2 ISO-8859-2 ISO8859_2 true sun.nio.cs
-ISO_8859_4 ISO-8859-4 ISO8859_4 true sun.nio.cs
-ISO_8859_5 ISO-8859-5 ISO8859_5 true sun.nio.cs
-ISO_8859_7 ISO-8859-7 ISO8859_7 true sun.nio.cs
-ISO_8859_9 ISO-8859-9 ISO8859_9 true sun.nio.cs
-ISO_8859_13 ISO-8859-13 ISO8859_13 true sun.nio.cs
-ISO_8859_15 ISO-8859-15 ISO8859_15 true sun.nio.cs
-KOI8_R KOI8-R KOI8_R true sun.nio.cs
-KOI8_U KOI8-U KOI8_U true sun.nio.cs
-MS1250 windows-1250 Cp1250 true sun.nio.cs
-MS1251 windows-1251 Cp1251 true sun.nio.cs
-MS1252 windows-1252 Cp1252 true sun.nio.cs
-MS1253 windows-1253 Cp1253 true sun.nio.cs
-MS1254 windows-1254 Cp1254 true sun.nio.cs
-MS1257 windows-1257 Cp1257 true sun.nio.cs
-
diff --git a/jdk/make/data/charsetmapping/standard-charsets b/jdk/make/data/charsetmapping/standard-charsets
deleted file mode 100644
index f9f4db12c6a..00000000000
--- a/jdk/make/data/charsetmapping/standard-charsets
+++ /dev/null
@@ -1,337 +0,0 @@
-#
-# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# 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.
-#
-
-# Standard charsets provided by StandardCharsets provider.
-#
-# Note that these "standard" charsets listed here are not
-# necessary to be the "Standard charsets" defined in the
-# specification of java.nio.charset.Charset. Instead these
-# are the charsets that this implementation believes should
-# be packaged into the charsets provider class "StandardCharsets"
-# which is initialized at startup time by java.nio.charset.Charset,
-# compared to the charsets packaged in "ExtendedCharsets" provider,
-# which is lazy initialized.
-
-charset US-ASCII US_ASCII
-
- # IANA aliases
- alias iso-ir-6
- alias ANSI_X3.4-1986
- alias ISO_646.irv:1991
- alias ASCII
- alias ISO646-US
- alias us
- alias IBM367
- alias cp367
- alias csASCII
- alias default
-
- # Other aliases
- alias 646 # Solaris POSIX locale
- alias iso_646.irv:1983
- alias ANSI_X3.4-1968 # Linux POSIX locale (RedHat)
- alias ascii7
-
-charset UTF-8 UTF_8
- alias UTF8 # JDK historical
- alias unicode-1-1-utf-8
-
-charset CESU-8 CESU_8
- alias CESU8
- alias csCESU-8
-
-charset UTF-16 UTF_16
- alias UTF_16 # JDK historical
- alias utf16
- alias unicode
- alias UnicodeBig
-
-charset UTF-16BE UTF_16BE
- alias UTF_16BE
- alias ISO-10646-UCS-2
- alias X-UTF-16BE
- alias UnicodeBigUnmarked
-
-charset UTF-16LE UTF_16LE
- alias UTF_16LE
- alias X-UTF-16LE
- alias UnicodeLittleUnmarked
-
-charset x-UTF-16LE-BOM UTF_16LE_BOM
- alias UnicodeLittle
-
-charset UTF-32 UTF_32
- alias UTF_32
- alias UTF32
-
-charset UTF-32LE UTF_32LE
- alias UTF_32LE
- alias X-UTF-32LE
-
-charset UTF-32BE UTF_32BE
- alias UTF_32BE
- alias X-UTF-32BE
-
-charset X-UTF-32LE-BOM UTF_32LE_BOM
- alias UTF_32LE_BOM
- alias UTF-32LE-BOM
-
-charset X-UTF-32BE-BOM UTF_32BE_BOM
- alias UTF_32BE_BOM
- alias UTF-32BE-BOM
-
-charset ISO-8859-1 ISO_8859_1
-
- # IANA aliases
- alias iso-ir-100
- alias ISO_8859-1
- alias latin1
- alias l1
- alias IBM819
- alias cp819
- alias csISOLatin1
-
- # Other aliases
- alias 819
- alias IBM-819
- alias ISO8859_1
- alias ISO_8859-1:1987
- alias ISO_8859_1
- alias 8859_1
- alias ISO8859-1
-
-charset ISO-8859-2 ISO_8859_2
- alias iso8859_2 # JDK historical
- alias 8859_2
- alias iso-ir-101
- alias ISO_8859-2
- alias ISO_8859-2:1987
- alias ISO8859-2
- alias latin2
- alias l2
- alias ibm912
- alias ibm-912
- alias cp912
- alias 912
- alias csISOLatin2
-
-charset ISO-8859-4 ISO_8859_4
- alias iso8859_4 # JDK historical
- alias iso8859-4
- alias 8859_4
- alias iso-ir-110
- alias ISO_8859-4
- alias ISO_8859-4:1988
- alias latin4
- alias l4
- alias ibm914
- alias ibm-914
- alias cp914
- alias 914
- alias csISOLatin4
-
-charset ISO-8859-5 ISO_8859_5
- alias iso8859_5 # JDK historical
- alias 8859_5
- alias iso-ir-144
- alias ISO_8859-5
- alias ISO_8859-5:1988
- alias ISO8859-5
- alias cyrillic
- alias ibm915
- alias ibm-915
- alias cp915
- alias 915
- alias csISOLatinCyrillic
-
-charset ISO-8859-7 ISO_8859_7
- alias iso8859_7 # JDK historical
- alias 8859_7
- alias iso-ir-126
- alias ISO_8859-7
- alias ISO_8859-7:1987
- alias ELOT_928
- alias ECMA-118
- alias greek
- alias greek8
- alias csISOLatinGreek
- alias sun_eu_greek # Solaris 7/8 compatibility
- alias ibm813
- alias ibm-813
- alias 813
- alias cp813
- alias iso8859-7 # Solaris 9 compatibility
-
-charset ISO-8859-9 ISO_8859_9
- alias iso8859_9 # JDK historical
- alias 8859_9
- alias iso-ir-148
- alias ISO_8859-9
- alias ISO_8859-9:1989
- alias ISO8859-9
- alias latin5
- alias l5
- alias ibm920
- alias ibm-920
- alias 920
- alias cp920
- alias csISOLatin5
-
-charset ISO-8859-13 ISO_8859_13
- alias iso8859_13 # JDK historical
- alias 8859_13
- alias iso_8859-13
- alias ISO8859-13
-
-charset ISO-8859-15 ISO_8859_15
-
- # IANA alias
- alias ISO_8859-15
-
- # Other aliases
- alias 8859_15
- alias ISO-8859-15
- alias ISO8859_15
- alias ISO8859-15
- alias IBM923
- alias IBM-923
- alias cp923
- alias 923
- alias LATIN0
- alias LATIN9
- alias L9
- alias csISOlatin0
- alias csISOlatin9
- alias ISO8859_15_FDIS
-
-charset KOI8-R KOI8_R
- alias koi8_r # JDK historical
- alias koi8
- alias cskoi8r
-
-charset KOI8-U KOI8_U
- alias koi8_u
-
-charset windows-1250 MS1250
- alias cp1250 # JDK historical
- alias cp5346 # Euro IBM CCSID
-
-charset windows-1251 MS1251
- alias cp1251 # JDK historical
- alias cp5347 # Euro IBM CCSID
- alias ansi-1251 # Solaris compatibility
-
-charset windows-1252 MS1252
- alias cp1252 # JDK historical
- alias cp5348 # Euro IBM CCSID
-
-charset windows-1253 MS1253
- alias cp1253 # JDK historical
- alias cp5349 # Euro IBM CCSID
-
-charset windows-1254 MS1254
- alias cp1254 # JDK historical
- alias cp5350 # Euro IBM CCSID
-
-charset windows-1257 MS1257
- alias cp1257 # JDK historical
- alias cp5353 # Euro IBM CCSID
-
-
-charset IBM437 IBM437
- alias cp437 #JDK historical
- alias ibm437
- alias ibm-437
- alias 437
- alias cspc8codepage437
- alias windows-437
-
-charset x-IBM737 IBM737
- alias cp737 #JDK historical
- alias ibm737
- alias ibm-737
- alias 737
-
-charset IBM775 IBM775
- alias cp775 #JDK historical
- alias ibm775
- alias ibm-775
- alias 775
-
-charset IBM850 IBM850
- alias cp850 #JDK historical
- alias ibm-850
- alias ibm850
- alias 850
- alias cspc850multilingual
-
-charset IBM852 IBM852
- alias cp852 #JDK historical
- alias ibm852
- alias ibm-852
- alias 852
- alias csPCp852
-
-charset IBM855 IBM855
- alias cp855 #JDK historical
- alias ibm-855
- alias ibm855
- alias 855
- alias cspcp855
-
-charset IBM857 IBM857
- alias cp857 #JDK historical
- alias ibm857
- alias ibm-857
- alias 857
- alias csIBM857
-
-charset IBM00858 IBM858
- alias cp858 #JDK historical
- alias ccsid00858
- alias cp00858
- alias 858
- alias PC-Multilingual-850+euro
-
-charset IBM862 IBM862
- alias cp862 #JDK historical
- alias ibm862
- alias ibm-862
- alias 862
- alias csIBM862
- alias cspc862latinhebrew
-
-charset IBM866 IBM866
- alias cp866 #JDK historical
- alias ibm866
- alias ibm-866
- alias 866
- alias csIBM866
-
-charset x-IBM874 IBM874
- alias cp874 #JDK historical
- alias ibm874
- alias ibm-874
- alias 874
diff --git a/jdk/make/data/charsetmapping/stdcs-linux b/jdk/make/data/charsetmapping/stdcs-linux
new file mode 100644
index 00000000000..6ab35ee715e
--- /dev/null
+++ b/jdk/make/data/charsetmapping/stdcs-linux
@@ -0,0 +1,19 @@
+#
+# generate these charsets into sun.nio.cs
+#
+Big5
+Big5_Solaris
+Big5_HKSCS
+EUC_CN
+EUC_KR
+EUC_JP
+EUC_JP_LINUX
+EUC_JP_Open
+GBK
+Johab
+PCK
+JIS_X_0201
+JIS_X_0208
+JIS_X_0212
+JIS_X_0208_Solaris
+JIS_X_0212_Solaris
diff --git a/jdk/make/data/charsetmapping/stdcs-solaris b/jdk/make/data/charsetmapping/stdcs-solaris
new file mode 100644
index 00000000000..6e57033b3c7
--- /dev/null
+++ b/jdk/make/data/charsetmapping/stdcs-solaris
@@ -0,0 +1,23 @@
+#
+# generate these charsets into sun.nio.cs
+#
+Big5
+Big5_Solaris
+Big5_HKSCS # always together with Big5
+EUC_CN
+EUC_KR
+EUC_JP
+EUC_JP_LINUX
+EUC_JP_Open
+GBK
+ISO_8859_11
+ISO_8859_3
+ISO_8859_6
+ISO_8859_8
+Johab
+PCK
+JIS_X_0201
+JIS_X_0208
+JIS_X_0212
+JIS_X_0208_Solaris
+JIS_X_0212_Solaris
diff --git a/jdk/make/data/charsetmapping/stdcs-windows b/jdk/make/data/charsetmapping/stdcs-windows
new file mode 100644
index 00000000000..e579c89cb52
--- /dev/null
+++ b/jdk/make/data/charsetmapping/stdcs-windows
@@ -0,0 +1,16 @@
+#
+# generate these charsets into sun.nio.cs
+#
+GBK
+Johab
+MS1255
+MS1256
+MS1258
+MS874
+MS932
+JIS_X_0201 # JIS_X_0201 is used by MS932 in its contains() method
+SJIS # SJIS must go together with MS932 to support sun.nio.cs.map
+MS936
+MS949
+MS950
+MS950_HKSCS_XP
diff --git a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk
index a646099c339..67e4c3c1f1e 100644
--- a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk
+++ b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk
@@ -30,23 +30,26 @@ include GensrcCommon.gmk
# Generate files using the charsetmapping tool
#
CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
+
CHARSET_GENSRC_JAVA_DIR_CS := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.charsets/sun/nio/cs/ext
CHARSET_DONE_CS := $(CHARSET_GENSRC_JAVA_DIR_CS)/_the.charsetmapping
CHARSET_COPYRIGHT_HEADER := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
CHARSET_TEMPLATES := \
$(CHARSET_DATA_DIR)/SingleByte-X.java.template \
$(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+CHARSET_EXTENDED_JAVA_TEMPLATES := \
+ $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
+CHARSET_EXTENDED_JAVA_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
+CHARSET_EXTENDED := extcs
+CHARSET_STANDARD_OS := stdcs-$(OPENJDK_TARGET_OS)
-$(CHARSET_DONE_CS)-extsbcs: $(CHARSET_DATA_DIR)/extsbcs \
- $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
+$(CHARSET_DONE_CS)-extcs: $(CHARSET_DATA_DIR)/charsets \
+ $(CHARSET_TEMPLATES) $(CHARSET_EXTENDED_DATA) $(BUILD_TOOLS_JDK)
$(MKDIR) -p $(@D)
- $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) extsbcs
- $(TOUCH) '$@'
-
-$(CHARSET_DONE_CS)-dbcs: $(CHARSET_DATA_DIR)/dbcs \
- $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
- $(MKDIR) -p $(@D)
- $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) dbcs
+ $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) \
+ extcs charsets $(CHARSET_STANDARD_OS) \
+ $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
+ $(CHARSET_EXTENDED_JAVA_DIR)
$(TOUCH) '$@'
$(CHARSET_DONE_CS)-hkscs: $(CHARSET_COPYRIGHT_HEADER)/HKSCS.java \
@@ -67,8 +70,7 @@ $(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat: $(CHARSET_DATA_DIR)/sjis0213.map \
$(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213
GENSRC_JDK_CHARSETS += \
- $(CHARSET_DONE_CS)-extsbcs \
- $(CHARSET_DONE_CS)-dbcs \
+ $(CHARSET_DONE_CS)-extcs \
$(CHARSET_DONE_CS)-hkscs \
$(CHARSET_DONE_CS)-euctw \
$(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat \
diff --git a/jdk/make/gensrc/GensrcCharsetMapping.gmk b/jdk/make/gensrc/GensrcCharsetMapping.gmk
index af1e9f08ce4..e38efd8bf62 100644
--- a/jdk/make/gensrc/GensrcCharsetMapping.gmk
+++ b/jdk/make/gensrc/GensrcCharsetMapping.gmk
@@ -25,112 +25,27 @@
################################################################################
#
-# Generate files using the charsetmapping tool
+# Generate StandardCharsets.java and individul sun.nio.cs charset class using
+# the charsetmapping tool
#
CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
+CHARSET_EXTSRC_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
CHARSET_GENSRC_JAVA_DIR_BASE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/cs
CHARSET_DONE_BASE := $(CHARSET_GENSRC_JAVA_DIR_BASE)/_the.charsetmapping
CHARSET_TEMPLATES := \
$(CHARSET_DATA_DIR)/SingleByte-X.java.template \
$(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+CHARSET_STANDARD_JAVA_TEMPLATES := \
+ $(JDK_TOPDIR)/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
+CHARSET_STANDARD_OS := stdcs-$(OPENJDK_TARGET_OS)
-$(CHARSET_DONE_BASE)-sbcs: $(CHARSET_DATA_DIR)/sbcs \
+$(CHARSET_DONE_BASE)-stdcs: $(CHARSET_DATA_DIR)/charsets \
$(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
$(MKDIR) -p $(@D)
- $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) sbcs
+ $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) \
+ stdcs charsets $(CHARSET_STANDARD_OS) \
+ $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) \
$(TOUCH) '$@'
-GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-sbcs
+GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
-################################################################################
-#
-# Generate the sun/nio/cs/StandardCharsets.java file
-#
-CHARSET_STANDARD_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_standardcharsets
-CHARSET_STANDARD_DATA := $(CHARSET_DATA_DIR)/standard-charsets
-CHARSET_STANDARD_JAVA := sun/nio/cs/StandardCharsets.java
-
-CHARSET_ALIASES_TABLES_AWK := ' \
- BEGIN { n = 1; m = 1; } \
- /^[ \t]*charset / { \
- csn = $$2; cln = $$3; \
- lcsn = tolower(csn); \
- lcsns[n++] = lcsn; \
- csns[lcsn] = csn; \
- classMap[lcsn] = cln; \
- if (n > 2) \
- printf " };\n\n"; \
- printf " static final String[] aliases_%s = new String[] {\n", cln; \
- } \
- /^[ \t]*alias / { \
- acsns[m++] = tolower($$2); \
- aliasMap[tolower($$2)] = lcsn; \
- printf " \"%s\",\n", $$2; \
- } \
- END { \
- printf " };\n\n"; \
- } '
-
-CHARSET_ALIASES_MAP_AWK := ' \
- /^[ \t]*charset / { \
- csn = $$2; \
- lcsn = tolower(csn); \
- } \
- /^[ \t]*alias / { \
- an = tolower($$2); \
- printf "%-20s \"%s\"\n", an, lcsn; \
- } '
-
-CHARSET_CLASSES_MAP_AWK := ' \
- /^[ \t]*charset / { \
- csn = $$2; cln = $$3; \
- lcsn = tolower(csn); \
- printf "%-20s \"%s\"\n", lcsn, cln; \
- } '
-
-# This target should be referenced using the order-only operator (|)
-$(CHARSET_STANDARD_GENSRC_DIR):
- $(MKDIR) -p '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet: $(CHARSET_STANDARD_DATA) \
- | $(CHARSET_STANDARD_GENSRC_DIR)
- $(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_TABLES_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map: $(CHARSET_STANDARD_DATA) \
- | $(CHARSET_STANDARD_GENSRC_DIR)
- $(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_MAP_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/classes-map: $(CHARSET_STANDARD_DATA) \
- | $(CHARSET_STANDARD_GENSRC_DIR)
- $(NAWK) < '$<' > '$@' $(CHARSET_CLASSES_MAP_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map \
- $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
- $(TOOL_HASHER) -i Aliases < '$<' > '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
- $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
- $(TOOL_HASHER) -i Classes < '$<' > '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
- $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
- $(TOOL_HASHER) -i -e Cache -t Charset < '$<' > '$@'
-
-$(eval $(call SetupTextFileProcessing, BUILD_CHARSET_STANDARD, \
- SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/$(CHARSET_STANDARD_JAVA).template, \
- OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/$(CHARSET_STANDARD_JAVA), \
- INCLUDES := \
- _INCLUDE_ALIASES_TABLES_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet ; \
- _INCLUDE_ALIASES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet ; \
- _INCLUDE_CLASSES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet ; \
- _INCLUDE_CACHE_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet ; , \
-))
-
-# Processing of template depends on the snippets being generated first
-$(BUILD_CHARSET_STANDARD): \
- $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet \
- $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet \
- $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet \
- $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet
-
-GENSRC_JAVA_BASE += $(BUILD_CHARSET_STANDARD)
diff --git a/jdk/make/launcher/Launcher-jdk.dev.gmk b/jdk/make/launcher/Launcher-jdk.dev.gmk
index 6008ffd3b6d..92b6d1bacb9 100644
--- a/jdk/make/launcher/Launcher-jdk.dev.gmk
+++ b/jdk/make/launcher/Launcher-jdk.dev.gmk
@@ -31,6 +31,12 @@ $(eval $(call SetupLauncher,jar, \
$(eval $(call SetupLauncher,jarsigner, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
+ifndef BUILD_HEADLESS_ONLY
+ $(eval $(call SetupLauncher,policytool, \
+ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
+ $(XLIBS)))
+endif
+
$(eval $(call SetupLauncher,jdeps, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
diff --git a/jdk/make/launcher/Launcher-jdk.runtime.gmk b/jdk/make/launcher/Launcher-jdk.runtime.gmk
index 96c02be5689..366dc5cc9a2 100644
--- a/jdk/make/launcher/Launcher-jdk.runtime.gmk
+++ b/jdk/make/launcher/Launcher-jdk.runtime.gmk
@@ -25,12 +25,6 @@
include LauncherCommon.gmk
-ifndef BUILD_HEADLESS_ONLY
- $(eval $(call SetupLauncher,policytool, \
- -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
- $(XLIBS)))
-endif
-
$(eval $(call SetupLauncher,pack200, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) }'))
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/Charset.java b/jdk/make/src/classes/build/tools/charsetmapping/Charset.java
new file mode 100644
index 00000000000..94d61c35f0d
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Charset.java
@@ -0,0 +1,42 @@
+/*
+ * 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 build.tools.charsetmapping;
+
+class Charset {
+ String pkgName;
+ String clzName;
+ String csName;
+ String hisName;
+ String type;
+ boolean isASCII;
+ int b1Min;
+ int b1Max;
+ int b2Min;
+ int b2Max;
+ String[] aliases;
+ boolean isGenSrc = false;
+ boolean isInternal = false;
+}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java b/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java
index d54d20582dc..bd4bd7140f6 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -24,71 +24,32 @@
*/
package build.tools.charsetmapping;
+
import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Formatter;
-import java.util.regex.*;
-import java.nio.charset.*;
+import java.util.regex.Pattern;
import static build.tools.charsetmapping.Utils.*;
public class DBCS {
// pattern used by this class to read in mapping table
static Pattern mPattern = Pattern.compile("(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
- public static void genClass(String args[]) throws Exception {
-
- Scanner s = new Scanner(new File(args[0], args[2]));
- while (s.hasNextLine()) {
- String line = s.nextLine();
- if (line.startsWith("#") || line.length() == 0)
- continue;
- String[] fields = line.split("\\s+");
- if (fields.length < 10) {
- System.err.println("Misconfiged sbcs line <" + line + ">?");
- continue;
- }
- String clzName = fields[0];
- String csName = fields[1];
- String hisName = ("null".equals(fields[2]))?null:fields[2];
- String type = fields[3].toUpperCase();
- if ("BASIC".equals(type))
- type = "";
- else
- type = "_" + type;
- String pkgName = fields[4];
- boolean isASCII = Boolean.valueOf(fields[5]);
- int b1Min = toInteger(fields[6]);
- int b1Max = toInteger(fields[7]);
- int b2Min = toInteger(fields[8]);
- int b2Max = toInteger(fields[9]);
- System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
- genClass0(args[0], args[1], "DoubleByte-X.java.template",
- clzName, csName, hisName, pkgName,
- isASCII, type,
- b1Min, b1Max, b2Min, b2Max);
- }
- }
-
- static int toInteger(String s) {
- if (s.startsWith("0x") || s.startsWith("0X"))
- return Integer.valueOf(s.substring(2), 16);
- else
- return Integer.valueOf(s);
- }
-
- private static void genClass0(String srcDir, String dstDir, String template,
- String clzName,
- String csName,
- String hisName,
- String pkgName,
- boolean isASCII,
- String type,
- int b1Min, int b1Max,
- int b2Min, int b2Max)
+ public static void genClass(String type, Charset cs,
+ String srcDir, String dstDir, String template)
throws Exception
{
+ String clzName = cs.clzName;
+ String csName = cs.csName;
+ String hisName = cs.hisName;
+ String pkgName = cs.pkgName;
+ boolean isASCII = cs.isASCII;
+ int b1Min = cs.b1Min;
+ int b1Max = cs.b1Max;
+ int b2Min = cs.b2Min;
+ int b2Max = cs.b2Max;
StringBuilder b2cSB = new StringBuilder();
StringBuilder b2cNRSB = new StringBuilder();
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java b/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java
index b37b0e3fea5..18c0a24ad7b 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java
@@ -42,38 +42,51 @@ public class HKSCS {
private static Pattern hkscs =
Pattern.compile("(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*");
- static void genClass(String args[]) throws Exception {
-
+ static void genClass2008(String srcDir, String dstDir, String pkgName)
+ throws Exception
+ {
// hkscs2008
- genClass0(new FileInputStream(new File(args[0], "HKSCS2008.map")),
- new FileInputStream(new File(args[0], "HKSCS2008.c2b")),
- new PrintStream(new File(args[1], "HKSCSMapping.java"),
+ genClass0(new FileInputStream(new File(srcDir, "HKSCS2008.map")),
+ new FileInputStream(new File(srcDir, "HKSCS2008.c2b")),
+ new PrintStream(new File(dstDir, "HKSCSMapping.java"),
"ISO-8859-1"),
+ pkgName,
"HKSCSMapping",
- getCopyright(new File(args[3])));
+ true,
+ "");
+ }
-
- // xp2001
- genClass0(new FileInputStream(new File(args[0], "HKSCS_XP.map")),
+ static void genClassXP(String srcDir, String dstDir, String pkgName)
+ throws Exception
+ {
+ genClass0(new FileInputStream(new File(srcDir, "HKSCS_XP.map")),
null,
- new PrintStream(new File(args[1], "HKSCS_XPMapping.java"),
+ new PrintStream(new File(dstDir, "HKSCS_XPMapping.java"),
"ISO-8859-1"),
+ pkgName,
"HKSCS_XPMapping",
- getCopyright(new File(args[3])));
+ false,
+ "");
+ }
+ static void genClass2001(String args[]) throws Exception {
// hkscs2001
genClass0(new FileInputStream(new File(args[0], "HKSCS2001.map")),
new FileInputStream(new File(args[0], "HKSCS2001.c2b")),
new PrintStream(new File(args[1], "HKSCS2001Mapping.java"),
"ISO-8859-1"),
+ "sun.nio.cs.ext",
"HKSCS2001Mapping",
+ false,
getCopyright(new File(args[3])));
}
static void genClass0(InputStream isB2C,
InputStream isC2B,
PrintStream ps,
+ String pkgName,
String clzName,
+ boolean isPublic,
String copyright)
throws Exception
{
@@ -132,8 +145,8 @@ public class HKSCS {
out.format(copyright);
out.format("%n// -- This file was mechanically generated: Do not edit! -- //%n");
- out.format("package sun.nio.cs.ext;%n%n");
- out.format("class %s {%n%n", clzName);
+ out.format("package %s;%n%n", pkgName);
+ out.format("%sclass %s {%n%n", isPublic ? "public " : "", clzName);
/* hardcoded in sun.nio.cs.ext.HKSCS.java
out.format(" final static int b1Min = 0x%x;%n", b1Min);
@@ -143,7 +156,8 @@ public class HKSCS {
*/
// bmp tables
- out.format("%n static final String[] b2cBmpStr = new String[] {%n");
+ out.format("%n %sstatic final String[] b2cBmpStr = new String[] {%n",
+ isPublic ? "public " : "");
for (int i = 0; i < 0x100; i++) {
if (b2cBmp[i])
out.format(bmp, i, b2Min, b2Max, ",");
@@ -153,7 +167,8 @@ public class HKSCS {
out.format(" };%n");
// supp tables
- out.format("%n static final String[] b2cSuppStr =");
+ out.format("%n %sstatic final String[] b2cSuppStr =",
+ isPublic ? "public " : "");
if (hasSupp) {
out.format(" new String[] {%n");
for (int i = 0; i < 0x100; i++) {
@@ -168,7 +183,8 @@ public class HKSCS {
}
// private area tables
- out.format("%n final static String pua =");
+ out.format("%n %sfinal static String pua =",
+ isPublic ? "public " : "");
if (hasPua) {
out.format("%n");
out.format(pua, 0, pua.length, ";");
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java b/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java
new file mode 100644
index 00000000000..f935202a522
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. 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 build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.*;
+
+
+/**
+ * Reads a map in the form of a sequence of key/value-expression pairs from the
+ * standard input, attempts to construct a hash map that fits within the given
+ * table-size and chain-depth constraints, and, if successful, writes source
+ * code to the standard output for a subclass of sun.util.PreHashedMap that
+ * implements the map.
+ *
+ * @see sun.util.PreHashedMap
+ *
+ * @author Mark Reinhold
+ */
+
+public class Hasher {
+
+ private PrintStream err = System.err;
+
+ boolean verbose = false;
+ List keys = new ArrayList<>(); // Key strings
+ List values = new ArrayList<>(); // Value expressions
+ String pkg = null; // Package prefix for generated class
+ String cln = null; // Name of generated class
+ String vtype = null; // Value type
+ int maxBits = 11; // lg table size
+ int maxDepth = 3; // Max chain depth
+ boolean inner = false; // Generating an inner class?
+ boolean empty = false; // Generating an empty table?
+
+ Object[] ht; // Hash table itself
+ int nb; // Number of bits (lg table size)
+ int md; // Maximum chain depth
+ int mask; // Hash-code mask
+ int shift; // Hash-code shift size
+
+ int hash(String w) {
+ return (w.hashCode() >> shift) & mask;
+ }
+
+ // Build a hash table of size 2^nb, shifting the hash code by s bits
+ //
+ void build(int nb, int s) {
+
+ this.nb = nb;
+ this.shift = s;
+ int n = 1 << nb;
+ this.mask = n - 1;
+ ht = new Object[n];
+ int nw = keys.size();
+
+ for (int i = 0; i < nw; i++) {
+ String w = keys.get(i);
+ String v = values.get(i);
+ int h = hash(w);
+ if (ht[h] == null)
+ ht[h] = new Object[] { w, v };
+ else
+ ht[h] = new Object[] { w, v, ht[h] };
+ }
+
+ this.md = 0;
+ for (int i = 0; i < n; i++) {
+ int d = 1;
+ for (Object[] a = (Object[])ht[i];
+ a != null && a.length > 2;
+ a = (Object[])a[2], d++);
+ this.md = Math.max(md, d);
+ }
+
+ }
+
+ Hasher build() {
+ // Iterate through acceptable table sizes
+ for (int nb = 2; nb < maxBits; nb++) {
+ // Iterate through possible shift sizes
+ for (int s = 0; s < (32 - nb); s++) {
+ build(nb, s);
+ if (verbose)
+ err.println("nb=" + nb + " s=" + s + " md=" + md);
+ if (md <= maxDepth) {
+ // Success
+ if (verbose) {
+ if (cln != null)
+ err.print(cln + ": ");
+ err.println("Table size " + (1 << nb) + " (" + nb + " bits)"
+ + ", shift " + shift
+ + ", max chain depth " + md);
+ }
+ return this;
+ }
+ }
+ }
+ throw new RuntimeException("Cannot find a suitable size"
+ + " within given constraints");
+ }
+
+ // Look for the given key in the hash table
+ //
+ String get(String k) {
+ int h = hash(k);
+ Object[] a = (Object[])ht[h];
+ for (;;) {
+ if (a[0].equals(k))
+ return (String)a[1];
+ if (a.length < 3)
+ return null;
+ a = (Object[])a[2];
+ }
+ }
+
+ // Test that all input keys can be found in the table
+ //
+ Hasher test() {
+ if (verbose)
+ err.println();
+ for (int i = 0, n = keys.size(); i < n; i++) {
+ String w = keys.get(i);
+ String v = get(w);
+ if (verbose)
+ err.println(hash(w) + "\t" + w);
+ if (!v.equals(values.get(i)))
+ throw new Error("Incorrect value: " + w + " --> "
+ + v + ", should be " + values.get(i));
+ }
+ return this;
+ }
+
+ String ind = ""; // Indent prefix
+
+ // Generate code for a single table entry
+ //
+ void genEntry(Object[] a, int depth, PrintStream out) {
+ Object v = empty ? null : a[1];
+ out.print("new Object[] { \"" + a[0] + "\", " + v);
+ if (a.length < 3) {
+ out.print(" }");
+ return;
+ }
+ out.println(",");
+ out.print(ind + " ");
+ for (int i = 0; i < depth; i++)
+ out.print(" ");
+ genEntry((Object[])a[2], depth + 1, out);
+ out.print(" }");
+ }
+
+ // Generate a PreHashedMap subclass from the computed hash table
+ //
+ Hasher generate(PrintStream out) throws IOException {
+ if (cln == null)
+ return this;
+
+ if (inner)
+ ind = " ";
+
+ if (!inner && pkg != null) {
+ out.println();
+ out.println("package " + pkg + ";");
+ out.println();
+ }
+
+ if (inner) {
+ out.println(ind + "private static final class " + cln);
+ } else {
+ out.println();
+ out.println("public final class " + cln);
+ }
+ out.println(ind + " extends sun.util.PreHashedMap<" + vtype +">");
+ out.println(ind + "{");
+
+ out.println();
+ out.println(ind + " private static final int ROWS = "
+ + ht.length + ";");
+ out.println(ind + " private static final int SIZE = "
+ + keys.size() + ";");
+ out.println(ind + " private static final int SHIFT = "
+ + shift + ";");
+ out.println(ind + " private static final int MASK = 0x"
+ + Integer.toHexString(mask) + ";");
+ out.println();
+
+ out.println(ind + " " + (inner ? "private " : "public ")
+ + cln + "() {");
+ out.println(ind + " super(ROWS, SIZE, SHIFT, MASK);");
+ out.println(ind + " }");
+ out.println();
+
+ out.println(ind + " protected void init(Object[] ht) {");
+ for (int i = 0; i < ht.length; i++) {
+ if (ht[i] == null)
+ continue;
+ Object[] a = (Object[])ht[i];
+ out.print(ind + " ht[" + i + "] = ");
+ genEntry(a, 0, out);
+ out.println(";");
+ }
+ out.println(ind + " }");
+ out.println();
+
+ out.println(ind + "}");
+ if (inner)
+ out.println();
+
+ return this;
+ }
+
+ private Hasher(List keys, List values,
+ String pkg, String cln, String vtype,
+ int maxBits, int maxDepth,
+ boolean inner, boolean empty,
+ boolean verbose) {
+ this.keys = keys;
+ this.values = values;
+ this.pkg = pkg;
+ this.cln = cln;
+ this.vtype = vtype;
+ this.maxBits = maxBits;
+ this.maxDepth = maxDepth;
+ this.inner = inner;
+ this.empty = empty;
+ this.verbose = verbose;
+ }
+
+ public static void genClass(PrintStream out,
+ List keys, List values,
+ String pkg, String cln, String vtype,
+ int maxBits, int maxDepth,
+ boolean inner, boolean empty, boolean verbose)
+ throws IOException {
+ new Hasher(keys, values, pkg, cln, vtype,
+ maxBits, maxDepth, inner, empty, verbose)
+ .build()
+ .test()
+ .generate(out);
+ }
+}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/Main.java b/jdk/make/src/classes/build/tools/charsetmapping/Main.java
index 0312cb646b4..780ff093b2d 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/Main.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -26,25 +26,193 @@
package build.tools.charsetmapping;
import java.io.*;
+import java.util.ArrayList;
import java.util.Scanner;
+import java.util.LinkedHashMap;
+import java.util.Locale;
public class Main {
- public static void main(String args[]) throws Exception {
+ public static void main(String args[]) throws Throwable {
+ int SRC_DIR = 0;
+ int DST_DIR = 1;
+ int TYPE = 2;
+ int CHARSETS = 3;
+ int OS = 4;
+ int TEMPLATE = 5;
+ int EXT_SRC = 6;
+
if (args.length < 3 ) {
- System.out.println("Usage: java -jar charsetmapping.jar src dst mType [copyrightSrc]");
+ System.out.println("Usage: java -jar charsetmapping.jar src dst spiType charsets os [template]");
System.exit(1);
}
- if ("sbcs".equals(args[2]) || "extsbcs".equals(args[2])) {
- SBCS.genClass(args);
- } else if ("dbcs".equals(args[2])) {
- DBCS.genClass(args);
- } else if ("euctw".equals(args[2])) {
+ boolean isStandard = "stdcs".equals(args[TYPE]);
+ boolean isExtended = "extcs".equals(args[TYPE]);
+ if (isStandard || isExtended) {
+ LinkedHashMap charsets = getCharsets(
+ new File(args[SRC_DIR], args[CHARSETS]));
+ String[] osStdcs = getOSStdCSList(new File(args[SRC_DIR], args[OS]));
+ boolean hasBig5_HKSCS = false;
+ boolean hasMS950_HKSCS_XP = false;
+ for (String name : osStdcs) {
+ Charset cs = charsets.get(name);
+ if (cs != null) {
+ cs.pkgName = "sun.nio.cs";
+ }
+ if (name.equals("Big5_HKSCS")) {
+ hasBig5_HKSCS = true;
+ } else if (name.equals("MS950_HKSCS_XP")) {
+ hasMS950_HKSCS_XP = true;
+ }
+ }
+ for (Charset cs : charsets.values()) {
+ if (isStandard && cs.pkgName.equals("sun.nio.cs.ext") ||
+ isExtended && cs.pkgName.equals("sun.nio.cs")) {
+ continue;
+ }
+ verbose(cs);
+ switch (cs.type) {
+ case "template":
+ SRC.genClass(cs, args[EXT_SRC], args[DST_DIR]);
+ break;
+ case "sbcs":
+ SBCS.genClass(cs, args[SRC_DIR], args[DST_DIR],
+ "SingleByte-X.java.template");
+ break;
+ case "source":
+ break; // source file, do nothing
+ default: // dbcs
+ DBCS.genClass("dbcs".equals(cs.type) ?
+ "" : "_" + cs.type.toUpperCase(Locale.ENGLISH),
+ cs, args[SRC_DIR], args[DST_DIR],
+ "DoubleByte-X.java.template");
+ }
+ }
+ // provider StandardCharsets.java / ExtendedCharsets.java
+ SPI.genClass(args[TYPE], charsets, args[SRC_DIR], args[DST_DIR], args[TEMPLATE]);
+
+ // HKSCSMapping2008/XP.java goes together with Big5/MS950XP_HKSCS
+ if (isStandard && hasBig5_HKSCS || isExtended && !hasBig5_HKSCS) {
+ HKSCS.genClass2008(args[SRC_DIR], args[DST_DIR],
+ isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+ }
+ if (isStandard && hasMS950_HKSCS_XP || isExtended && !hasMS950_HKSCS_XP) {
+ HKSCS.genClassXP(args[SRC_DIR], args[DST_DIR],
+ isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+ }
+ } else if ("euctw".equals(args[TYPE])) {
EUC_TW.genClass(args);
- } else if ("sjis0213".equals(args[2])) {
+ } else if ("sjis0213".equals(args[TYPE])) {
JIS0213.genClass(args);
- } else if ("hkscs".equals(args[2])) {
- HKSCS.genClass(args);
+ } else if ("hkscs".equals(args[TYPE])) {
+ HKSCS.genClass2001(args);
}
}
+
+ private static LinkedHashMap getCharsets(File cslist)
+ throws Throwable
+ {
+ LinkedHashMap charsets = new LinkedHashMap<>();
+ try (Scanner s = new Scanner(cslist)) {
+ Charset cs = null;
+ ArrayList names = new ArrayList<>();
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.startsWith("#") || line.length() == 0) {
+ continue;
+ }
+ String[] tokens = line.split("\\s+");
+ if (tokens.length < 2) {
+ continue;
+ }
+ if ("charset".equals(tokens[0])) {
+ if (cs != null) {
+ cs.aliases = names.toArray(new String[names.size()]);
+ charsets.put(cs.clzName, cs);
+ cs = null;
+ names.clear();
+ }
+ if (tokens.length < 3) {
+ throw new RuntimeException("Error: incorrect charset line [" + line + "]");
+ }
+ if ((cs = charsets.get(tokens[2])) != null) {
+ throw new RuntimeException("Error: deplicate charset line [" + line + "]");
+ }
+ cs = new Charset();
+ cs.csName = tokens[1];
+ cs.clzName = tokens[2];
+ } else {
+ String key = tokens[1]; // leading empty str
+ switch (key) {
+ case "alias":
+ if (tokens.length < 3) {
+ throw new RuntimeException("Error: incorrect alias line [" + line + "]");
+ } else if (names != null) {
+ names.add(tokens[2]); // ALIAS_NAME
+ }
+ break;
+ case "package":
+ cs.pkgName = tokens[2];
+ break;
+ case "type":
+ cs.type = tokens[2];
+ break;
+ case "hisname":
+ cs.hisName = tokens[2];
+ break;
+ case "ascii":
+ cs.isASCII = Boolean.parseBoolean(tokens[2]);
+ break;
+ case "minmax":
+ cs.b1Min = toInteger(tokens[2]);
+ cs.b1Max = toInteger(tokens[3]);
+ cs.b2Min = toInteger(tokens[4]);
+ cs.b2Max = toInteger(tokens[5]);
+ break;
+ case "internal":
+ cs.isInternal = Boolean.parseBoolean(tokens[2]);
+ break;
+ default: // ignore
+ }
+ }
+ }
+ if (cs != null) {
+ cs.aliases = names.toArray(new String[names.size()]);
+ charsets.put(cs.clzName, cs);
+ }
+ }
+ return charsets;
+ }
+
+ private static String[] getOSStdCSList(File stdcsos) throws Throwable
+ {
+ ArrayList names = new ArrayList<>();
+ if (stdcsos.exists()) {
+ try (Scanner s = new Scanner(stdcsos)) {
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ int i = line.indexOf('#');
+ if (i != -1) {
+ line = line.substring(0, i);
+ }
+ line = line.trim();
+ if (line.length() != 0) {
+ names.add(line);
+ }
+ }
+ }
+ }
+ return names.toArray(new String[names.size()]);
+ }
+
+ static void verbose(Charset cs) {
+ System.err.printf("%s, %s, %s, %s, %s %b%n",
+ cs.clzName, cs.csName, cs.hisName, cs.pkgName, cs.type, cs.isASCII);
+ }
+
+ static int toInteger(String s) {
+ return (s.startsWith("0x") || s.startsWith("0X"))
+ ? Integer.valueOf(s.substring(2), 16)
+ : Integer.valueOf(s);
+ }
}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java b/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java
index a7a136dad23..fa294f13b9b 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -30,93 +30,23 @@ import java.util.Arrays;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Formatter;
-import java.util.regex.*;
-import java.nio.charset.*;
+import java.util.regex.Pattern;
import static build.tools.charsetmapping.Utils.*;
public class SBCS {
- public static void genClass(String args[]) throws Exception {
-
- Scanner s = new Scanner(new File(args[0], args[2]));
- while (s.hasNextLine()) {
- String line = s.nextLine();
- if (line.startsWith("#") || line.length() == 0)
- continue;
- String[] fields = line.split("\\s+");
- if (fields.length < 5) {
- System.err.println("Misconfiged sbcs line <" + line + ">?");
- continue;
- }
- String clzName = fields[0];
- String csName = fields[1];
- String hisName = fields[2];
- boolean isASCII = Boolean.valueOf(fields[3]);
- String pkgName = fields[4];
- System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
-
- genClass0(args[0], args[1], "SingleByte-X.java.template",
- clzName, csName, hisName, pkgName, isASCII);
- }
- }
-
- private static void toString(char[] sb, int off, int end,
- Formatter out, String closure,
- boolean comment) {
- while (off < end) {
- out.format(" \"");
- for (int j = 0; j < 8; j++) {
- if (off == end)
- break;
- char c = sb[off++];
- switch (c) {
- case '\b':
- out.format("\\b"); break;
- case '\t':
- out.format("\\t"); break;
- case '\n':
- out.format("\\n"); break;
- case '\f':
- out.format("\\f"); break;
- case '\r':
- out.format("\\r"); break;
- case '\"':
- out.format("\\\""); break;
- case '\'':
- out.format("\\'"); break;
- case '\\':
- out.format("\\\\"); break;
- default:
- out.format("\\u%04X", c & 0xffff);
- }
- }
- if (comment) {
- if (off == end)
- out.format("\" %s // 0x%02x - 0x%02x%n",
- closure, off-8, off-1);
- else
- out.format("\" + // 0x%02x - 0x%02x%n",
- off-8, off-1);
- } else {
- if (off == end)
- out.format("\"%s%n", closure);
- else
- out.format("\" +%n");
- }
- }
- }
-
static Pattern sbmap = Pattern.compile("0x(\\p{XDigit}++)\\s++(?:U\\+|0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
- private static void genClass0(String srcDir, String dstDir,
- String template,
- String clzName,
- String csName,
- String hisName,
- String pkgName,
- boolean isASCII)
+ public static void genClass(Charset cs,
+ String srcDir, String dstDir, String template)
throws Exception
{
+ String clzName = cs.clzName;
+ String csName = cs.csName;
+ String hisName = cs.hisName;
+ String pkgName = cs.pkgName;
+ boolean isASCII = cs.isASCII;
+
StringBuilder b2cSB = new StringBuilder();
StringBuilder b2cNRSB = new StringBuilder();
StringBuilder c2bNRSB = new StringBuilder();
@@ -266,4 +196,50 @@ public class SBCS {
}
out.close();
}
+
+ private static void toString(char[] sb, int off, int end,
+ Formatter out, String closure, boolean comment)
+ {
+ while (off < end) {
+ out.format(" \"");
+ for (int j = 0; j < 8; j++) {
+ if (off == end)
+ break;
+ char c = sb[off++];
+ switch (c) {
+ case '\b':
+ out.format("\\b"); break;
+ case '\t':
+ out.format("\\t"); break;
+ case '\n':
+ out.format("\\n"); break;
+ case '\f':
+ out.format("\\f"); break;
+ case '\r':
+ out.format("\\r"); break;
+ case '\"':
+ out.format("\\\""); break;
+ case '\'':
+ out.format("\\'"); break;
+ case '\\':
+ out.format("\\\\"); break;
+ default:
+ out.format("\\u%04X", c & 0xffff);
+ }
+ }
+ if (comment) {
+ if (off == end)
+ out.format("\" %s // 0x%02x - 0x%02x%n",
+ closure, off-8, off-1);
+ else
+ out.format("\" + // 0x%02x - 0x%02x%n",
+ off-8, off-1);
+ } else {
+ if (off == end)
+ out.format("\"%s%n", closure);
+ else
+ out.format("\" +%n");
+ }
+ }
+ }
}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/SPI.java b/jdk/make/src/classes/build/tools/charsetmapping/SPI.java
new file mode 100644
index 00000000000..e0e2458bc40
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SPI.java
@@ -0,0 +1,141 @@
+/*
+ * 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 build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.Locale;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Scanner;
+
+public class SPI {
+
+ public static void genClass(String type, LinkedHashMap charsets,
+ String srcDir, String dstDir, String template)
+ throws Exception
+ {
+ try (Scanner s = new Scanner(new File(template));
+ PrintStream out = new PrintStream(new FileOutputStream(
+ new File(dstDir, new File(
+ template.replace(".template", "")).getName()))); ) {
+ if (type.startsWith("extcs")) { // ExtendedCharsets.java
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.indexOf("_CHARSETS_DEF_LIST_") == -1) {
+ out.println(line);
+ } else {
+ charsets.values()
+ .stream()
+ .filter(cs -> cs.pkgName.equals("sun.nio.cs.ext") &&
+ !cs.isInternal)
+ .forEach( cs -> {
+ out.printf(" charset(\"%s\", \"%s\",%n", cs.csName, cs.clzName);
+ out.printf(" new String[] {%n");
+ for (String alias : cs.aliases) {
+ out.printf(" \"%s\",%n", alias);
+ }
+ out.printf(" });%n%n");
+ });
+ }
+ }
+ } else if (type.startsWith("stdcs")) { // StandardCharsets.java
+ ArrayList aliasKeys = new ArrayList<>();
+ ArrayList aliasValues = new ArrayList<>();
+ ArrayList clzKeys = new ArrayList<>();
+ ArrayList clzValues = new ArrayList<>();
+ charsets.values()
+ .stream()
+ .filter(cs -> cs.pkgName.equals("sun.nio.cs") &&
+ !cs.isInternal)
+ .forEach( cs -> {
+ String csname = cs.csName.toLowerCase(Locale.ENGLISH);
+ clzKeys.add(csname);
+ clzValues.add("\"" + cs.clzName + "\"");
+ if (cs.aliases != null) {
+ csname = "\"" + csname + "\"";
+ for (String alias : cs.aliases) {
+ aliasKeys.add(alias.toLowerCase(Locale.ENGLISH));
+ aliasValues.add(csname);
+ }
+ }
+ });
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.indexOf("_INCLUDE_ALIASES_TABLES_") != -1) {
+ charsets.values()
+ .stream()
+ .filter(cs -> cs.pkgName.equals("sun.nio.cs"))
+ .forEach( cs -> {
+ if (cs.aliases == null || cs.aliases.length == 0) {
+ out.printf(" static final String[] aliases_%s = null;%n%n",
+ cs.clzName);
+ } else {
+ // non-final for SJIS and MS932 to support sun.nio.cs.map
+ if (cs.clzName.equals("SJIS") || cs.clzName.equals("MS932")) {
+ out.printf(" static String[] aliases_%s = new String[] {%n",
+ cs.clzName);
+ } else {
+ out.printf(" static final String[] aliases_%s = new String[] {%n",
+ cs.clzName);
+ }
+ for (String alias : cs.aliases) {
+ out.printf(" \"%s\",%n", alias);
+ }
+ out.printf(" };%n%n");
+ }
+ });
+ Charset cs = charsets.get("SJIS");
+ if (cs == null || cs.pkgName.equals("sun.nio.cs.ext")) {
+ // StandardCharsets.java has explicit reference
+ // to aliases_SJIS/MS932. If we don't have these
+ // two in std, just put a pair of dummy fields to
+ // make the compiler happy.
+ out.printf(" static String[] aliases_SJIS = null;%n%n");
+ out.printf(" static String[] aliases_MS932 = null;%n%n");
+ }
+ } else if (line.indexOf("_INCLUDE_ALIASES_MAP_") != -1) {
+ Hasher.genClass(out, aliasKeys, aliasValues,
+ null, "Aliases", "String",
+ 11, 3, true, false, false);
+ } else if (line.indexOf("_INCLUDE_CLASSES_MAP_") != -1) {
+ Hasher.genClass(out, clzKeys, clzValues,
+ null, "Classes", "String",
+ 11, 3, true, false, false);
+ } else if (line.indexOf("_INCLUDE_CACHE_MAP_") != -1) {
+ Hasher.genClass(out, clzKeys, clzValues,
+ null, "Cache", "Charset",
+ 11, 3, true, true, false);
+ } else {
+ out.println(line);
+ }
+ }
+ } else {
+ throw new RuntimeException("Unknown type:" + type);
+ }
+ }
+
+ }
+}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/SRC.java b/jdk/make/src/classes/build/tools/charsetmapping/SRC.java
new file mode 100644
index 00000000000..326f3c181b8
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SRC.java
@@ -0,0 +1,64 @@
+/*
+ * 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 build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.Scanner;
+
+public class SRC {
+
+ public static void genClass(Charset cs, String srcDir, String dstDir)
+ throws Exception
+ {
+ String clzName = cs.clzName;
+ String csName = cs.csName;
+ String pkgName = cs.pkgName;
+
+ try (Scanner s = new Scanner(new File(srcDir, clzName + ".java.template"));
+ PrintStream out = new PrintStream(new FileOutputStream(
+ new File(dstDir, clzName + ".java")));) {
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.indexOf("$") < 0) {
+ out.println(line);
+ continue;
+ }
+ if (line.indexOf("$PACKAGE$") != -1) {
+ out.println(line.replace("$PACKAGE$", pkgName));
+ } else if (line.indexOf("$ALIASES$") != -1) {
+ if ("sun.nio.cs".equals(pkgName))
+ out.println(line.replace("$ALIASES$",
+ "StandardCharsets.aliases_" + clzName));
+ else
+ out.println(line.replace("$ALIASES$",
+ "ExtendedCharsets.aliasesFor(\"" + csName + "\")"));
+ } else {
+ out.println(line);
+ }
+ }
+ }
+ }
+}
diff --git a/jdk/make/src/classes/build/tools/module/boot.modules b/jdk/make/src/classes/build/tools/module/boot.modules
index 4a32709ea89..03b4b0eca90 100644
--- a/jdk/make/src/classes/build/tools/module/boot.modules
+++ b/jdk/make/src/classes/build/tools/module/boot.modules
@@ -1,8 +1,7 @@
java.base
+java.compiler
java.datatransfer
java.desktop
-java.compiler
-java.corba
java.instrument
java.logging
java.management
@@ -15,7 +14,6 @@ java.security.sasl
java.smartcardio
java.sql
java.sql.rowset
-java.transaction
java.xml
java.xml.crypto
jdk.charsets
@@ -23,9 +21,9 @@ jdk.deploy
jdk.deploy.osx
jdk.hprof.agent
jdk.httpserver
+jdk.jfr
jdk.naming.rmi
jdk.sctp
jdk.security.auth
jdk.security.jgss
-jdk.jfr
jdk.snmp
diff --git a/jdk/make/src/classes/build/tools/module/ext.modules b/jdk/make/src/classes/build/tools/module/ext.modules
index 882ead8ce76..934d4e9ba16 100644
--- a/jdk/make/src/classes/build/tools/module/ext.modules
+++ b/jdk/make/src/classes/build/tools/module/ext.modules
@@ -1,7 +1,10 @@
java.activation
java.annotations.common
+java.corba
+java.transaction
java.xml.bind
java.xml.ws
+jdk.accessbridge
jdk.crypto.ec
jdk.crypto.mscapi
jdk.crypto.pkcs11
@@ -10,4 +13,3 @@ jdk.localedata
jdk.naming.dns
jdk.scripting.nashorn
jdk.zipfs
-jdk.accessbridge
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java
index 8b0ba28e898..ee747c8e36c 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015 Red Hat, Inc.
* 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,9 +29,7 @@
package com.sun.crypto.provider;
-import java.util.Arrays;
-import java.security.*;
-import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
+import java.security.ProviderException;
/**
* This class represents the GHASH function defined in NIST 800-38D
@@ -44,62 +43,90 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
*/
final class GHASH {
- private static final byte P128 = (byte) 0xe1; //reduction polynomial
-
- private static boolean getBit(byte[] b, int pos) {
- int p = pos / 8;
- pos %= 8;
- int i = (b[p] >>> (7 - pos)) & 1;
- return i != 0;
+ private static long getLong(byte[] buffer, int offset) {
+ long result = 0;
+ int end = offset + 8;
+ for (int i = offset; i < end; ++i) {
+ result = (result << 8) + (buffer[i] & 0xFF);
+ }
+ return result;
}
- private static void shift(byte[] b) {
- byte temp, temp2;
- temp2 = 0;
- for (int i = 0; i < b.length; i++) {
- temp = (byte) ((b[i] & 0x01) << 7);
- b[i] = (byte) ((b[i] & 0xff) >>> 1);
- b[i] = (byte) (b[i] | temp2);
- temp2 = temp;
+ private static void putLong(byte[] buffer, int offset, long value) {
+ int end = offset + 8;
+ for (int i = end - 1; i >= offset; --i) {
+ buffer[i] = (byte) value;
+ value >>= 8;
}
}
- // Given block X and Y, returns the muliplication of X * Y
- private static byte[] blockMult(byte[] x, byte[] y) {
- if (x.length != AES_BLOCK_SIZE || y.length != AES_BLOCK_SIZE) {
- throw new RuntimeException("illegal input sizes");
- }
- byte[] z = new byte[AES_BLOCK_SIZE];
- byte[] v = y.clone();
- // calculate Z1-Z127 and V1-V127
- for (int i = 0; i < 127; i++) {
+ private static final int AES_BLOCK_SIZE = 16;
+
+ // Multiplies state0, state1 by V0, V1.
+ private void blockMult(long V0, long V1) {
+ long Z0 = 0;
+ long Z1 = 0;
+ long X;
+
+ // Separate loops for processing state0 and state1.
+ X = state0;
+ for (int i = 0; i < 64; i++) {
// Zi+1 = Zi if bit i of x is 0
- if (getBit(x, i)) {
- for (int n = 0; n < z.length; n++) {
- z[n] ^= v[n];
- }
- }
- boolean lastBitOfV = getBit(v, 127);
- shift(v);
- if (lastBitOfV) v[0] ^= P128;
+ long mask = X >> 63;
+ Z0 ^= V0 & mask;
+ Z1 ^= V1 & mask;
+
+ // Save mask for conditional reduction below.
+ mask = (V1 << 63) >> 63;
+
+ // V = rightshift(V)
+ long carry = V0 & 1;
+ V0 = V0 >>> 1;
+ V1 = (V1 >>> 1) | (carry << 63);
+
+ // Conditional reduction modulo P128.
+ V0 ^= 0xe100000000000000L & mask;
+ X <<= 1;
}
+
+ X = state1;
+ for (int i = 64; i < 127; i++) {
+ // Zi+1 = Zi if bit i of x is 0
+ long mask = X >> 63;
+ Z0 ^= V0 & mask;
+ Z1 ^= V1 & mask;
+
+ // Save mask for conditional reduction below.
+ mask = (V1 << 63) >> 63;
+
+ // V = rightshift(V)
+ long carry = V0 & 1;
+ V0 = V0 >>> 1;
+ V1 = (V1 >>> 1) | (carry << 63);
+
+ // Conditional reduction.
+ V0 ^= 0xe100000000000000L & mask;
+ X <<= 1;
+ }
+
// calculate Z128
- if (getBit(x, 127)) {
- for (int n = 0; n < z.length; n++) {
- z[n] ^= v[n];
- }
- }
- return z;
+ long mask = X >> 63;
+ Z0 ^= V0 & mask;
+ Z1 ^= V1 & mask;
+
+ // Save result.
+ state0 = Z0;
+ state1 = Z1;
}
// hash subkey H; should not change after the object has been constructed
- private final byte[] subkeyH;
+ private final long subkeyH0, subkeyH1;
// buffer for storing hash
- private byte[] state;
+ private long state0, state1;
// variables for save/restore calls
- private byte[] stateSave = null;
+ private long stateSave0, stateSave1;
/**
* Initializes the cipher in the specified mode with the given key
@@ -114,8 +141,8 @@ final class GHASH {
if ((subkeyH == null) || subkeyH.length != AES_BLOCK_SIZE) {
throw new ProviderException("Internal error");
}
- this.subkeyH = subkeyH;
- this.state = new byte[AES_BLOCK_SIZE];
+ this.subkeyH0 = getLong(subkeyH, 0);
+ this.subkeyH1 = getLong(subkeyH, 8);
}
/**
@@ -124,31 +151,33 @@ final class GHASH {
* this object for different data w/ the same H.
*/
void reset() {
- Arrays.fill(state, (byte) 0);
+ state0 = 0;
+ state1 = 0;
}
/**
* Save the current snapshot of this GHASH object.
*/
void save() {
- stateSave = state.clone();
+ stateSave0 = state0;
+ stateSave1 = state1;
}
/**
* Restores this object using the saved snapshot.
*/
void restore() {
- state = stateSave;
+ state0 = stateSave0;
+ state1 = stateSave1;
}
private void processBlock(byte[] data, int ofs) {
if (data.length - ofs < AES_BLOCK_SIZE) {
throw new RuntimeException("need complete block");
}
- for (int n = 0; n < state.length; n++) {
- state[n] ^= data[ofs + n];
- }
- state = blockMult(state, subkeyH);
+ state0 ^= getLong(data, ofs);
+ state1 ^= getLong(data, ofs + 8);
+ blockMult(subkeyH0, subkeyH1);
}
void update(byte[] in) {
@@ -169,10 +198,10 @@ final class GHASH {
}
byte[] digest() {
- try {
- return state.clone();
- } finally {
- reset();
- }
+ byte[] result = new byte[AES_BLOCK_SIZE];
+ putLong(result, 0, state0);
+ putLong(result, 8, state1);
+ reset();
+ return result;
}
}
diff --git a/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java b/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java
index d70c73b19c9..fc5439e625b 100644
--- a/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java
@@ -28,9 +28,10 @@ package java.io;
/**
* A PushbackInputStream adds
* functionality to another input stream, namely
- * the ability to "push back" or "unread"
- * one byte. This is useful in situations where
- * it is convenient for a fragment of code
+ * the ability to "push back" or "unread" bytes,
+ * by storing pushed-back bytes in an internal buffer.
+ * This is useful in situations where
+ * it is convenient for a fragment of code
* to read an indefinite number of data bytes
* that are delimited by a particular byte
* value; after reading the terminating byte,
@@ -77,11 +78,9 @@ class PushbackInputStream extends FilterInputStream {
/**
* Creates a PushbackInputStream
* with a pushback buffer of the specified size,
- * and saves its argument, the input stream
+ * and saves its argument, the input stream
* in, for later use. Initially,
- * there is no pushed-back byte (the field
- * pushBack is initialized to
- * -1).
+ * the pushback buffer is empty.
*
* @param in the input stream from which bytes will be read.
* @param size the size of the pushback buffer.
@@ -99,11 +98,9 @@ class PushbackInputStream extends FilterInputStream {
/**
* Creates a PushbackInputStream
- * and saves its argument, the input stream
+ * with a 1-byte pushback buffer, and saves its argument, the input stream
* in, for later use. Initially,
- * there is no pushed-back byte (the field
- * pushBack is initialized to
- * -1).
+ * the pushback buffer is empty.
*
* @param in the input stream from which bytes will be read.
*/
diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
index a62594383fc..72b260309d6 100644
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
@@ -951,9 +951,6 @@ public final class ProcessBuilder
* {@code command} array as its argument. This may result in
* a {@link SecurityException} being thrown.
*
- *
If the operating system does not support the creation of
- * processes, an {@link UnsupportedOperationException} will be thrown.
- *
*
Starting an operating system process is highly system-dependent.
* Among the many things that can go wrong are:
*
@@ -967,6 +964,9 @@ public final class ProcessBuilder
* of the exception is system-dependent, but it will always be a
* subclass of {@link IOException}.
*
+ *
If the operating system does not support the creation of
+ * processes, an {@link UnsupportedOperationException} will be thrown.
+ *
*
Subsequent modifications to this process builder will not
* affect the returned {@link Process}.
*
diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java
index 98bfe2887b5..114f6cb968f 100644
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java
@@ -564,9 +564,6 @@ public class Runtime {
* cmdarray as its argument. This may result in a
* {@link SecurityException} being thrown.
*
- *
If the operating system does not support the creation of
- * processes, an {@link UnsupportedOperationException} will be thrown.
- *
*
Starting an operating system process is highly system-dependent.
* Among the many things that can go wrong are:
*
@@ -579,6 +576,9 @@ public class Runtime {
* of the exception is system-dependent, but it will always be a
* subclass of {@link IOException}.
*
+ *
If the operating system does not support the creation of
+ * processes, an {@link UnsupportedOperationException} will be thrown.
+ *
*
* @param cmdarray array containing the command to call and
* its arguments.
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
index 9d8db4eef78..421db68b464 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
@@ -285,6 +285,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
// Forward the SAM method
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
samMethodType.toMethodDescriptorString(), null, null);
+ mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
new ForwardingMethodGenerator(mv).generate(samMethodType);
// Forward the bridges
@@ -292,6 +293,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
for (MethodType mt : additionalBridges) {
mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
mt.toMethodDescriptorString(), null, null);
+ mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
new ForwardingMethodGenerator(mv).generate(mt);
}
}
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java b/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java
index ee82de46946..45a2525ec0f 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java
@@ -662,7 +662,7 @@ public abstract class Executable extends AccessibleObject
*
* If this {@code Executable} object represents a static method or
* represents a constructor of a top level, static member, local, or
- * anoymous class, then the return value is null.
+ * anonymous class, then the return value is null.
*
* @return an object representing the receiver type of the method or
* constructor represented by this {@code Executable} or {@code null} if
diff --git a/jdk/src/java.base/share/classes/java/math/BigDecimal.java b/jdk/src/java.base/share/classes/java/math/BigDecimal.java
index 1ea1e8276c5..f4fffc871a4 100644
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -4814,41 +4814,61 @@ public class BigDecimal extends Number implements Comparable {
if (dividendHi >= divisor) {
return null;
}
+
final int shift = Long.numberOfLeadingZeros(divisor);
divisor <<= shift;
final long v1 = divisor >>> 32;
final long v0 = divisor & LONG_MASK;
- long q1, q0;
- long r_tmp;
-
long tmp = dividendLo << shift;
long u1 = tmp >>> 32;
long u0 = tmp & LONG_MASK;
tmp = (dividendHi << shift) | (dividendLo >>> 64 - shift);
long u2 = tmp & LONG_MASK;
- tmp = divWord(tmp,v1);
- q1 = tmp & LONG_MASK;
- r_tmp = tmp >>> 32;
+ long q1, r_tmp;
+ if (v1 == 1) {
+ q1 = tmp;
+ r_tmp = 0;
+ } else if (tmp >= 0) {
+ q1 = tmp / v1;
+ r_tmp = tmp - q1 * v1;
+ } else {
+ long[] rq = divRemNegativeLong(tmp, v1);
+ q1 = rq[1];
+ r_tmp = rq[0];
+ }
+
while(q1 >= DIV_NUM_BASE || unsignedLongCompare(q1*v0, make64(r_tmp, u1))) {
q1--;
r_tmp += v1;
if (r_tmp >= DIV_NUM_BASE)
break;
}
+
tmp = mulsub(u2,u1,v1,v0,q1);
u1 = tmp & LONG_MASK;
- tmp = divWord(tmp,v1);
- q0 = tmp & LONG_MASK;
- r_tmp = tmp >>> 32;
+ long q0;
+ if (v1 == 1) {
+ q0 = tmp;
+ r_tmp = 0;
+ } else if (tmp >= 0) {
+ q0 = tmp / v1;
+ r_tmp = tmp - q0 * v1;
+ } else {
+ long[] rq = divRemNegativeLong(tmp, v1);
+ q0 = rq[1];
+ r_tmp = rq[0];
+ }
+
while(q0 >= DIV_NUM_BASE || unsignedLongCompare(q0*v0,make64(r_tmp,u0))) {
q0--;
r_tmp += v1;
if (r_tmp >= DIV_NUM_BASE)
break;
}
+
if((int)q1 < 0) {
// result (which is positive and unsigned here)
// can't fit into long due to sign bit is used for value
@@ -4871,10 +4891,13 @@ public class BigDecimal extends Number implements Comparable {
}
}
}
+
long q = make64(q1,q0);
q*=sign;
+
if (roundingMode == ROUND_DOWN && scale == preferredScale)
return valueOf(q, scale);
+
long r = mulsub(u1, u0, v1, v0, q0) >>> shift;
if (r != 0) {
boolean increment = needIncrement(divisor >>> shift, roundingMode, sign, q, r);
@@ -4917,28 +4940,35 @@ public class BigDecimal extends Number implements Comparable {
}
}
- private static long divWord(long n, long dLong) {
- long r;
- long q;
- if (dLong == 1) {
- q = (int)n;
- return (q & LONG_MASK);
- }
+ /**
+ * Calculate the quotient and remainder of dividing a negative long by
+ * another long.
+ *
+ * @param n the numerator; must be negative
+ * @param d the denominator; must not be unity
+ * @return a two-element {@long} array with the remainder and quotient in
+ * the initial and final elements, respectively
+ */
+ private static long[] divRemNegativeLong(long n, long d) {
+ assert n < 0 : "Non-negative numerator " + n;
+ assert d != 1 : "Unity denominator";
+
// Approximate the quotient and remainder
- q = (n >>> 1) / (dLong >>> 1);
- r = n - q*dLong;
+ long q = (n >>> 1) / (d >>> 1);
+ long r = n - q * d;
// Correct the approximation
while (r < 0) {
- r += dLong;
+ r += d;
q--;
}
- while (r >= dLong) {
- r -= dLong;
+ while (r >= d) {
+ r -= d;
q++;
}
- // n - q*dlong == r && 0 <= r The type of the socket option value
* @param name The socket option
* @param value The value of the socket option. A value of {@code null}
* may be valid for some options.
@@ -1342,6 +1343,7 @@ class DatagramSocket implements java.io.Closeable {
/**
* Returns the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return The value of the socket option.
diff --git a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java
index 2abaaf9a237..0726dc4cce7 100644
--- a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -267,6 +267,7 @@ public abstract class DatagramSocketImpl implements SocketOptions {
/**
* Called to set a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @param value The value of the socket option. A value of {@code null}
@@ -276,7 +277,7 @@ public abstract class DatagramSocketImpl implements SocketOptions {
* support the option
*
* @throws NullPointerException if name is {@code null}
- *
+ * @throws IOException if an I/O problem occurs while attempting to set the option
* @since 1.9
*/
protected void setOption(SocketOption name, T value) throws IOException {
@@ -308,12 +309,15 @@ public abstract class DatagramSocketImpl implements SocketOptions {
/**
* Called to get a socket option.
*
+ * @return the socket option
+ * @param The type of the socket option value
* @param name The socket option
*
* @throws UnsupportedOperationException if the DatagramSocketImpl does not
* support the option
*
* @throws NullPointerException if name is {@code null}
+ * @throws IOException if an I/O problem occurs while attempting to set the option
*
* @since 1.9
*/
diff --git a/jdk/src/java.base/share/classes/java/net/ServerSocket.java b/jdk/src/java.base/share/classes/java/net/ServerSocket.java
index 32f1b907517..af0c5152d9a 100644
--- a/jdk/src/java.base/share/classes/java/net/ServerSocket.java
+++ b/jdk/src/java.base/share/classes/java/net/ServerSocket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -924,6 +924,7 @@ class ServerSocket implements java.io.Closeable {
/**
* Sets the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
* @param value The value of the socket option. A value of {@code null}
* may be valid for some options.
@@ -957,6 +958,7 @@ class ServerSocket implements java.io.Closeable {
/**
* Returns the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return The value of the socket option.
diff --git a/jdk/src/java.base/share/classes/java/net/Socket.java b/jdk/src/java.base/share/classes/java/net/Socket.java
index e637b32baa7..a0ca24e5224 100644
--- a/jdk/src/java.base/share/classes/java/net/Socket.java
+++ b/jdk/src/java.base/share/classes/java/net/Socket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -1727,6 +1727,7 @@ class Socket implements java.io.Closeable {
/**
* Sets the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
* @param value The value of the socket option. A value of {@code null}
* may be valid for some options.
@@ -1758,6 +1759,7 @@ class Socket implements java.io.Closeable {
/**
* Returns the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return The value of the socket option.
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 962d20167de..600c68457af 100644
--- a/jdk/src/java.base/share/classes/java/net/SocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/SocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -362,6 +362,7 @@ public abstract class SocketImpl implements SocketOptions {
/**
* Called to set a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @param value The value of the socket option. A value of {@code null}
@@ -397,6 +398,7 @@ public abstract class SocketImpl implements SocketOptions {
/**
* Called to get a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return the value of the named option
diff --git a/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java b/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java
index d7046808ffe..f707de5d79f 100644
--- a/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java
+++ b/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java
@@ -35,7 +35,7 @@ import java.nio.channels.spi.*;
*
A pipe consists of a pair of channels: A writable {@link
* Pipe.SinkChannel sink} channel and a readable {@link Pipe.SourceChannel source}
* channel. Once some bytes are written to the sink channel they can be read
- * from source channel in exactlyAthe order in which they were written.
+ * from the source channel in exactly the order in which they were written.
*
*
Whether or not a thread writing bytes to a pipe will block until another
* thread reads those bytes, or some previously-written bytes, from the pipe is
diff --git a/jdk/src/java.base/share/classes/java/security/KeyStore.java b/jdk/src/java.base/share/classes/java/security/KeyStore.java
index 34c246f4b86..71df7dbd5a2 100644
--- a/jdk/src/java.base/share/classes/java/security/KeyStore.java
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, 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
@@ -1618,11 +1618,13 @@ public class KeyStore {
* integrity check.
*
*
- * This method traverses the list of registered security {@link Providers},
- * starting with the most preferred Provider.
- * For each {@link KeyStoreSpi} implementation supported by a Provider,
- * it invokes the {@link engineProbe} method to determine if it supports
- * the specified keystore.
+ * This method traverses the list of registered security
+ * {@linkplain Provider providers}, starting with the most
+ * preferred Provider.
+ * For each {@link KeyStoreSpi} implementation supported by a
+ * Provider, it invokes the {@link
+ * KeyStoreSpi#engineProbe(InputStream) engineProbe} method to
+ * determine if it supports the specified keystore.
* A new KeyStore object is returned that encapsulates the KeyStoreSpi
* implementation from the first Provider that supports the specified file.
*
@@ -1672,11 +1674,12 @@ public class KeyStore {
* unlock the keystore data or perform an integrity check.
*
*
- * This method traverses the list of registered security {@link Providers},
- * starting with the most preferred Provider.
- * For each {@link KeyStoreSpi} implementation supported by a Provider,
- * it invokes the {@link engineProbe} method to determine if it supports
- * the specified keystore.
+ * This method traverses the list of registered security {@linkplain
+ * Provider providers}, starting with the most preferred Provider.
+ * For each {@link KeyStoreSpi} implementation supported by a
+ * Provider, it invokes the {@link
+ * KeyStoreSpi#engineProbe(InputStream) engineProbe} method to
+ * determine if it supports the specified keystore.
* A new KeyStore object is returned that encapsulates the KeyStoreSpi
* implementation from the first Provider that supports the specified file.
*
diff --git a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
index e7c7ac020bd..36c8d90f0f2 100644
--- a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
+++ b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
@@ -144,10 +144,14 @@ class ComparableTimSort {
* large) stack lengths for smaller arrays. The "magic numbers" in the
* computation below must be changed if MIN_MERGE is decreased. See
* the MIN_MERGE declaration above for more information.
+ * The maximum value of 49 allows for an array up to length
+ * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+ * increasing scenario. More explanations are given in section 4 of:
+ * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
- len < 119151 ? 24 : 40);
+ len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
diff --git a/jdk/src/java.base/share/classes/java/util/Optional.java b/jdk/src/java.base/share/classes/java/util/Optional.java
index eb8301b2361..21fef4c13e0 100644
--- a/jdk/src/java.base/share/classes/java/util/Optional.java
+++ b/jdk/src/java.base/share/classes/java/util/Optional.java
@@ -38,8 +38,8 @@ import java.util.stream.Stream;
*
Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(java.lang.Object) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -148,16 +148,35 @@ public final class Optional {
}
/**
- * If a value is present, invoke the specified consumer with the value,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if a value is present and {@code action} is
* null
*/
- public void ifPresent(Consumer super T> consumer) {
+ public void ifPresent(Consumer super T> action) {
if (value != null) {
- consumer.accept(value);
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(Consumer super T> action, Runnable emptyAction) {
+ if (value != null) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
}
}
diff --git a/jdk/src/java.base/share/classes/java/util/OptionalDouble.java b/jdk/src/java.base/share/classes/java/util/OptionalDouble.java
index e699c53d517..3de841e80f4 100644
--- a/jdk/src/java.base/share/classes/java/util/OptionalDouble.java
+++ b/jdk/src/java.base/share/classes/java/util/OptionalDouble.java
@@ -37,8 +37,8 @@ import java.util.stream.DoubleStream;
*
Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(double) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -131,16 +131,35 @@ public final class OptionalDouble {
}
/**
- * Have the specified consumer accept the value if a value is present,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if a value is present and {@code action} is
* null
*/
- public void ifPresent(DoubleConsumer consumer) {
+ public void ifPresent(DoubleConsumer action) {
if (isPresent) {
- consumer.accept(value);
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(DoubleConsumer action, Runnable emptyAction) {
+ if (isPresent) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
}
}
diff --git a/jdk/src/java.base/share/classes/java/util/OptionalInt.java b/jdk/src/java.base/share/classes/java/util/OptionalInt.java
index d8d9382633d..38b9bd0294c 100644
--- a/jdk/src/java.base/share/classes/java/util/OptionalInt.java
+++ b/jdk/src/java.base/share/classes/java/util/OptionalInt.java
@@ -37,8 +37,8 @@ import java.util.stream.IntStream;
*
Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(int) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -131,16 +131,35 @@ public final class OptionalInt {
}
/**
- * Have the specified consumer accept the value if a value is present,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if value is present and {@code action} is
* null
*/
- public void ifPresent(IntConsumer consumer) {
+ public void ifPresent(IntConsumer action) {
if (isPresent) {
- consumer.accept(value);
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(IntConsumer action, Runnable emptyAction) {
+ if (isPresent) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
}
}
diff --git a/jdk/src/java.base/share/classes/java/util/OptionalLong.java b/jdk/src/java.base/share/classes/java/util/OptionalLong.java
index 4e2a44873b3..d6d56b9aee4 100644
--- a/jdk/src/java.base/share/classes/java/util/OptionalLong.java
+++ b/jdk/src/java.base/share/classes/java/util/OptionalLong.java
@@ -37,8 +37,8 @@ import java.util.stream.LongStream;
*
Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(long) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -131,16 +131,35 @@ public final class OptionalLong {
}
/**
- * Have the specified consumer accept the value if a value is present,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if a value is present and {@code action} is
* null
*/
- public void ifPresent(LongConsumer consumer) {
+ public void ifPresent(LongConsumer action) {
if (isPresent) {
- consumer.accept(value);
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(LongConsumer action, Runnable emptyAction) {
+ if (isPresent) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
}
}
diff --git a/jdk/src/java.base/share/classes/java/util/TimSort.java b/jdk/src/java.base/share/classes/java/util/TimSort.java
index 9966f74df37..ea0d58f5a85 100644
--- a/jdk/src/java.base/share/classes/java/util/TimSort.java
+++ b/jdk/src/java.base/share/classes/java/util/TimSort.java
@@ -174,10 +174,14 @@ class TimSort {
* large) stack lengths for smaller arrays. The "magic numbers" in the
* computation below must be changed if MIN_MERGE is decreased. See
* the MIN_MERGE declaration above for more information.
+ * The maximum value of 49 allows for an array up to length
+ * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+ * increasing scenario. More explanations are given in section 4 of:
+ * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
- len < 119151 ? 24 : 40);
+ len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
diff --git a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
index c3bcfcc07c0..b22e9b936b4 100644
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
@@ -5819,6 +5819,10 @@ NEXT: while (i <= last) {
MatcherIterator() {
this.matcher = matcher(input);
+ // If the input is an empty string then the result can only be a
+ // stream of the input. Induce that by setting the empty
+ // element count to 1
+ this.emptyElementCount = input.length() == 0 ? 1 : 0;
}
public String next() {
diff --git a/jdk/src/java.base/share/classes/java/util/stream/Stream.java b/jdk/src/java.base/share/classes/java/util/stream/Stream.java
index bd915796272..0070658b01f 100644
--- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java
@@ -987,6 +987,21 @@ public interface Stream extends BaseStream> {
return StreamSupport.stream(new Streams.StreamBuilderImpl<>(t), false);
}
+ /**
+ * Returns a sequential {@code Stream} containing a single element, if
+ * non-null, otherwise returns an empty {@code Stream}.
+ *
+ * @param t the single element
+ * @param the type of stream elements
+ * @return a stream with a single element if the specified element
+ * is non-null, otherwise an empty stream
+ * @since 1.9
+ */
+ public static Stream ofNullable(T t) {
+ return t == null ? Stream.empty()
+ : StreamSupport.stream(new Streams.StreamBuilderImpl<>(t), false);
+ }
+
/**
* Returns a sequential ordered stream whose elements are the specified values.
*
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java b/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java
index dd0fd23fd15..e10a9400280 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java
@@ -111,6 +111,12 @@ public class AbstractCharsetProvider
}
}
+ protected boolean hasCharset(String name) {
+ synchronized (this) {
+ return classMap.containsKey(name);
+ }
+ }
+
/* Late initialization hook, needed by some providers
*/
protected void init() { }
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java b/jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java
similarity index 96%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java
rename to jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java
index 13b49755a1c..efbaf687797 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -34,7 +34,7 @@ import java.nio.charset.CoderResult;
* when normal inheritance cannot be used.
* Used by autodecting decoders.
*/
-interface DelegatableDecoder {
+public interface DelegatableDecoder {
CoderResult decodeLoop(ByteBuffer src, CharBuffer dst);
void implReset();
CoderResult implFlush(CharBuffer out);
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java b/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java
similarity index 97%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java
rename to jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java
index ddc19044cf4..7b55339cab1 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -130,9 +130,9 @@ public class DoubleByte {
return CoderResult.unmappableForLength(2);
}
- Decoder(Charset cs, float avgcpb, float maxcpb,
- char[][] b2c, char[] b2cSB,
- int b2Min, int b2Max) {
+ public Decoder(Charset cs, float avgcpb, float maxcpb,
+ char[][] b2c, char[] b2cSB,
+ int b2Min, int b2Max) {
super(cs, avgcpb, maxcpb);
this.b2c = b2c;
this.b2cSB = b2cSB;
@@ -140,7 +140,7 @@ public class DoubleByte {
this.b2Max = b2Max;
}
- Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+ public Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
this(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max);
}
@@ -273,7 +273,7 @@ public class DoubleByte {
private static final int SI = 0x0f;
private int currentState;
- Decoder_EBCDIC(Charset cs,
+ public Decoder_EBCDIC(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, b2c, b2cSB, b2Min, b2Max);
}
@@ -451,7 +451,7 @@ public class DoubleByte {
b2cSB_UNMAPPABLE = new char[0x100];
Arrays.fill(b2cSB_UNMAPPABLE, UNMAPPABLE_DECODING);
}
- Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+ public Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, 0.5f, 1.0f, b2c, b2cSB_UNMAPPABLE, b2Min, b2Max);
}
}
@@ -463,7 +463,7 @@ public class DoubleByte {
private final int SS2 = 0x8E;
private final int SS3 = 0x8F;
- Decoder_EUC_SIM(Charset cs,
+ public Decoder_EUC_SIM(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, b2c, b2cSB, b2Min, b2Max);
}
@@ -511,18 +511,18 @@ public class DoubleByte {
public static class Encoder extends CharsetEncoder
implements ArrayEncoder
{
- final int MAX_SINGLEBYTE = 0xff;
+ protected final int MAX_SINGLEBYTE = 0xff;
private final char[] c2b;
private final char[] c2bIndex;
- Surrogate.Parser sgp;
+ protected Surrogate.Parser sgp;
- protected Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f);
this.c2b = c2b;
this.c2bIndex = c2bIndex;
}
- Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
+ public Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
super(cs, avg, max, repl);
this.c2b = c2b;
this.c2bIndex = c2bIndex;
@@ -532,7 +532,7 @@ public class DoubleByte {
return encodeChar(c) != UNMAPPABLE_ENCODING;
}
- Surrogate.Parser sgp() {
+ protected Surrogate.Parser sgp() {
if (sgp == null)
sgp = new Surrogate.Parser();
return sgp;
@@ -657,7 +657,7 @@ public class DoubleByte {
}
// init the c2b and c2bIndex tables from b2c.
- static void initC2B(String[] b2c, String b2cSB, String b2cNR, String c2bNR,
+ public static void initC2B(String[] b2c, String b2cSB, String b2cNR, String c2bNR,
int b2Min, int b2Max,
char[] c2b, char[] c2bIndex)
{
@@ -741,7 +741,7 @@ public class DoubleByte {
}
public static class Encoder_DBCSONLY extends Encoder {
- Encoder_DBCSONLY(Charset cs, byte[] repl,
+ public Encoder_DBCSONLY(Charset cs, byte[] repl,
char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex);
}
@@ -764,7 +764,7 @@ public class DoubleByte {
protected int currentState = SBCS;
- Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, 4.0f, 5.0f, new byte[] {(byte)0x6f}, c2b, c2bIndex);
}
@@ -921,7 +921,7 @@ public class DoubleByte {
// EUC_SIMPLE
public static class Encoder_EUC_SIM extends Encoder {
- Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, c2b, c2bIndex);
}
}
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
similarity index 98%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java
rename to jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
index 07be74d9581..ba22341ae85 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -32,6 +32,7 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.Surrogate;
import static sun.nio.cs.CharsetMapping.*;
@@ -216,7 +217,7 @@ public class HKSCS {
return decodeBufferLoop(src, dst);
}
- static void initb2c(char[][]b2c, String[] b2cStr)
+ public static void initb2c(char[][]b2c, String[] b2cStr)
{
for (int i = 0; i < b2cStr.length; i++) {
if (b2cStr[i] == null)
@@ -395,7 +396,7 @@ public class HKSCS {
Arrays.fill(C2B_UNMAPPABLE, (char)UNMAPPABLE_ENCODING);
}
- static void initc2b(char[][] c2b, String[] b2cStr, String pua) {
+ public static void initc2b(char[][] c2b, String[] b2cStr, String pua) {
// init c2b/c2bSupp from b2cStr and supp
int b2Min = 0x40;
Arrays.fill(c2b, C2B_UNMAPPABLE);
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java b/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java
index bf9146c40f7..093d1aaea3a 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java
@@ -160,22 +160,18 @@ public class SingleByte
byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
+ int len = Math.min(dl - dp, sl - sp);
- CoderResult cr = CoderResult.UNDERFLOW;
- if ((dl - dp) < (sl - sp)) {
- sl = sp + (dl - dp);
- cr = CoderResult.OVERFLOW;
- }
-
- while (sp < sl) {
+ while (len-- > 0) {
char c = sa[sp];
int b = encode(c);
if (b == UNMAPPABLE_ENCODING) {
if (Character.isSurrogate(c)) {
if (sgp == null)
sgp = new Surrogate.Parser();
- if (sgp.parse(c, sa, sp, sl) < 0)
+ if (sgp.parse(c, sa, sp, sl) < 0) {
return withResult(sgp.error(), src, sp, dst, dp);
+ }
return withResult(sgp.unmappableResult(), src, sp, dst, dp);
}
return withResult(CoderResult.unmappableForLength(1),
@@ -184,7 +180,8 @@ public class SingleByte
da[dp++] = (byte)b;
sp++;
}
- return withResult(cr, src, sp, dst, dp);
+ return withResult(sp < sl ? CoderResult.OVERFLOW : CoderResult.UNDERFLOW,
+ src, sp, dst, dp);
}
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
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 468934b017a..63a5dc62139 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, 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.
*
@@ -29,20 +29,188 @@
package sun.nio.cs;
-import java.nio.charset.*;
+import java.nio.charset.Charset;
+import java.nio.charset.spi.CharsetProvider;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
-
-public class StandardCharsets
- extends FastCharsetProvider
-{
+public class StandardCharsets extends CharsetProvider {
_INCLUDE_ALIASES_TABLES_
_INCLUDE_ALIASES_MAP_
_INCLUDE_CLASSES_MAP_
_INCLUDE_CACHE_MAP_
+ // Maps canonical names to class names
+ private Map classMap;
+ // Maps alias names to canonical names
+ private Map aliasMap;
+ // Maps canonical names to cached instances
+ private Map cache;
+
+ private String packagePrefix = "sun.nio.cs";
+
public StandardCharsets() {
- super("sun.nio.cs", new Aliases(), new Classes(), new Cache());
+ this.aliasMap = new Aliases();
+ this.classMap = new Classes();
+ this.cache = new Cache();
}
+ private String canonicalize(String csn) {
+ String acn = aliasMap.get(csn);
+ return (acn != null) ? acn : csn;
+ }
+
+ // Private ASCII-only version, optimized for interpretation during startup
+ //
+ private static String toLower(String s) {
+ int n = s.length();
+ boolean allLower = true;
+ for (int i = 0; i < n; i++) {
+ int c = s.charAt(i);
+ if (((c - 'A') | ('Z' - c)) >= 0) {
+ allLower = false;
+ break;
+ }
+ }
+ if (allLower)
+ return s;
+ char[] ca = new char[n];
+ for (int i = 0; i < n; i++) {
+ int c = s.charAt(i);
+ if (((c - 'A') | ('Z' - c)) >= 0)
+ ca[i] = (char)(c + 0x20);
+ else
+ ca[i] = (char)c;
+ }
+ return new String(ca);
+ }
+
+ private Charset lookup(String charsetName) {
+ init();
+ String csn = canonicalize(toLower(charsetName));
+
+ // Check cache first
+ Charset cs = cache.get(csn);
+ if (cs != null)
+ return cs;
+
+ // Do we even support this charset?
+ String cln = classMap.get(csn);
+ if (cln == null)
+ return null;
+
+ if (cln.equals("US_ASCII")) {
+ cs = new US_ASCII();
+ cache.put(csn, cs);
+ return cs;
+ }
+
+ // Instantiate the charset and cache it
+ try {
+ Class> c = Class.forName(packagePrefix + "." + cln,
+ true,
+ this.getClass().getClassLoader());
+ cs = (Charset)c.newInstance();
+ cache.put(csn, cs);
+ return cs;
+ } catch (ClassNotFoundException |
+ IllegalAccessException |
+ InstantiationException x) {
+ return null;
+ }
+ }
+
+ public final Charset charsetForName(String charsetName) {
+ synchronized (this) {
+ return lookup(canonicalize(charsetName));
+ }
+ }
+
+ public final Iterator charsets() {
+ synchronized (this) {
+ init();
+ }
+ return new Iterator() {
+
+ Iterator i = classMap.keySet().iterator();
+
+ public boolean hasNext() {
+ return i.hasNext();
+ }
+
+ public Charset next() {
+ String csn = i.next();
+ return lookup(csn);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ }
+
+ private boolean initialized = false;
+
+ /* provider the sun.nio.cs.map property fir sjis/ms932 mapping hack
+ */
+ private void init() {
+ if (initialized)
+ return;
+ if (!sun.misc.VM.isBooted())
+ return;
+ initialized = true;
+
+ String map = getProperty("sun.nio.cs.map");
+ if (map != null) {
+ String[] maps = map.split(",");
+ for (int i = 0; i < maps.length; i++) {
+ if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
+ // if we dont have both sjis and ms932, do nothing
+ if (classMap.get("shift_jis") == null ||
+ classMap.get("windows-31j") == null) {
+ break;
+ }
+ aliases_MS932 = new String[] {
+ "MS932", // JDK historical
+ "windows-932",
+ "csWindows31J",
+ "shift-jis",
+ "ms_kanji",
+ "x-sjis",
+ "csShiftJIS",
+ // This alias takes precedence over the actual
+ // Shift_JIS charset itself since aliases are always
+ // resolved first, before looking up canonical names.
+ "shift_jis"
+ };
+ aliases_SJIS = new String[] { "sjis" };
+
+ for (String alias : aliases_MS932) {
+ aliasMap.put(toLower(alias), "windows-31j");
+ }
+ cache.put("shift_jis", null);
+ break;
+ }
+ }
+ }
+ }
+
+ private static String getProperty(String key) {
+ // this method may be called during initialization of
+ // system class loader and thus not using lambda
+ return AccessController.doPrivileged(
+ new PrivilegedAction() {
+ @Override
+ public String run() {
+ return System.getProperty(key);
+ }
+ });
+ }
+
+
}
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java b/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java
index a3aaf3675d9..fd72238d89f 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java
@@ -243,8 +243,11 @@ public class StreamEncoder extends Writer
if (cr.isUnderflow()) {
if (lcb.hasRemaining()) {
leftoverChar = lcb.get();
- if (cb != null && cb.hasRemaining())
- flushLeftoverChar(cb, endOfInput);
+ if (cb != null && cb.hasRemaining()) {
+ lcb.clear();
+ lcb.put(leftoverChar).put(cb.get()).flip();
+ continue;
+ }
return;
}
break;
@@ -265,24 +268,24 @@ public class StreamEncoder extends Writer
CharBuffer cb = CharBuffer.wrap(cbuf, off, len);
if (haveLeftoverChar)
- flushLeftoverChar(cb, false);
+ flushLeftoverChar(cb, false);
while (cb.hasRemaining()) {
- CoderResult cr = encoder.encode(cb, bb, false);
- if (cr.isUnderflow()) {
- assert (cb.remaining() <= 1) : cb.remaining();
- if (cb.remaining() == 1) {
- haveLeftoverChar = true;
- leftoverChar = cb.get();
+ CoderResult cr = encoder.encode(cb, bb, false);
+ if (cr.isUnderflow()) {
+ assert (cb.remaining() <= 1) : cb.remaining();
+ if (cb.remaining() == 1) {
+ haveLeftoverChar = true;
+ leftoverChar = cb.get();
+ }
+ break;
}
- break;
- }
- if (cr.isOverflow()) {
- assert bb.position() > 0;
- writeBytes();
- continue;
- }
- cr.throwException();
+ if (cr.isOverflow()) {
+ assert bb.position() > 0;
+ writeBytes();
+ continue;
+ }
+ cr.throwException();
}
}
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/DSA.java b/jdk/src/java.base/share/classes/sun/security/provider/DSA.java
index 66b83ad83bc..6f8c27a38c0 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/DSA.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/DSA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -33,14 +33,11 @@ import java.nio.ByteBuffer;
import java.security.*;
import java.security.SecureRandom;
import java.security.interfaces.*;
-import java.security.spec.DSAParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
import sun.security.util.Debug;
import sun.security.util.DerValue;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
-import sun.security.x509.AlgIdDSA;
import sun.security.jca.JCAUtil;
/**
@@ -85,13 +82,28 @@ abstract class DSA extends SignatureSpi {
/* The message digest object used */
private final MessageDigest md;
+ /* The format. true for the IEEE P1363 format. false (default) for ASN.1 */
+ private final boolean p1363Format;
+
/**
* Construct a blank DSA object. It must be
* initialized before being usable for signing or verifying.
*/
DSA(MessageDigest md) {
+ this(md, false);
+ }
+
+ /**
+ * Construct a blank DSA object that will use the specified
+ * signature format. {@code p1363Format} should be {@code true} to
+ * use the IEEE P1363 format. If {@code p1363Format} is {@code false},
+ * the DER-encoded ASN.1 format will used. The DSA object must be
+ * initialized before being usable for signing or verifying.
+ */
+ DSA(MessageDigest md, boolean p1363Format) {
super();
this.md = md;
+ this.p1363Format = p1363Format;
}
/**
@@ -178,12 +190,16 @@ abstract class DSA extends SignatureSpi {
/**
- * Sign all the data thus far updated. The signature is formatted
+ * Sign all the data thus far updated. The signature format is
+ * determined by {@code p1363Format}. If {@code p1363Format} is
+ * {@code false} (the default), then the signature is formatted
* according to the Canonical Encoding Rules, returned as a DER
- * sequence of Integer, r and s.
+ * sequence of Integers, r and s. If {@code p1363Format} is
+ * {@code false}, the signature is returned in the IEEE P1363
+ * format, which is the concatenation or r and s.
*
- * @return a signature block formatted according to the Canonical
- * Encoding Rules.
+ * @return a signature block formatted according to the format
+ * indicated by {@code p1363Format}
*
* @exception SignatureException if the signature object was not
* properly initialized, or if another exception occurs.
@@ -196,24 +212,48 @@ abstract class DSA extends SignatureSpi {
BigInteger r = generateR(presetP, presetQ, presetG, k);
BigInteger s = generateS(presetX, presetQ, r, k);
- try {
- DerOutputStream outseq = new DerOutputStream(100);
- outseq.putInteger(r);
- outseq.putInteger(s);
- DerValue result = new DerValue(DerValue.tag_Sequence,
- outseq.toByteArray());
+ if (p1363Format) {
+ // Return the concatenation of r and s
+ byte[] rBytes = r.toByteArray();
+ byte[] sBytes = s.toByteArray();
- return result.toByteArray();
+ int size = presetQ.bitLength() / 8;
+ byte[] outseq = new byte[size * 2];
- } catch (IOException e) {
- throw new SignatureException("error encoding signature");
+ int rLength = rBytes.length;
+ int sLength = sBytes.length;
+ int i;
+ for (i = rLength; i > 0 && rBytes[rLength - i] == 0; i--);
+
+ int j;
+ for (j = sLength;
+ j > 0 && sBytes[sLength - j] == 0; j--);
+
+ System.arraycopy(rBytes, rLength - i, outseq, size - i, i);
+ System.arraycopy(sBytes, sLength - j, outseq, size * 2 - j, j);
+
+ return outseq;
+ } else {
+ // Return the DER-encoded ASN.1 form
+ try {
+ DerOutputStream outseq = new DerOutputStream(100);
+ outseq.putInteger(r);
+ outseq.putInteger(s);
+ DerValue result = new DerValue(DerValue.tag_Sequence,
+ outseq.toByteArray());
+
+ return result.toByteArray();
+
+ } catch (IOException e) {
+ throw new SignatureException("error encoding signature");
+ }
}
}
/**
* Verify all the data thus far updated.
*
- * @param signature the alledged signature, encoded using the
+ * @param signature the alleged signature, encoded using the
* Canonical Encoding Rules, as a sequence of integers, r and s.
*
* @exception SignatureException if the signature object was not
@@ -230,8 +270,13 @@ abstract class DSA extends SignatureSpi {
/**
* Verify all the data thus far updated.
*
- * @param signature the alledged signature, encoded using the
- * Canonical Encoding Rules, as a sequence of integers, r and s.
+ * @param signature the alleged signature, encoded using the
+ * format indicated by {@code p1363Format}. If {@code p1363Format}
+ * is {@code false} (the default), then the signature is formatted
+ * according to the Canonical Encoding Rules, as a DER sequence of
+ * Integers, r and s. If {@code p1363Format} is {@code false},
+ * the signature is in the IEEE P1363 format, which is the
+ * concatenation or r and s.
*
* @param offset the offset to start from in the array of bytes.
*
@@ -248,16 +293,28 @@ abstract class DSA extends SignatureSpi {
BigInteger r = null;
BigInteger s = null;
- // first decode the signature.
- try {
- DerInputStream in = new DerInputStream(signature, offset, length);
- DerValue[] values = in.getSequence(2);
- r = values[0].getBigInteger();
- s = values[1].getBigInteger();
+ if (p1363Format) {
+ if ((length & 1) == 1) {
+ // length of signature byte array should be even
+ throw new SignatureException("invalid signature format");
+ }
+ int mid = length/2;
+ r = new BigInteger(Arrays.copyOfRange(signature, 0, mid));
+ s = new BigInteger(Arrays.copyOfRange(signature, mid, length));
+ } else {
+ // first decode the signature.
+ try {
+ DerInputStream in = new DerInputStream(signature, offset,
+ length);
+ DerValue[] values = in.getSequence(2);
- } catch (IOException e) {
- throw new SignatureException("invalid encoding for signature");
+ r = values[0].getBigInteger();
+ s = values[1].getBigInteger();
+
+ } catch (IOException e) {
+ throw new SignatureException("invalid encoding for signature");
+ }
}
// some implementations do not correctly encode values in the ASN.1
@@ -420,6 +477,15 @@ abstract class DSA extends SignatureSpi {
}
}
+ /**
+ * SHA224withDSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class SHA224withDSAinP1363Format extends DSA {
+ public SHA224withDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(MessageDigest.getInstance("SHA-224"), true);
+ }
+ }
+
/**
* Standard SHA256withDSA implementation as defined in FIPS186-3.
*/
@@ -429,6 +495,15 @@ abstract class DSA extends SignatureSpi {
}
}
+ /**
+ * SHA256withDSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class SHA256withDSAinP1363Format extends DSA {
+ public SHA256withDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(MessageDigest.getInstance("SHA-256"), true);
+ }
+ }
+
static class LegacyDSA extends DSA {
/* The random seed used to generate k */
private int[] kSeed;
@@ -441,7 +516,12 @@ abstract class DSA extends SignatureSpi {
private int[] kSeedLast;
public LegacyDSA(MessageDigest md) throws NoSuchAlgorithmException {
- super(md);
+ this(md, false);
+ }
+
+ private LegacyDSA(MessageDigest md, boolean p1363Format)
+ throws NoSuchAlgorithmException {
+ super(md, p1363Format);
}
@Deprecated
@@ -636,6 +716,9 @@ abstract class DSA extends SignatureSpi {
}
}
+ /**
+ * Standard SHA1withDSA implementation.
+ */
public static final class SHA1withDSA extends LegacyDSA {
public SHA1withDSA() throws NoSuchAlgorithmException {
super(MessageDigest.getInstance("SHA-1"));
@@ -643,13 +726,22 @@ abstract class DSA extends SignatureSpi {
}
/**
- * RawDSA implementation.
+ * SHA1withDSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class SHA1withDSAinP1363Format extends LegacyDSA {
+ public SHA1withDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(MessageDigest.getInstance("SHA-1"), true);
+ }
+ }
+
+ /**
+ * Raw DSA.
*
- * RawDSA requires the data to be exactly 20 bytes long. If it is
+ * Raw DSA requires the data to be exactly 20 bytes long. If it is
* not, a SignatureException is thrown when sign()/verify() is called
* per JCA spec.
*/
- public static final class RawDSA extends LegacyDSA {
+ static class Raw extends LegacyDSA {
// Internal special-purpose MessageDigest impl for RawDSA
// Only override whatever methods used
// NOTE: no clone support
@@ -719,8 +811,27 @@ abstract class DSA extends SignatureSpi {
}
}
+ private Raw(boolean p1363Format) throws NoSuchAlgorithmException {
+ super(new NullDigest20(), p1363Format);
+ }
+
+ }
+
+ /**
+ * Standard Raw DSA implementation.
+ */
+ public static final class RawDSA extends Raw {
public RawDSA() throws NoSuchAlgorithmException {
- super(new NullDigest20());
+ super(false);
+ }
+ }
+
+ /**
+ * Raw DSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class RawDSAinP1363Format extends Raw {
+ public RawDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(true);
}
}
}
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
index 93e31a6faaf..c496910f7c9 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -130,6 +130,15 @@ final class SunEntries {
map.put("Signature.SHA256withDSA",
"sun.security.provider.DSA$SHA256withDSA");
+ map.put("Signature.SHA1withDSAinP1363Format",
+ "sun.security.provider.DSA$SHA1withDSAinP1363Format");
+ map.put("Signature.NONEwithDSAinP1363Format",
+ "sun.security.provider.DSA$RawDSAinP1363Format");
+ map.put("Signature.SHA224withDSAinP1363Format",
+ "sun.security.provider.DSA$SHA224withDSAinP1363Format");
+ map.put("Signature.SHA256withDSAinP1363Format",
+ "sun.security.provider.DSA$SHA256withDSAinP1363Format");
+
String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" +
"|java.security.interfaces.DSAPrivateKey";
map.put("Signature.SHA1withDSA SupportedKeyClasses", dsaKeyClasses);
diff --git a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
index 17b56974ea3..94df91fe7f9 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 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
@@ -171,8 +171,9 @@ public class DisabledAlgorithmConstraints implements AlgorithmConstraints {
// OAEPWithAndPadding
// with
// withand
+ // within
Pattern pattern =
- Pattern.compile("with|and", Pattern.CASE_INSENSITIVE);
+ Pattern.compile("with|and|in", Pattern.CASE_INSENSITIVE);
String[] tokens = pattern.split(transTocken);
for (String token : tokens) {
diff --git a/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java b/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java
index 1a6f3c2a446..88d98573951 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java
@@ -26,6 +26,8 @@
package sun.security.util;
import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.util.*;
import java.security.Principal;
@@ -148,6 +150,17 @@ public class HostnameChecker {
String ipAddress = (String)next.get(1);
if (expectedIP.equalsIgnoreCase(ipAddress)) {
return;
+ } else {
+ // compare InetAddress objects in order to ensure
+ // equality between a long IPv6 address and its
+ // abbreviated form.
+ try {
+ if (InetAddress.getByName(expectedIP).equals(
+ InetAddress.getByName(ipAddress))) {
+ return;
+ }
+ } catch (UnknownHostException e) {
+ } catch (SecurityException e) {}
}
}
}
diff --git a/jdk/src/java.base/share/conf/security/java.policy b/jdk/src/java.base/share/conf/security/java.policy
index 2ca6ec7f1b2..b9485d80e97 100644
--- a/jdk/src/java.base/share/conf/security/java.policy
+++ b/jdk/src/java.base/share/conf/security/java.policy
@@ -1,4 +1,8 @@
// permissions required by each component
+grant codeBase "jrt:/java.corba" {
+ permission java.security.AllPermission;
+};
+
grant codeBase "jrt:/jdk.zipfs" {
permission java.io.FilePermission "<>", "read,write,delete";
permission java.lang.RuntimePermission "fileSystemProvider";
diff --git a/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c b/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c
index 51e24a01129..1bb5896be5f 100644
--- a/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c
+++ b/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c
@@ -30,6 +30,7 @@
#include "jvm.h"
#include "jni_util.h"
#include "io_util.h"
+#include "io_util_md.h"
#include
#include
@@ -467,26 +468,6 @@ Java_java_lang_ProcessImpl_closeHandle(JNIEnv *env, jclass ignored, jlong handle
return (jboolean) CloseHandle((HANDLE) handle);
}
-/**
- * Returns a copy of the Unicode characters of a string. Fow now this
- * function doesn't handle long path names and other issues.
- */
-static WCHAR* getPath(JNIEnv *env, jstring ps) {
- WCHAR *pathbuf = NULL;
- const jchar *chars = (*(env))->GetStringChars(env, ps, NULL);
- if (chars != NULL) {
- size_t pathlen = wcslen(chars);
- pathbuf = (WCHAR*)malloc((pathlen + 6) * sizeof(WCHAR));
- if (pathbuf == NULL) {
- JNU_ThrowOutOfMemoryError(env, NULL);
- } else {
- wcscpy(pathbuf, chars);
- }
- (*env)->ReleaseStringChars(env, ps, chars);
- }
- return pathbuf;
-}
-
JNIEXPORT jlong JNICALL
Java_java_lang_ProcessImpl_openForAtomicAppend(JNIEnv *env, jclass ignored, jstring path)
{
@@ -495,7 +476,7 @@ Java_java_lang_ProcessImpl_openForAtomicAppend(JNIEnv *env, jclass ignored, jstr
const DWORD disposition = OPEN_ALWAYS;
const DWORD flagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
HANDLE h;
- WCHAR *pathbuf = getPath(env, path);
+ WCHAR *pathbuf = pathToNTPath(env, path, JNI_FALSE);
if (pathbuf == NULL) {
/* Exception already pending */
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 cf925078e94..d85cdd3dead 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
@@ -33,7 +33,8 @@
/*
* Prototypes for functions in io_util_md.c called from io_util.c,
- * FileDescriptor.c, FileInputStream.c, FileOutputStream.c
+ * FileDescriptor.c, FileInputStream.c, FileOutputStream.c,
+ * ProcessImpl_md.c
*/
WCHAR* pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE);
WCHAR* fileToNTPath(JNIEnv *env, jobject file, jfieldID id);
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java b/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java
index 08924208b78..f4b7662c39f 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java
@@ -34,11 +34,21 @@ import java.nio.charset.CharsetDecoder;
ExtendedCharsets class, because if we want to have a public HKSCS,
it probably should be HKSCS_2001 not HKSCS.
*/
-public class HKSCS extends sun.nio.cs.ext.MS950_HKSCS_XP {
+public class HKSCS extends Charset {
+ private static Charset cs = Charset.forName("x-MS950-HKSCS-XP");
+
public HKSCS () {
- super();
+ super("HKSCS", null);
}
public boolean contains(Charset cs) {
return (cs instanceof HKSCS);
}
+
+ public CharsetDecoder newDecoder() {
+ return cs.newDecoder();
+ }
+
+ public CharsetEncoder newEncoder() {
+ return cs.newEncoder();
+ }
}
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java
index fb0e17712dd..880ec9c8f43 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java
@@ -28,6 +28,7 @@ package sun.awt.motif;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
import java.nio.charset.*;
+import sun.nio.cs.*;
import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java
index 5302638c535..e082c526dae 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java
@@ -26,6 +26,7 @@
package sun.awt.motif;
import java.nio.charset.*;
+import sun.nio.cs.*;
import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java
index dbac41c5a50..84b6a081be7 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java
@@ -29,7 +29,7 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.*;
import sun.nio.cs.*;
-import sun.nio.cs.ext.JIS_X_0201;
+import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
public class X11JIS0201 extends Charset {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java
index 04ad2ed2899..b4dc5989323 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java
@@ -28,7 +28,8 @@ package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
-import sun.nio.cs.ext.JIS_X_0208;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
public class X11JIS0208 extends Charset {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java
index 019ea19a910..94c02493d51 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java
@@ -28,7 +28,8 @@ package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
-import sun.nio.cs.ext.JIS_X_0212;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
public class X11JIS0212 extends Charset {
private static Charset jis0212 = new JIS_X_0212();
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java
index 8d9df5ca664..69591cfb062 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java
@@ -28,6 +28,7 @@ package sun.awt.motif;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
import java.nio.charset.*;
+import sun.nio.cs.*;
import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
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 7692a0aaec7..2afe0c25769 100644
--- a/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
+++ b/jdk/src/java.scripting/share/classes/javax/script/ScriptEngineFactory.java
@@ -138,6 +138,7 @@ public interface ScriptEngineFactory {
* @return The value for the given parameter. Returns null if no
* value is assigned to the key.
*
+ * @throws NullPointerException if the key is null.
*/
public Object getParameter(String key);
diff --git a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java
index bb615d2b24b..9e367695d61 100644
--- a/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java
+++ b/jdk/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java
@@ -21,7 +21,7 @@
* under the License.
*/
/*
- * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
* $Id: DOMSignatureMethod.java 1333415 2012-05-03 12:03:51Z coheigea $
@@ -111,6 +111,34 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
+ /**
+ * Returns the signature bytes with any additional formatting
+ * necessary for the signature algorithm used. For RSA signatures,
+ * no changes are required, and this method should simply return
+ * back {@code sig}. For DSA and ECDSA, this method should return the
+ * signature in the IEEE P1363 format, the concatenation of r and s.
+ *
+ * @param key the key used to sign
+ * @param sig the signature returned by {@code Signature.sign()}
+ * @return the formatted signature
+ * @throws IOException
+ */
+ abstract byte[] postSignFormat(Key key, byte[] sig) throws IOException;
+
+ /**
+ * Returns the signature bytes with any conversions that are necessary
+ * before the signature can be verified. For RSA signatures,
+ * no changes are required, and this method should simply
+ * return back {@code sig}. For DSA and ECDSA, this method should
+ * return the signature in the DER-encoded ASN.1 format.
+ *
+ * @param key the key used to sign
+ * @param sig the signature
+ * @return the formatted signature
+ * @throws IOException
+ */
+ abstract byte[] preVerifyFormat(Key key, byte[] sig) throws IOException;
+
static SignatureMethod unmarshal(Element smElem) throws MarshalException {
String alg = DOMUtils.getAttributeValue(smElem, "Algorithm");
if (alg.equals(SignatureMethod.RSA_SHA1)) {
@@ -151,6 +179,23 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return params;
}
+ /**
+ * Returns an instance of Signature from the specified Provider.
+ * The algorithm is specified by the {@code getJCAAlgorithm()} method.
+ *
+ * @param p the Provider to use
+ * @return an instance of Signature implementing the algorithm
+ * specified by {@code getJCAAlgorithm()}
+ * @throws NoSuchAlgorithmException if the Provider does not support the
+ * signature algorithm
+ */
+ Signature getSignature(Provider p)
+ throws NoSuchAlgorithmException {
+ return (p == null)
+ ? Signature.getInstance(getJCAAlgorithm())
+ : Signature.getInstance(getJCAAlgorithm(), p);
+ }
+
boolean verify(Key key, SignedInfo si, byte[] sig,
XMLValidateContext context)
throws InvalidKeyException, SignatureException, XMLSignatureException
@@ -163,38 +208,30 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
throw new InvalidKeyException("key must be PublicKey");
}
if (signature == null) {
+ Provider p = (Provider)context.getProperty(
+ "org.jcp.xml.dsig.internal.dom.SignatureProvider");
try {
- Provider p = (Provider)context.getProperty
- ("org.jcp.xml.dsig.internal.dom.SignatureProvider");
- signature = (p == null)
- ? Signature.getInstance(getJCAAlgorithm())
- : Signature.getInstance(getJCAAlgorithm(), p);
+ signature = getSignature(p);
} catch (NoSuchAlgorithmException nsae) {
throw new XMLSignatureException(nsae);
}
}
signature.initVerify((PublicKey)key);
if (log.isLoggable(java.util.logging.Level.FINE)) {
- log.log(java.util.logging.Level.FINE, "Signature provider:" + signature.getProvider());
+ log.log(java.util.logging.Level.FINE,
+ "Signature provider:" + signature.getProvider());
log.log(java.util.logging.Level.FINE, "verifying with key: " + key);
}
((DOMSignedInfo)si).canonicalize(context,
new SignerOutputStream(signature));
-
+ byte[] s;
try {
- Type type = getAlgorithmType();
- if (type == Type.DSA) {
- int size = ((DSAKey)key).getParams().getQ().bitLength();
- return signature.verify(JavaUtils.convertDsaXMLDSIGtoASN1(sig,
- size/8));
- } else if (type == Type.ECDSA) {
- return signature.verify(SignatureECDSA.convertXMLDSIGtoASN1(sig));
- } else {
- return signature.verify(sig);
- }
+ // Do any necessary format conversions
+ s = preVerifyFormat(key, sig);
} catch (IOException ioe) {
throw new XMLSignatureException(ioe);
}
+ return signature.verify(s);
}
byte[] sign(Key key, SignedInfo si, XMLSignContext context)
@@ -208,19 +245,18 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
throw new InvalidKeyException("key must be PrivateKey");
}
if (signature == null) {
+ Provider p = (Provider)context.getProperty(
+ "org.jcp.xml.dsig.internal.dom.SignatureProvider");
try {
- Provider p = (Provider)context.getProperty
- ("org.jcp.xml.dsig.internal.dom.SignatureProvider");
- signature = (p == null)
- ? Signature.getInstance(getJCAAlgorithm())
- : Signature.getInstance(getJCAAlgorithm(), p);
+ signature = getSignature(p);
} catch (NoSuchAlgorithmException nsae) {
throw new XMLSignatureException(nsae);
}
}
signature.initSign((PrivateKey)key);
if (log.isLoggable(java.util.logging.Level.FINE)) {
- log.log(java.util.logging.Level.FINE, "Signature provider:" + signature.getProvider());
+ log.log(java.util.logging.Level.FINE,
+ "Signature provider:" + signature.getProvider());
log.log(java.util.logging.Level.FINE, "Signing with key: " + key);
}
@@ -228,24 +264,171 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
new SignerOutputStream(signature));
try {
- Type type = getAlgorithmType();
- if (type == Type.DSA) {
- int size = ((DSAKey)key).getParams().getQ().bitLength();
- return JavaUtils.convertDsaASN1toXMLDSIG(signature.sign(),
- size/8);
- } else if (type == Type.ECDSA) {
- return SignatureECDSA.convertASN1toXMLDSIG(signature.sign());
- } else {
- return signature.sign();
- }
- } catch (SignatureException se) {
- throw new XMLSignatureException(se);
- } catch (IOException ioe) {
- throw new XMLSignatureException(ioe);
+ // Return signature with any necessary format conversions
+ return postSignFormat(key, signature.sign());
+ } catch (SignatureException | IOException ex){
+ throw new XMLSignatureException(ex);
}
}
- static final class SHA1withRSA extends DOMSignatureMethod {
+ abstract static class AbstractRSASignatureMethod
+ extends DOMSignatureMethod {
+
+ AbstractRSASignatureMethod(AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException {
+ super(params);
+ }
+
+ AbstractRSASignatureMethod(Element dmElem) throws MarshalException {
+ super(dmElem);
+ }
+
+ /**
+ * Returns {@code sig}. No extra formatting is necessary for RSA.
+ */
+ @Override
+ byte[] postSignFormat(Key key, byte[] sig) {
+ return sig;
+ }
+
+ /**
+ * Returns {@code sig}. No extra formatting is necessary for RSA.
+ */
+ @Override
+ byte[] preVerifyFormat(Key key, byte[] sig) {
+ return sig;
+ }
+ }
+
+ /**
+ * Abstract class to support signature algorithms that sign and verify
+ * signatures in the IEEE P1363 format. The P1363 format is the
+ * concatenation of r and s in DSA and ECDSA signatures, and thus, only
+ * DSA and ECDSA signature methods should extend this class. Subclasses
+ * must supply a fallback algorithm to be used when the provider does
+ * not offer signature algorithms that use the P1363 format.
+ */
+ abstract static class AbstractP1363FormatSignatureMethod
+ extends DOMSignatureMethod {
+
+ /* Set to true when the fallback algorithm is used */
+ boolean asn1;
+
+ AbstractP1363FormatSignatureMethod(AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException {
+ super(params);
+ }
+
+ AbstractP1363FormatSignatureMethod(Element dmElem)
+ throws MarshalException {
+ super(dmElem);
+ }
+
+ /**
+ * Return the fallback algorithm to be used when the provider does not
+ * support signatures in the IEEE P1363 format. This algorithm should
+ * return signatures in the DER-encoded ASN.1 format.
+ */
+ abstract String getJCAFallbackAlgorithm();
+
+ /*
+ * Try to return an instance of Signature implementing signatures
+ * in the IEEE P1363 format. If the provider doesn't support the
+ * P1363 format, return an instance of Signature implementing
+ * signatures in the DER-encoded ASN.1 format.
+ */
+ @Override
+ Signature getSignature(Provider p)
+ throws NoSuchAlgorithmException {
+ try {
+ return (p == null)
+ ? Signature.getInstance(getJCAAlgorithm())
+ : Signature.getInstance(getJCAAlgorithm(), p);
+ } catch (NoSuchAlgorithmException nsae) {
+ Signature s = (p == null)
+ ? Signature.getInstance(getJCAFallbackAlgorithm())
+ : Signature.getInstance(getJCAFallbackAlgorithm(), p);
+ asn1 = true;
+ return s;
+ }
+ }
+ }
+
+ abstract static class AbstractDSASignatureMethod
+ extends AbstractP1363FormatSignatureMethod {
+
+ AbstractDSASignatureMethod(AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException {
+ super(params);
+ }
+
+ AbstractDSASignatureMethod(Element dmElem) throws MarshalException {
+ super(dmElem);
+ }
+
+ @Override
+ byte[] postSignFormat(Key key, byte[] sig) throws IOException {
+ // If signature is in ASN.1 (i.e., if the fallback algorithm
+ // was used), convert the signature to the P1363 format
+ if (asn1) {
+ int size = ((DSAKey) key).getParams().getQ().bitLength();
+ return JavaUtils.convertDsaASN1toXMLDSIG(sig, size / 8);
+ } else {
+ return sig;
+ }
+ }
+
+ @Override
+ byte[] preVerifyFormat(Key key, byte[] sig) throws IOException {
+ // If signature needs to be in ASN.1 (i.e., if the fallback
+ // algorithm will be used to verify the sig), convert the signature
+ // to the ASN.1 format
+ if (asn1) {
+ int size = ((DSAKey) key).getParams().getQ().bitLength();
+ return JavaUtils.convertDsaXMLDSIGtoASN1(sig, size / 8);
+ } else {
+ return sig;
+ }
+ }
+ }
+
+ abstract static class AbstractECDSASignatureMethod
+ extends AbstractP1363FormatSignatureMethod {
+
+ AbstractECDSASignatureMethod(AlgorithmParameterSpec params)
+ throws InvalidAlgorithmParameterException {
+ super(params);
+ }
+
+ AbstractECDSASignatureMethod(Element dmElem) throws MarshalException {
+ super(dmElem);
+ }
+
+ @Override
+ byte[] postSignFormat(Key key, byte[] sig) throws IOException {
+ // If signature is in ASN.1 (i.e., if the fallback algorithm
+ // was used), convert the signature to the P1363 format
+ if (asn1) {
+ return SignatureECDSA.convertASN1toXMLDSIG(sig);
+ } else {
+ return sig;
+ }
+ }
+
+ @Override
+ byte[] preVerifyFormat(Key key, byte[] sig) throws IOException {
+ // If signature needs to be in ASN.1 (i.e., if the fallback
+ // algorithm will be used to verify the sig), convert the signature
+ // to the ASN.1 format
+ if (asn1) {
+ return SignatureECDSA.convertXMLDSIGtoASN1(sig);
+ } else {
+ return sig;
+ }
+ }
+ }
+
+ static final class SHA1withRSA extends AbstractRSASignatureMethod {
SHA1withRSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -264,7 +447,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA256withRSA extends DOMSignatureMethod {
+ static final class SHA256withRSA extends AbstractRSASignatureMethod {
SHA256withRSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -283,7 +466,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA384withRSA extends DOMSignatureMethod {
+ static final class SHA384withRSA extends AbstractRSASignatureMethod {
SHA384withRSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -302,7 +485,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA512withRSA extends DOMSignatureMethod {
+ static final class SHA512withRSA extends AbstractRSASignatureMethod {
SHA512withRSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -321,7 +504,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA1withDSA extends DOMSignatureMethod {
+ static final class SHA1withDSA extends AbstractDSASignatureMethod {
SHA1withDSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -333,6 +516,9 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return SignatureMethod.DSA_SHA1;
}
String getJCAAlgorithm() {
+ return "SHA1withDSAinP1363Format";
+ }
+ String getJCAFallbackAlgorithm() {
return "SHA1withDSA";
}
Type getAlgorithmType() {
@@ -340,7 +526,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA256withDSA extends DOMSignatureMethod {
+ static final class SHA256withDSA extends AbstractDSASignatureMethod {
SHA256withDSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -352,6 +538,9 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return DSA_SHA256;
}
String getJCAAlgorithm() {
+ return "SHA256withDSAinP1363Format";
+ }
+ String getJCAFallbackAlgorithm() {
return "SHA256withDSA";
}
Type getAlgorithmType() {
@@ -359,7 +548,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA1withECDSA extends DOMSignatureMethod {
+ static final class SHA1withECDSA extends AbstractECDSASignatureMethod {
SHA1withECDSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -371,6 +560,9 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return ECDSA_SHA1;
}
String getJCAAlgorithm() {
+ return "SHA1withECDSAinP1363Format";
+ }
+ String getJCAFallbackAlgorithm() {
return "SHA1withECDSA";
}
Type getAlgorithmType() {
@@ -378,7 +570,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA256withECDSA extends DOMSignatureMethod {
+ static final class SHA256withECDSA extends AbstractECDSASignatureMethod {
SHA256withECDSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -390,6 +582,9 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return ECDSA_SHA256;
}
String getJCAAlgorithm() {
+ return "SHA256withECDSAinP1363Format";
+ }
+ String getJCAFallbackAlgorithm() {
return "SHA256withECDSA";
}
Type getAlgorithmType() {
@@ -397,7 +592,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA384withECDSA extends DOMSignatureMethod {
+ static final class SHA384withECDSA extends AbstractECDSASignatureMethod {
SHA384withECDSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -409,6 +604,9 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return ECDSA_SHA384;
}
String getJCAAlgorithm() {
+ return "SHA384withECDSAinP1363Format";
+ }
+ String getJCAFallbackAlgorithm() {
return "SHA384withECDSA";
}
Type getAlgorithmType() {
@@ -416,7 +614,7 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
}
}
- static final class SHA512withECDSA extends DOMSignatureMethod {
+ static final class SHA512withECDSA extends AbstractECDSASignatureMethod {
SHA512withECDSA(AlgorithmParameterSpec params)
throws InvalidAlgorithmParameterException {
super(params);
@@ -428,6 +626,9 @@ public abstract class DOMSignatureMethod extends AbstractDOMSignatureMethod {
return ECDSA_SHA512;
}
String getJCAAlgorithm() {
+ return "SHA512withECDSAinP1363Format";
+ }
+ String getJCAFallbackAlgorithm() {
return "SHA512withECDSA";
}
Type getAlgorithmType() {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java.template
similarity index 93%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java
rename to jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java.template
index 7bed42eb07f..3b2ad7eb5d5 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,18 +23,20 @@
* questions.
*/
-package sun.nio.cs.ext;
+package $PACKAGE$;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.HKSCS;
import sun.nio.cs.HistoricallyNamedCharset;
import static sun.nio.cs.CharsetMapping.*;
public class Big5_HKSCS extends Charset implements HistoricallyNamedCharset
{
public Big5_HKSCS() {
- super("Big5-HKSCS", ExtendedCharsets.aliasesFor("Big5-HKSCS"));
+ super("Big5-HKSCS", $ALIASES$);
}
public String historicalName() {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java
index 1514e2e5cb0..8c3e014ec73 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_HKSCS_2001.java
@@ -28,7 +28,9 @@ package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
public class Big5_HKSCS_2001 extends Charset
{
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template
similarity index 97%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java
rename to jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template
index bf98320287b..e1810bd9268 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/Big5_Solaris.java.template
@@ -23,11 +23,12 @@
* questions.
*/
-package sun.nio.cs.ext;
+package $PACKAGE$;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
import java.util.Arrays;
import static sun.nio.cs.CharsetMapping.*;
@@ -35,7 +36,7 @@ import static sun.nio.cs.CharsetMapping.*;
public class Big5_Solaris extends Charset implements HistoricallyNamedCharset
{
public Big5_Solaris() {
- super("x-Big5-Solaris", ExtendedCharsets.aliasesFor("x-Big5-Solaris"));
+ super("x-Big5-Solaris", $ALIASES$);
}
public String historicalName() {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template
similarity index 99%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java
rename to jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template
index 84ca4c2aada..1a1a9affe83 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP.java.template
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package $PACKAGE$;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -32,8 +32,11 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.DelegatableDecoder;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.Surrogate;
import sun.nio.cs.SingleByte;
+import sun.nio.cs.*;
import static sun.nio.cs.CharsetMapping.*;
public class EUC_JP
@@ -41,7 +44,7 @@ public class EUC_JP
implements HistoricallyNamedCharset
{
public EUC_JP() {
- super("EUC-JP", ExtendedCharsets.aliasesFor("EUC-JP"));
+ super("EUC-JP", $ALIASES$);
}
public String historicalName() {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java.template
similarity index 93%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java
rename to jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java.template
index 343e1d05b00..a96d5d27cb5 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_LINUX.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 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
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package $PACKAGE$;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -32,13 +32,14 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
public class EUC_JP_LINUX
extends Charset
implements HistoricallyNamedCharset
{
public EUC_JP_LINUX() {
- super("x-euc-jp-linux", ExtendedCharsets.aliasesFor("x-euc-jp-linux"));
+ super("x-euc-jp-linux", $ALIASES$);
}
public String historicalName() {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java.template
similarity index 95%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java
rename to jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java.template
index 277a09b77da..9c86e7ac719 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/EUC_JP_Open.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2012, 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
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package $PACKAGE$;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -31,7 +31,9 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
import static sun.nio.cs.CharsetMapping.*;
public class EUC_JP_Open
@@ -39,7 +41,7 @@ public class EUC_JP_Open
implements HistoricallyNamedCharset
{
public EUC_JP_Open() {
- super("x-eucJP-Open", ExtendedCharsets.aliasesFor("x-eucJP-Open"));
+ super("x-eucJP-Open", $ALIASES$);
}
public String historicalName() {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
deleted file mode 100644
index 7b1db203305..00000000000
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
+++ /dev/null
@@ -1,1326 +0,0 @@
-/*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. 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.nio.cs.ext;
-
-import java.lang.ref.SoftReference;
-import java.nio.charset.Charset;
-import java.nio.charset.spi.CharsetProvider;
-import sun.nio.cs.AbstractCharsetProvider;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- * Provider for extended charsets.
- */
-
-public class ExtendedCharsets
- extends AbstractCharsetProvider
-{
-
- static volatile ExtendedCharsets instance = null;
-
- public ExtendedCharsets() {
-
- super("sun.nio.cs.ext"); // identify provider pkg name.
-
- // Traditional Chinese
-
- charset("Big5", "Big5",
- new String[] {
- // IANA aliases
- "csBig5"
- });
-
- charset("x-MS950-HKSCS-XP", "MS950_HKSCS_XP",
- new String[] {
- "MS950_HKSCS_XP" // JDK historical;
- });
-
- charset("x-MS950-HKSCS", "MS950_HKSCS",
- new String[] {
- // IANA aliases
- "MS950_HKSCS" // JDK historical;
- });
-
- charset("x-windows-950", "MS950",
- new String[] {
- "ms950", // JDK historical
- "windows-950"
- });
-
- charset("x-windows-874", "MS874",
- new String[] {
- "ms874", // JDK historical
- "ms-874",
- "windows-874" });
-
- charset("x-EUC-TW", "EUC_TW",
- new String[] {
- "euc_tw", // JDK historical
- "euctw",
- "cns11643",
- "EUC-TW"
- });
-
- charset("Big5-HKSCS", "Big5_HKSCS",
- new String[] {
- "Big5_HKSCS", // JDK historical
- "big5hk",
- "big5-hkscs",
- "big5hkscs" // Linux alias
- });
-
- charset("x-Big5-HKSCS-2001", "Big5_HKSCS_2001",
- new String[] {
- "Big5_HKSCS_2001",
- "big5hk-2001",
- "big5-hkscs-2001",
- "big5-hkscs:unicode3.0",
- "big5hkscs-2001",
- });
-
- charset("x-Big5-Solaris", "Big5_Solaris",
- new String[] {
- "Big5_Solaris", // JDK historical
- });
-
- // Simplified Chinese
- charset("GBK", "GBK",
- new String[] {
- "windows-936",
- "CP936"
- });
-
- charset("GB18030", "GB18030",
- new String[] {
- "gb18030-2000"
- });
-
- charset("GB2312", "EUC_CN",
- new String[] {
- // IANA aliases
- "gb2312",
- "gb2312-80",
- "gb2312-1980",
- "euc-cn",
- "euccn",
- "x-EUC-CN", // 1.4 compatibility
- "EUC_CN" //JDK historical
- });
-
- charset("x-mswin-936", "MS936",
- new String[] {
- "ms936", // historical
- // IANA aliases
- "ms_936"
- });
-
- // The definition of this charset may be overridden by the init method,
- // below, if the sun.nio.cs.map property is defined.
- //
- charset("Shift_JIS", "SJIS",
- new String[] {
- // IANA aliases
- "sjis", // historical
- "shift_jis",
- "shift-jis",
- "ms_kanji",
- "x-sjis",
- "csShiftJIS"
- });
-
- // The definition of this charset may be overridden by the init method,
- // below, if the sun.nio.cs.map property is defined.
- //
- charset("windows-31j", "MS932",
- new String[] {
- "MS932", // JDK historical
- "windows-932",
- "csWindows31J"
- });
-
- charset("JIS_X0201", "JIS_X_0201",
- new String[] {
- "JIS0201", // JDK historical
- // IANA aliases
- "JIS_X0201",
- "X0201",
- "csHalfWidthKatakana"
- });
-
- charset("x-JIS0208", "JIS_X_0208",
- new String[] {
- "JIS0208", // JDK historical
- // IANA aliases
- "JIS_C6226-1983",
- "iso-ir-87",
- "x0208",
- "JIS_X0208-1983",
- "csISO87JISX0208"
- });
-
- charset("JIS_X0212-1990", "JIS_X_0212",
- new String[] {
- "JIS0212", // JDK historical
- // IANA aliases
- "jis_x0212-1990",
- "x0212",
- "iso-ir-159",
- "csISO159JISX02121990"
- });
-
- charset("x-SJIS_0213", "SJIS_0213",
- new String[] {
- "sjis-0213",
- "sjis_0213",
- "sjis:2004",
- "sjis_0213:2004",
- "shift_jis_0213:2004",
- "shift_jis:2004"
- });
-
- charset("x-MS932_0213", "MS932_0213",
- new String[] {
- "MS932-0213",
- "MS932_0213",
- "MS932:2004",
- "windows-932-0213",
- "windows-932:2004"
- });
-
- charset("EUC-JP", "EUC_JP",
- new String[] {
- "euc_jp", // JDK historical
- // IANA aliases
- "eucjis",
- "eucjp",
- "Extended_UNIX_Code_Packed_Format_for_Japanese",
- "csEUCPkdFmtjapanese",
- "x-euc-jp",
- "x-eucjp"
- });
-
- charset("x-euc-jp-linux", "EUC_JP_LINUX",
- new String[] {
- "euc_jp_linux", // JDK historical
- "euc-jp-linux"
- });
-
- charset("x-eucjp-open", "EUC_JP_Open",
- new String[] {
- "EUC_JP_Solaris", // JDK historical
- "eucJP-open"
- });
-
- charset("x-PCK", "PCK",
- new String[] {
- // IANA aliases
- "pck" // historical
- });
-
- charset("ISO-2022-JP", "ISO2022_JP",
- new String[] {
- // IANA aliases
- "iso2022jp", // historical
- "jis",
- "csISO2022JP",
- "jis_encoding",
- "csjisencoding"
- });
-
- charset("ISO-2022-JP-2", "ISO2022_JP_2",
- new String[] {
- // IANA aliases
- "csISO2022JP2",
- "iso2022jp2"
- });
-
- charset("x-windows-50221", "MS50221",
- new String[] {
- "ms50221", // historical
- "cp50221",
- });
-
- charset("x-windows-50220", "MS50220",
- new String[] {
- "ms50220", // historical
- "cp50220",
- });
-
- charset("x-windows-iso2022jp", "MSISO2022JP",
- new String[] {
- "windows-iso2022jp", // historical
- });
-
- charset("x-JISAutoDetect", "JISAutoDetect",
- new String[] {
- "JISAutoDetect" // historical
- });
-
- // Korean
- charset("EUC-KR", "EUC_KR",
- new String[] {
- "euc_kr", // JDK historical
- // IANA aliases
- "ksc5601",
- "euckr",
- "ks_c_5601-1987",
- "ksc5601-1987",
- "ksc5601_1987",
- "ksc_5601",
- "csEUCKR",
- "5601"
- });
-
- charset("x-windows-949", "MS949",
- new String[] {
- "ms949", // JDK historical
- "windows949",
- "windows-949",
- // IANA aliases
- "ms_949"
- });
-
- charset("x-Johab", "Johab",
- new String[] {
- "ksc5601-1992",
- "ksc5601_1992",
- "ms1361",
- "johab" // JDK historical
- });
-
- charset("ISO-2022-KR", "ISO2022_KR",
- new String[] {
- "ISO2022KR", // JDK historical
- "csISO2022KR"
- });
-
- charset("ISO-2022-CN", "ISO2022_CN",
- new String[] {
- "ISO2022CN", // JDK historical
- "csISO2022CN"
- });
-
- charset("x-ISO-2022-CN-CNS", "ISO2022_CN_CNS",
- new String[] {
- "ISO2022CN_CNS", // JDK historical
- "ISO-2022-CN-CNS"
- });
-
- charset("x-ISO-2022-CN-GB", "ISO2022_CN_GB",
- new String[] {
- "ISO2022CN_GB", // JDK historical
- "ISO-2022-CN-GB"
- });
-
- charset("x-ISCII91", "ISCII91",
- new String[] {
- "iscii",
- "ST_SEV_358-88",
- "iso-ir-153",
- "csISO153GOST1976874",
- "ISCII91" // JDK historical
- });
-
- charset("ISO-8859-3", "ISO_8859_3",
- new String[] {
- "iso8859_3", // JDK historical
- "8859_3",
- "ISO_8859-3:1988",
- "iso-ir-109",
- "ISO_8859-3",
- "ISO8859-3",
- "latin3",
- "l3",
- "ibm913",
- "ibm-913",
- "cp913",
- "913",
- "csISOLatin3"
- });
-
- charset("ISO-8859-6", "ISO_8859_6",
- new String[] {
- "iso8859_6", // JDK historical
- "8859_6",
- "iso-ir-127",
- "ISO_8859-6",
- "ISO_8859-6:1987",
- "ISO8859-6",
- "ECMA-114",
- "ASMO-708",
- "arabic",
- "ibm1089",
- "ibm-1089",
- "cp1089",
- "1089",
- "csISOLatinArabic"
- });
-
- charset("ISO-8859-8", "ISO_8859_8",
- new String[] {
- "iso8859_8", // JDK historical
- "8859_8",
- "iso-ir-138",
- "ISO_8859-8",
- "ISO_8859-8:1988",
- "ISO8859-8",
- "cp916",
- "916",
- "ibm916",
- "ibm-916",
- "hebrew",
- "csISOLatinHebrew"
- });
-
- charset("x-ISO-8859-11", "ISO_8859_11",
- new String[] {
- "iso-8859-11",
- "iso8859_11"
- });
-
- charset("TIS-620", "TIS_620",
- new String[] {
- "tis620", // JDK historical
- "tis620.2533"
- });
-
- // Various Microsoft Windows international codepages
-
- charset("windows-1255", "MS1255",
- new String[] {
- "cp1255" // JDK historical
- });
-
- charset("windows-1256", "MS1256",
- new String[] {
- "cp1256" // JDK historical
- });
-
- charset("windows-1258", "MS1258",
- new String[] {
- "cp1258" // JDK historical
- });
-
- // IBM & PC/MSDOS encodings
-
- charset("x-IBM942", "IBM942",
- new String[] {
- "cp942", // JDK historical
- "ibm942",
- "ibm-942",
- "942"
- });
-
- charset("x-IBM942C", "IBM942C",
- new String[] {
- "cp942C", // JDK historical
- "ibm942C",
- "ibm-942C",
- "942C"
- });
-
- charset("x-IBM943", "IBM943",
- new String[] {
- "cp943", // JDK historical
- "ibm943",
- "ibm-943",
- "943"
- });
-
- charset("x-IBM943C", "IBM943C",
- new String[] {
- "cp943C", // JDK historical
- "ibm943C",
- "ibm-943C",
- "943C"
- });
-
- charset("x-IBM948", "IBM948",
- new String[] {
- "cp948", // JDK historical
- "ibm948",
- "ibm-948",
- "948"
- });
-
- charset("x-IBM950", "IBM950",
- new String[] {
- "cp950", // JDK historical
- "ibm950",
- "ibm-950",
- "950"
- });
-
- charset("x-IBM930", "IBM930",
- new String[] {
- "cp930", // JDK historical
- "ibm930",
- "ibm-930",
- "930"
- });
-
- charset("x-IBM935", "IBM935",
- new String[] {
- "cp935", // JDK historical
- "ibm935",
- "ibm-935",
- "935"
- });
-
- charset("x-IBM937", "IBM937",
- new String[] {
- "cp937", // JDK historical
- "ibm937",
- "ibm-937",
- "937"
- });
-
- charset("x-IBM856", "IBM856",
- new String[] {
- "cp856", // JDK historical
- "ibm-856",
- "ibm856",
- "856"
- });
-
- charset("IBM860", "IBM860",
- new String[] {
- "cp860", // JDK historical
- "ibm860",
- "ibm-860",
- "860",
- "csIBM860"
- });
- charset("IBM861", "IBM861",
- new String[] {
- "cp861", // JDK historical
- "ibm861",
- "ibm-861",
- "861",
- "csIBM861",
- "cp-is"
- });
-
- charset("IBM863", "IBM863",
- new String[] {
- "cp863", // JDK historical
- "ibm863",
- "ibm-863",
- "863",
- "csIBM863"
- });
-
- charset("IBM864", "IBM864",
- new String[] {
- "cp864", // JDK historical
- "ibm864",
- "ibm-864",
- "864",
- "csIBM864"
- });
-
- charset("IBM865", "IBM865",
- new String[] {
- "cp865", // JDK historical
- "ibm865",
- "ibm-865",
- "865",
- "csIBM865"
- });
-
- charset("IBM868", "IBM868",
- new String[] {
- "cp868", // JDK historical
- "ibm868",
- "ibm-868",
- "868",
- "cp-ar",
- "csIBM868"
- });
-
- charset("IBM869", "IBM869",
- new String[] {
- "cp869", // JDK historical
- "ibm869",
- "ibm-869",
- "869",
- "cp-gr",
- "csIBM869"
- });
-
- charset("x-IBM921", "IBM921",
- new String[] {
- "cp921", // JDK historical
- "ibm921",
- "ibm-921",
- "921"
- });
-
- charset("x-IBM1006", "IBM1006",
- new String[] {
- "cp1006", // JDK historical
- "ibm1006",
- "ibm-1006",
- "1006"
- });
-
- charset("x-IBM1046", "IBM1046",
- new String[] {
- "cp1046", // JDK historical
- "ibm1046",
- "ibm-1046",
- "1046"
- });
-
- charset("IBM1047", "IBM1047",
- new String[] {
- "cp1047", // JDK historical
- "ibm-1047",
- "1047"
- });
-
- charset("x-IBM1098", "IBM1098",
- new String[] {
- "cp1098", // JDK historical
- "ibm1098",
- "ibm-1098",
- "1098",
- });
-
- charset("IBM037", "IBM037",
- new String[] {
- "cp037", // JDK historical
- "ibm037",
- "ebcdic-cp-us",
- "ebcdic-cp-ca",
- "ebcdic-cp-wt",
- "ebcdic-cp-nl",
- "csIBM037",
- "cs-ebcdic-cp-us",
- "cs-ebcdic-cp-ca",
- "cs-ebcdic-cp-wt",
- "cs-ebcdic-cp-nl",
- "ibm-037",
- "ibm-37",
- "cpibm37",
- "037"
- });
-
- charset("x-IBM1025", "IBM1025",
- new String[] {
- "cp1025", // JDK historical
- "ibm1025",
- "ibm-1025",
- "1025"
- });
-
- charset("IBM1026", "IBM1026",
- new String[] {
- "cp1026", // JDK historical
- "ibm1026",
- "ibm-1026",
- "1026"
- });
-
- charset("x-IBM1112", "IBM1112",
- new String[] {
- "cp1112", // JDK historical
- "ibm1112",
- "ibm-1112",
- "1112"
- });
-
- charset("x-IBM1122", "IBM1122",
- new String[] {
- "cp1122", // JDK historical
- "ibm1122",
- "ibm-1122",
- "1122"
- });
-
- charset("x-IBM1123", "IBM1123",
- new String[] {
- "cp1123", // JDK historical
- "ibm1123",
- "ibm-1123",
- "1123"
- });
-
- charset("x-IBM1124", "IBM1124",
- new String[] {
- "cp1124", // JDK historical
- "ibm1124",
- "ibm-1124",
- "1124"
- });
-
- charset("x-IBM1364", "IBM1364",
- new String[] {
- "cp1364",
- "ibm1364",
- "ibm-1364",
- "1364"
- });
-
- charset("IBM273", "IBM273",
- new String[] {
- "cp273", // JDK historical
- "ibm273",
- "ibm-273",
- "273"
- });
-
- charset("IBM277", "IBM277",
- new String[] {
- "cp277", // JDK historical
- "ibm277",
- "ibm-277",
- "277"
- });
-
- charset("IBM278", "IBM278",
- new String[] {
- "cp278", // JDK historical
- "ibm278",
- "ibm-278",
- "278",
- "ebcdic-sv",
- "ebcdic-cp-se",
- "csIBM278"
- });
-
- charset("IBM280", "IBM280",
- new String[] {
- "cp280", // JDK historical
- "ibm280",
- "ibm-280",
- "280"
- });
-
- charset("IBM284", "IBM284",
- new String[] {
- "cp284", // JDK historical
- "ibm284",
- "ibm-284",
- "284",
- "csIBM284",
- "cpibm284"
- });
-
- charset("IBM285", "IBM285",
- new String[] {
- "cp285", // JDK historical
- "ibm285",
- "ibm-285",
- "285",
- "ebcdic-cp-gb",
- "ebcdic-gb",
- "csIBM285",
- "cpibm285"
- });
-
- charset("IBM297", "IBM297",
- new String[] {
- "cp297", // JDK historical
- "ibm297",
- "ibm-297",
- "297",
- "ebcdic-cp-fr",
- "cpibm297",
- "csIBM297",
- });
-
- charset("IBM420", "IBM420",
- new String[] {
- "cp420", // JDK historical
- "ibm420",
- "ibm-420",
- "ebcdic-cp-ar1",
- "420",
- "csIBM420"
- });
-
- charset("IBM424", "IBM424",
- new String[] {
- "cp424", // JDK historical
- "ibm424",
- "ibm-424",
- "424",
- "ebcdic-cp-he",
- "csIBM424"
- });
-
- charset("IBM500", "IBM500",
- new String[] {
- "cp500", // JDK historical
- "ibm500",
- "ibm-500",
- "500",
- "ebcdic-cp-ch",
- "ebcdic-cp-bh",
- "csIBM500"
- });
-
- charset("x-IBM833", "IBM833",
- new String[] {
- "cp833",
- "ibm833",
- "ibm-833"
- });
-
- //EBCDIC DBCS-only Korean
- charset("x-IBM834", "IBM834",
- new String[] {
- "cp834",
- "ibm834",
- "834",
- "ibm-834"
- });
-
-
- charset("IBM-Thai", "IBM838",
- new String[] {
- "cp838", // JDK historical
- "ibm838",
- "ibm-838",
- "838"
- });
-
- charset("IBM870", "IBM870",
- new String[] {
- "cp870", // JDK historical
- "ibm870",
- "ibm-870",
- "870",
- "ebcdic-cp-roece",
- "ebcdic-cp-yu",
- "csIBM870"
- });
-
- charset("IBM871", "IBM871",
- new String[] {
- "cp871", // JDK historical
- "ibm871",
- "ibm-871",
- "871",
- "ebcdic-cp-is",
- "csIBM871"
- });
-
- charset("x-IBM875", "IBM875",
- new String[] {
- "cp875", // JDK historical
- "ibm875",
- "ibm-875",
- "875"
- });
-
- charset("IBM918", "IBM918",
- new String[] {
- "cp918", // JDK historical
- "ibm-918",
- "918",
- "ebcdic-cp-ar2"
- });
-
- charset("x-IBM922", "IBM922",
- new String[] {
- "cp922", // JDK historical
- "ibm922",
- "ibm-922",
- "922"
- });
-
- charset("x-IBM1097", "IBM1097",
- new String[] {
- "cp1097", // JDK historical
- "ibm1097",
- "ibm-1097",
- "1097"
- });
-
- charset("x-IBM949", "IBM949",
- new String[] {
- "cp949", // JDK historical
- "ibm949",
- "ibm-949",
- "949"
- });
-
- charset("x-IBM949C", "IBM949C",
- new String[] {
- "cp949C", // JDK historical
- "ibm949C",
- "ibm-949C",
- "949C"
- });
-
- charset("x-IBM939", "IBM939",
- new String[] {
- "cp939", // JDK historical
- "ibm939",
- "ibm-939",
- "939"
- });
-
- charset("x-IBM933", "IBM933",
- new String[] {
- "cp933", // JDK historical
- "ibm933",
- "ibm-933",
- "933"
- });
-
- charset("x-IBM1381", "IBM1381",
- new String[] {
- "cp1381", // JDK historical
- "ibm1381",
- "ibm-1381",
- "1381"
- });
-
- charset("x-IBM1383", "IBM1383",
- new String[] {
- "cp1383", // JDK historical
- "ibm1383",
- "ibm-1383",
- "1383"
- });
-
- charset("x-IBM970", "IBM970",
- new String[] {
- "cp970", // JDK historical
- "ibm970",
- "ibm-970",
- "ibm-eucKR",
- "970"
- });
-
- charset("x-IBM964", "IBM964",
- new String[] {
- "cp964", // JDK historical
- "ibm964",
- "ibm-964",
- "964"
- });
-
- charset("x-IBM33722", "IBM33722",
- new String[] {
- "cp33722", // JDK historical
- "ibm33722",
- "ibm-33722",
- "ibm-5050", // from IBM alias list
- "ibm-33722_vascii_vpua", // from IBM alias list
- "33722"
- });
-
- charset("IBM01140", "IBM1140",
- new String[] {
- "cp1140", // JDK historical
- "ccsid01140",
- "cp01140",
- "1140",
- "ebcdic-us-037+euro"
- });
-
- charset("IBM01141", "IBM1141",
- new String[] {
- "cp1141", // JDK historical
- "ccsid01141",
- "cp01141",
- "1141",
- "ebcdic-de-273+euro"
- });
-
- charset("IBM01142", "IBM1142",
- new String[] {
- "cp1142", // JDK historical
- "ccsid01142",
- "cp01142",
- "1142",
- "ebcdic-no-277+euro",
- "ebcdic-dk-277+euro"
- });
-
- charset("IBM01143", "IBM1143",
- new String[] {
- "cp1143", // JDK historical
- "ccsid01143",
- "cp01143",
- "1143",
- "ebcdic-fi-278+euro",
- "ebcdic-se-278+euro"
- });
-
- charset("IBM01144", "IBM1144",
- new String[] {
- "cp1144", // JDK historical
- "ccsid01144",
- "cp01144",
- "1144",
- "ebcdic-it-280+euro"
- });
-
- charset("IBM01145", "IBM1145",
- new String[] {
- "cp1145", // JDK historical
- "ccsid01145",
- "cp01145",
- "1145",
- "ebcdic-es-284+euro"
- });
-
- charset("IBM01146", "IBM1146",
- new String[] {
- "cp1146", // JDK historical
- "ccsid01146",
- "cp01146",
- "1146",
- "ebcdic-gb-285+euro"
- });
-
- charset("IBM01147", "IBM1147",
- new String[] {
- "cp1147", // JDK historical
- "ccsid01147",
- "cp01147",
- "1147",
- "ebcdic-fr-277+euro"
- });
-
- charset("IBM01148", "IBM1148",
- new String[] {
- "cp1148", // JDK historical
- "ccsid01148",
- "cp01148",
- "1148",
- "ebcdic-international-500+euro"
- });
-
- charset("IBM01149", "IBM1149",
- new String[] {
- "cp1149", // JDK historical
- "ccsid01149",
- "cp01149",
- "1149",
- "ebcdic-s-871+euro"
- });
-
- charset("IBM290", "IBM290",
- new String[] {
- "cp290",
- "ibm290",
- "ibm-290",
- "csIBM290",
- "EBCDIC-JP-kana",
- "290"
- });
-
- charset("x-IBM300", "IBM300",
- new String[] {
- "cp300",
- "ibm300",
- "ibm-300",
- "300"
- });
-
- // Macintosh MacOS/Apple char encodingd
-
-
- charset("x-MacRoman", "MacRoman",
- new String[] {
- "MacRoman" // JDK historical
- });
-
- charset("x-MacCentralEurope", "MacCentralEurope",
- new String[] {
- "MacCentralEurope" // JDK historical
- });
-
- charset("x-MacCroatian", "MacCroatian",
- new String[] {
- "MacCroatian" // JDK historical
- });
-
-
- charset("x-MacGreek", "MacGreek",
- new String[] {
- "MacGreek" // JDK historical
- });
-
- charset("x-MacCyrillic", "MacCyrillic",
- new String[] {
- "MacCyrillic" // JDK historical
- });
-
- charset("x-MacUkraine", "MacUkraine",
- new String[] {
- "MacUkraine" // JDK historical
- });
-
- charset("x-MacTurkish", "MacTurkish",
- new String[] {
- "MacTurkish" // JDK historical
- });
-
- charset("x-MacArabic", "MacArabic",
- new String[] {
- "MacArabic" // JDK historical
- });
-
- charset("x-MacHebrew", "MacHebrew",
- new String[] {
- "MacHebrew" // JDK historical
- });
-
- charset("x-MacIceland", "MacIceland",
- new String[] {
- "MacIceland" // JDK historical
- });
-
- charset("x-MacRomania", "MacRomania",
- new String[] {
- "MacRomania" // JDK historical
- });
-
- charset("x-MacThai", "MacThai",
- new String[] {
- "MacThai" // JDK historical
- });
-
- charset("x-MacSymbol", "MacSymbol",
- new String[] {
- "MacSymbol" // JDK historical
- });
-
- charset("x-MacDingbat", "MacDingbat",
- new String[] {
- "MacDingbat" // JDK historical
- });
-
- instance = this;
-
- }
-
- private boolean initialized = false;
-
- // If the sun.nio.cs.map property is defined on the command line we won't
- // see it in the system-properties table until after the charset subsystem
- // has been initialized. We therefore delay the effect of this property
- // until after the JRE has completely booted.
- //
- // At the moment following values for this property are supported, property
- // value string is case insensitive.
- //
- // (1)"Windows-31J/Shift_JIS"
- // In 1.4.1 we added a correct implementation of the Shift_JIS charset
- // but in previous releases this charset name had been treated as an alias
- // for Windows-31J, aka MS932. Users who have existing code that depends
- // upon this alias can restore the previous behavior by defining this
- // property to have this value.
- //
- // (2)"x-windows-50221/ISO-2022-JP"
- // "x-windows-50220/ISO-2022-JP"
- // "x-windows-iso2022jp/ISO-2022-JP"
- // The charset ISO-2022-JP is a "standard based" implementation by default,
- // which supports ASCII, JIS_X_0201 and JIS_X_0208 mappings based encoding
- // and decoding only.
- // There are three Microsoft iso-2022-jp variants, namely x-windows-50220,
- // x-windows-50221 and x-windows-iso2022jp which behaves "slightly" differently
- // compared to the "standard based" implementation. See ISO2022_JP.java for
- // detailed description. Users who prefer the behavior of MS iso-2022-jp
- // variants should use these names explicitly instead of using "ISO-2022-JP"
- // and its aliases. However for those who need the ISO-2022-JP charset behaves
- // exactly the same as MS variants do, above properties can be defined to
- // switch.
- //
- // If we need to define other charset-alias mappings in the future then
- // this property could be further extended, the general idea being that its
- // value should be of the form
- //
- // new-charset-1/old-charset-1,new-charset-2/old-charset-2,...
- //
- // where each charset named to the left of a slash is intended to replace
- // (most) uses of the charset named to the right of the slash.
- //
- protected void init() {
- if (initialized)
- return;
- if (!sun.misc.VM.isBooted())
- return;
-
- String map = getProperty("sun.nio.cs.map");
- boolean sjisIsMS932 = false;
- boolean iso2022jpIsMS50221 = false;
- boolean iso2022jpIsMS50220 = false;
- boolean iso2022jpIsMSISO2022JP = false;
- if (map != null) {
- String[] maps = map.split(",");
- for (int i = 0; i < maps.length; i++) {
- if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
- sjisIsMS932 = true;
- } else if (maps[i].equalsIgnoreCase("x-windows-50221/ISO-2022-JP")) {
- iso2022jpIsMS50221 = true;
- } else if (maps[i].equalsIgnoreCase("x-windows-50220/ISO-2022-JP")) {
- iso2022jpIsMS50220 = true;
- } else if (maps[i].equalsIgnoreCase("x-windows-iso2022jp/ISO-2022-JP")) {
- iso2022jpIsMSISO2022JP = true;
- }
- }
- }
- if (sjisIsMS932) {
- deleteCharset("Shift_JIS",
- new String[] {
- // IANA aliases
- "sjis", // historical
- "shift_jis",
- "shift-jis",
- "ms_kanji",
- "x-sjis",
- "csShiftJIS"
- });
- deleteCharset("windows-31j",
- new String[] {
- "MS932", // JDK historical
- "windows-932",
- "csWindows31J"
- });
- charset("Shift_JIS", "SJIS",
- new String[] {
- // IANA aliases
- "sjis" // JDK historical
- });
- charset("windows-31j", "MS932",
- new String[] {
- "MS932", // JDK historical
- "windows-932",
- "csWindows31J",
- "shift-jis",
- "ms_kanji",
- "x-sjis",
- "csShiftJIS",
- // This alias takes precedence over the actual
- // Shift_JIS charset itself since aliases are always
- // resolved first, before looking up canonical names.
- "shift_jis"
- });
- }
- if (iso2022jpIsMS50221 ||
- iso2022jpIsMS50220 ||
- iso2022jpIsMSISO2022JP) {
- deleteCharset("ISO-2022-JP",
- new String[] {
- "iso2022jp",
- "jis",
- "csISO2022JP",
- "jis_encoding",
- "csjisencoding"
- });
- if (iso2022jpIsMS50221) {
- deleteCharset("x-windows-50221",
- new String[] {
- "cp50221",
- "ms50221"
- });
- charset("x-windows-50221", "MS50221",
- new String[] {
- "cp50221",
- "ms50221",
- "iso-2022-jp",
- "iso2022jp",
- "jis",
- "csISO2022JP",
- "jis_encoding",
- "csjisencoding"
- });
- } else if (iso2022jpIsMS50220) {
- deleteCharset("x-windows-50220",
- new String[] {
- "cp50220",
- "ms50220"
- });
- charset("x-windows-50220", "MS50220",
- new String[] {
- "cp50220",
- "ms50220",
- "iso-2022-jp",
- "iso2022jp",
- "jis",
- "csISO2022JP",
- "jis_encoding",
- "csjisencoding"
- });
- } else {
- deleteCharset("x-windows-iso2022jp",
- new String[] {
- "windows-iso2022jp"
- });
- charset("x-windows-iso2022jp", "MSISO2022JP",
- new String[] {
- "windows-iso2022jp",
- "iso-2022-jp",
- "iso2022jp",
- "jis",
- "csISO2022JP",
- "jis_encoding",
- "csjisencoding"
- });
-
-
- }
- }
- String osName = getProperty("os.name");
- if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName)
- || osName.contains("OS X")) {
- charset("x-COMPOUND_TEXT", "COMPOUND_TEXT",
- new String[] {
- "COMPOUND_TEXT", // JDK historical
- "x11-compound_text",
- "x-compound-text"
- });
- }
- initialized = true;
- }
-
- private static String getProperty(String key) {
- // this method may be called during initialization of
- // system class loader and thus not using lambda
- return AccessController.doPrivileged(
- new PrivilegedAction() {
- @Override
- public String run() {
- return System.getProperty(key);
- }
- });
- }
-
- public static String[] aliasesFor(String charsetName) {
- if (instance == null)
- return null;
- return instance.aliases(charsetName);
- }
-}
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
new file mode 100644
index 00000000000..a37d43b0787
--- /dev/null
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
@@ -0,0 +1,256 @@
+/*
+ * 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
+ * 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.
+ *
+ */
+
+// -- This file was mechanically generated: Do not edit! -- //
+
+package sun.nio.cs.ext;
+
+import java.lang.ref.SoftReference;
+import java.nio.charset.Charset;
+import java.nio.charset.spi.CharsetProvider;
+import sun.nio.cs.AbstractCharsetProvider;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import sun.nio.cs.AbstractCharsetProvider;
+
+/**
+ * Provider for extended charsets.
+ */
+
+public class ExtendedCharsets extends AbstractCharsetProvider {
+
+ static volatile ExtendedCharsets instance = null;
+
+ public ExtendedCharsets() {
+
+ super("sun.nio.cs.ext"); // identify provider pkg name.
+
+ _CHARSETS_DEF_LIST_
+
+ instance = this;
+
+ }
+
+ private boolean initialized = false;
+
+ // If the sun.nio.cs.map property is defined on the command line we won't
+ // see it in the system-properties table until after the charset subsystem
+ // has been initialized. We therefore delay the effect of this property
+ // until after the JRE has completely booted.
+ //
+ // At the moment following values for this property are supported, property
+ // value string is case insensitive.
+ //
+ // (1)"Windows-31J/Shift_JIS"
+ // In 1.4.1 we added a correct implementation of the Shift_JIS charset
+ // but in previous releases this charset name had been treated as an alias
+ // for Windows-31J, aka MS932. Users who have existing code that depends
+ // upon this alias can restore the previous behavior by defining this
+ // property to have this value.
+ //
+ // (2)"x-windows-50221/ISO-2022-JP"
+ // "x-windows-50220/ISO-2022-JP"
+ // "x-windows-iso2022jp/ISO-2022-JP"
+ // The charset ISO-2022-JP is a "standard based" implementation by default,
+ // which supports ASCII, JIS_X_0201 and JIS_X_0208 mappings based encoding
+ // and decoding only.
+ // There are three Microsoft iso-2022-jp variants, namely x-windows-50220,
+ // x-windows-50221 and x-windows-iso2022jp which behaves "slightly" differently
+ // compared to the "standard based" implementation. See ISO2022_JP.java for
+ // detailed description. Users who prefer the behavior of MS iso-2022-jp
+ // variants should use these names explicitly instead of using "ISO-2022-JP"
+ // and its aliases. However for those who need the ISO-2022-JP charset behaves
+ // exactly the same as MS variants do, above properties can be defined to
+ // switch.
+ //
+ // If we need to define other charset-alias mappings in the future then
+ // this property could be further extended, the general idea being that its
+ // value should be of the form
+ //
+ // new-charset-1/old-charset-1,new-charset-2/old-charset-2,...
+ //
+ // where each charset named to the left of a slash is intended to replace
+ // (most) uses of the charset named to the right of the slash.
+ //
+ protected void init() {
+ if (initialized)
+ return;
+ if (!sun.misc.VM.isBooted())
+ return;
+
+ String map = getProperty("sun.nio.cs.map");
+ boolean sjisIsMS932 = false;
+ boolean iso2022jpIsMS50221 = false;
+ boolean iso2022jpIsMS50220 = false;
+ boolean iso2022jpIsMSISO2022JP = false;
+ if (map != null) {
+ String[] maps = map.split(",");
+ for (int i = 0; i < maps.length; i++) {
+ if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
+ sjisIsMS932 = true;
+ } else if (maps[i].equalsIgnoreCase("x-windows-50221/ISO-2022-JP")) {
+ iso2022jpIsMS50221 = true;
+ } else if (maps[i].equalsIgnoreCase("x-windows-50220/ISO-2022-JP")) {
+ iso2022jpIsMS50220 = true;
+ } else if (maps[i].equalsIgnoreCase("x-windows-iso2022jp/ISO-2022-JP")) {
+ iso2022jpIsMSISO2022JP = true;
+ }
+ }
+ }
+ if (sjisIsMS932 && hasCharset("Shift_JIS")) {
+ deleteCharset("Shift_JIS",
+ new String[] {
+ // IANA aliases
+ "sjis", // historical
+ "shift_jis",
+ "shift-jis",
+ "ms_kanji",
+ "x-sjis",
+ "csShiftJIS"
+ });
+ deleteCharset("windows-31j",
+ new String[] {
+ "MS932", // JDK historical
+ "windows-932",
+ "csWindows31J"
+ });
+ charset("Shift_JIS", "SJIS",
+ new String[] {
+ // IANA aliases
+ "sjis" // JDK historical
+ });
+ charset("windows-31j", "MS932",
+ new String[] {
+ "MS932", // JDK historical
+ "windows-932",
+ "csWindows31J",
+ "shift-jis",
+ "ms_kanji",
+ "x-sjis",
+ "csShiftJIS",
+ // This alias takes precedence over the actual
+ // Shift_JIS charset itself since aliases are always
+ // resolved first, before looking up canonical names.
+ "shift_jis"
+ });
+ }
+ if (iso2022jpIsMS50221 ||
+ iso2022jpIsMS50220 ||
+ iso2022jpIsMSISO2022JP) {
+ deleteCharset("ISO-2022-JP",
+ new String[] {
+ "iso2022jp",
+ "jis",
+ "csISO2022JP",
+ "jis_encoding",
+ "csjisencoding"
+ });
+ if (iso2022jpIsMS50221) {
+ deleteCharset("x-windows-50221",
+ new String[] {
+ "cp50221",
+ "ms50221"
+ });
+ charset("x-windows-50221", "MS50221",
+ new String[] {
+ "cp50221",
+ "ms50221",
+ "iso-2022-jp",
+ "iso2022jp",
+ "jis",
+ "csISO2022JP",
+ "jis_encoding",
+ "csjisencoding"
+ });
+ } else if (iso2022jpIsMS50220) {
+ deleteCharset("x-windows-50220",
+ new String[] {
+ "cp50220",
+ "ms50220"
+ });
+ charset("x-windows-50220", "MS50220",
+ new String[] {
+ "cp50220",
+ "ms50220",
+ "iso-2022-jp",
+ "iso2022jp",
+ "jis",
+ "csISO2022JP",
+ "jis_encoding",
+ "csjisencoding"
+ });
+ } else {
+ deleteCharset("x-windows-iso2022jp",
+ new String[] {
+ "windows-iso2022jp"
+ });
+ charset("x-windows-iso2022jp", "MSISO2022JP",
+ new String[] {
+ "windows-iso2022jp",
+ "iso-2022-jp",
+ "iso2022jp",
+ "jis",
+ "csISO2022JP",
+ "jis_encoding",
+ "csjisencoding"
+ });
+
+
+ }
+ }
+ String osName = getProperty("os.name");
+ if ("SunOS".equals(osName) || "Linux".equals(osName) || "AIX".equals(osName)
+ || osName.contains("OS X")) {
+ charset("x-COMPOUND_TEXT", "COMPOUND_TEXT",
+ new String[] {
+ "COMPOUND_TEXT", // JDK historical
+ "x11-compound_text",
+ "x-compound-text"
+ });
+ }
+ initialized = true;
+ }
+
+ private static String getProperty(String key) {
+ // this method may be called during initialization of
+ // system class loader and thus not using lambda
+ return AccessController.doPrivileged(
+ new PrivilegedAction() {
+ @Override
+ public String run() {
+ return System.getProperty(key);
+ }
+ });
+ }
+
+ public static String[] aliasesFor(String charsetName) {
+ if (instance == null)
+ return null;
+ return instance.aliases(charsetName);
+ }
+
+}
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM834.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM834.java
index 8d54e9c9c97..513dc55f432 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM834.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM834.java
@@ -34,6 +34,7 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
+import sun.nio.cs.DoubleByte;
import static sun.nio.cs.CharsetMapping.*;
// EBCDIC DBCS-only Korean
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM942C.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM942C.java
index 0c631f6179a..2054609f5dc 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM942C.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM942C.java
@@ -29,6 +29,7 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
import static sun.nio.cs.CharsetMapping.*;
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM943C.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM943C.java
index b9d856a3b08..fefc9af4231 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM943C.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM943C.java
@@ -29,6 +29,7 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
public class IBM943C extends Charset implements HistoricallyNamedCharset
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM949C.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM949C.java
index a77fbfedddf..194b56719fd 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM949C.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/IBM949C.java
@@ -29,6 +29,7 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
public class IBM949C extends Charset implements HistoricallyNamedCharset
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN.java
index 3c7a7d47cd6..4041522754d 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN.java
@@ -35,8 +35,10 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CharacterCodingException;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.US_ASCII;
+import sun.nio.cs.*;
public class ISO2022_CN
extends Charset
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_GB.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_GB.java
index 518b7f7c500..1faaa537d7f 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_GB.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_CN_GB.java
@@ -34,6 +34,7 @@ import java.nio.CharBuffer;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
+import sun.nio.cs.*;
import sun.nio.cs.HistoricallyNamedCharset;
public class ISO2022_CN_GB extends ISO2022 implements HistoricallyNamedCharset
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java
index 40e9a1a7556..1125ffb7914 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP.java
@@ -32,9 +32,12 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CodingErrorAction;
+import sun.nio.cs.DelegatableDecoder;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.HistoricallyNamedCharset;
import sun.nio.cs.Surrogate;
import sun.nio.cs.US_ASCII;
+import sun.nio.cs.*;
import static sun.nio.cs.CharsetMapping.*;
/*
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java
index 8d0d4e0bdaf..3a00b7480b5 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_JP_2.java
@@ -28,6 +28,8 @@ package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
public class ISO2022_JP_2 extends ISO2022_JP
{
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_KR.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_KR.java
index 5385b05a2d4..6d96acde6f1 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_KR.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/ISO2022_KR.java
@@ -35,7 +35,7 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.ext.EUC_KR;
+import sun.nio.cs.*;
public class ISO2022_KR extends ISO2022
implements HistoricallyNamedCharset
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/JISAutoDetect.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/JISAutoDetect.java
index a3bedd9ab8e..1219c4fda5b 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/JISAutoDetect.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/JISAutoDetect.java
@@ -33,9 +33,11 @@ import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.MalformedInputException;
+import sun.nio.cs.DelegatableDecoder;
import sun.nio.cs.HistoricallyNamedCharset;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import sun.nio.cs.*;
import static java.lang.Character.UnicodeBlock;
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50220.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50220.java
index 9cb36f3a40d..2b18f7d419d 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50220.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50220.java
@@ -28,6 +28,8 @@ package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
public class MS50220 extends ISO2022_JP
{
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50221.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50221.java
index cdc1894406a..aaf052e106b 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50221.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS50221.java
@@ -26,6 +26,7 @@
package sun.nio.cs.ext;
import java.nio.charset.Charset;
+import sun.nio.cs.*;
public class MS50221 extends MS50220
{
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS932_0213.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS932_0213.java
index 035ba6a34ba..4eb2ca4db3e 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS932_0213.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS932_0213.java
@@ -28,6 +28,8 @@ package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
import static sun.nio.cs.CharsetMapping.*;
public class MS932_0213 extends Charset {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
index 505e4471910..bf7ff2bd20c 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS.java
@@ -29,6 +29,7 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import sun.nio.cs.HistoricallyNamedCharset;
+import sun.nio.cs.*;
import static sun.nio.cs.CharsetMapping.*;
public class MS950_HKSCS extends Charset implements HistoricallyNamedCharset
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java.template
similarity index 96%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java
rename to jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java.template
index 2fddb927914..bc009b0a264 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MS950_HKSCS_XP.java.template
@@ -23,18 +23,20 @@
* questions.
*/
-package sun.nio.cs.ext;
+package $PACKAGE$;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.HKSCS;
import sun.nio.cs.HistoricallyNamedCharset;
import static sun.nio.cs.CharsetMapping.*;
public class MS950_HKSCS_XP extends Charset
{
public MS950_HKSCS_XP() {
- super("x-MS950-HKSCS-XP", ExtendedCharsets.aliasesFor("x-MS950-HKSCS-XP"));
+ super("x-MS950-HKSCS-XP", $ALIASES$);
}
public boolean contains(Charset cs) {
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MSISO2022JP.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MSISO2022JP.java
index 188116ed34e..0949960775d 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MSISO2022JP.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/MSISO2022JP.java
@@ -28,6 +28,7 @@ package sun.nio.cs.ext;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
+import sun.nio.cs.DoubleByte;
public class MSISO2022JP extends ISO2022_JP
{
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/SJIS_0213.java b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/SJIS_0213.java
index 10fd8b726a6..9a6efd7ecf5 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/SJIS_0213.java
+++ b/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/SJIS_0213.java
@@ -35,6 +35,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Arrays;
import sun.nio.cs.CharsetMapping;
+import sun.nio.cs.*;
/*
* 5 types of entry in SJIS_X_0213/Unicode mapping table
diff --git a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java
index e20120bc8a1..a6bb8795d4a 100644
--- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java
+++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/ECDSASignature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -45,6 +45,12 @@ import sun.security.util.*;
* . "SHA256withECDSA"
* . "SHA384withECDSA"
* . "SHA512withECDSA"
+ * . "NONEwithECDSAinP1363Format"
+ * . "SHA1withECDSAinP1363Format"
+ * . "SHA224withECDSAinP1363Format"
+ * . "SHA256withECDSAinP1363Format"
+ * . "SHA384withECDSAinP1363Format"
+ * . "SHA512withECDSAinP1363Format"
*
* @since 1.7
*/
@@ -65,29 +71,56 @@ abstract class ECDSASignature extends SignatureSpi {
// public key, if initialized for verifying
private ECPublicKey publicKey;
+ // The format. true for the IEEE P1363 format. false (default) for ASN.1
+ private final boolean p1363Format;
+
/**
- * Constructs a new ECDSASignature. Used by Raw subclass.
+ * Constructs a new ECDSASignature.
*
* @exception ProviderException if the native ECC library is unavailable.
*/
ECDSASignature() {
- messageDigest = null;
+ this(false);
+ }
+
+ /**
+ * Constructs a new ECDSASignature that will use the specified
+ * signature format. {@code p1363Format} should be {@code true} to
+ * use the IEEE P1363 format. If {@code p1363Format} is {@code false},
+ * the DER-encoded ASN.1 format will be used. This constructor is
+ * used by the RawECDSA subclasses.
+ */
+ ECDSASignature(boolean p1363Format) {
+ this.messageDigest = null;
+ this.p1363Format = p1363Format;
}
/**
* Constructs a new ECDSASignature. Used by subclasses.
*/
ECDSASignature(String digestName) {
+ this(digestName, false);
+ }
+
+ /**
+ * Constructs a new ECDSASignature that will use the specified
+ * digest and signature format. {@code p1363Format} should be
+ * {@code true} to use the IEEE P1363 format. If {@code p1363Format}
+ * is {@code false}, the DER-encoded ASN.1 format will be used. This
+ * constructor is used by subclasses.
+ */
+ ECDSASignature(String digestName, boolean p1363Format) {
try {
messageDigest = MessageDigest.getInstance(digestName);
} catch (NoSuchAlgorithmException e) {
throw new ProviderException(e);
}
- needsReset = false;
+ this.needsReset = false;
+ this.p1363Format = p1363Format;
}
- // Nested class for NONEwithECDSA signatures
- public static final class Raw extends ECDSASignature {
+ // Class for Raw ECDSA signatures.
+ static class RawECDSA extends ECDSASignature {
// the longest supported digest is 512 bits (SHA-512)
private static final int RAW_ECDSA_MAX = 64;
@@ -95,7 +128,8 @@ abstract class ECDSASignature extends SignatureSpi {
private final byte[] precomputedDigest;
private int offset = 0;
- public Raw() {
+ RawECDSA(boolean p1363Format) {
+ super(p1363Format);
precomputedDigest = new byte[RAW_ECDSA_MAX];
}
@@ -156,6 +190,20 @@ abstract class ECDSASignature extends SignatureSpi {
}
}
+ // Nested class for NONEwithECDSA signatures
+ public static final class Raw extends RawECDSA {
+ public Raw() {
+ super(false);
+ }
+ }
+
+ // Nested class for NONEwithECDSAinP1363Format signatures
+ public static final class RawinP1363Format extends RawECDSA {
+ public RawinP1363Format() {
+ super(true);
+ }
+ }
+
// Nested class for SHA1withECDSA signatures
public static final class SHA1 extends ECDSASignature {
public SHA1() {
@@ -163,6 +211,13 @@ abstract class ECDSASignature extends SignatureSpi {
}
}
+ // Nested class for SHA1withECDSAinP1363Format signatures
+ public static final class SHA1inP1363Format extends ECDSASignature {
+ public SHA1inP1363Format() {
+ super("SHA1", true);
+ }
+ }
+
// Nested class for SHA224withECDSA signatures
public static final class SHA224 extends ECDSASignature {
public SHA224() {
@@ -170,6 +225,13 @@ abstract class ECDSASignature extends SignatureSpi {
}
}
+ // Nested class for SHA224withECDSAinP1363Format signatures
+ public static final class SHA224inP1363Format extends ECDSASignature {
+ public SHA224inP1363Format() {
+ super("SHA-224", true);
+ }
+ }
+
// Nested class for SHA256withECDSA signatures
public static final class SHA256 extends ECDSASignature {
public SHA256() {
@@ -177,6 +239,13 @@ abstract class ECDSASignature extends SignatureSpi {
}
}
+ // Nested class for SHA256withECDSAinP1363Format signatures
+ public static final class SHA256inP1363Format extends ECDSASignature {
+ public SHA256inP1363Format() {
+ super("SHA-256", true);
+ }
+ }
+
// Nested class for SHA384withECDSA signatures
public static final class SHA384 extends ECDSASignature {
public SHA384() {
@@ -184,6 +253,13 @@ abstract class ECDSASignature extends SignatureSpi {
}
}
+ // Nested class for SHA384withECDSAinP1363Format signatures
+ public static final class SHA384inP1363Format extends ECDSASignature {
+ public SHA384inP1363Format() {
+ super("SHA-384", true);
+ }
+ }
+
// Nested class for SHA512withECDSA signatures
public static final class SHA512 extends ECDSASignature {
public SHA512() {
@@ -191,6 +267,13 @@ abstract class ECDSASignature extends SignatureSpi {
}
}
+ // Nested class for SHA512withECDSAinP1363Format signatures
+ public static final class SHA512inP1363Format extends ECDSASignature {
+ public SHA512inP1363Format() {
+ super("SHA-512", true);
+ }
+ }
+
// initialize for verification. See JCA doc
@Override
protected void engineInitVerify(PublicKey publicKey)
@@ -286,14 +369,18 @@ abstract class ECDSASignature extends SignatureSpi {
}
random.nextBytes(seed);
+ byte[] sig;
try {
-
- return encodeSignature(
- signDigest(getDigestValue(), s, encodedParams, seed));
-
+ sig = signDigest(getDigestValue(), s, encodedParams, seed);
} catch (GeneralSecurityException e) {
throw new SignatureException("Could not sign data", e);
}
+
+ if (p1363Format) {
+ return sig;
+ } else {
+ return encodeSignature(sig);
+ }
}
// verify the data and return the result. See JCA doc
@@ -311,11 +398,15 @@ abstract class ECDSASignature extends SignatureSpi {
w = ECUtil.encodePoint(publicKey.getW(), params.getCurve());
}
+ byte[] sig;
+ if (p1363Format) {
+ sig = signature;
+ } else {
+ sig = decodeSignature(signature);
+ }
+
try {
-
- return verifySignedDigest(
- decodeSignature(signature), getDigestValue(), w, encodedParams);
-
+ return verifySignedDigest(sig, getDigestValue(), w, encodedParams);
} catch (GeneralSecurityException e) {
throw new SignatureException("Could not verify signature", e);
}
diff --git a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunECEntries.java b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunECEntries.java
index aa6ad6e7cc3..104f6b2718c 100644
--- a/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunECEntries.java
+++ b/jdk/src/jdk.crypto.ec/share/classes/sun/security/ec/SunECEntries.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -131,6 +131,19 @@ final class SunECEntries {
map.put("Alg.Alias.Signature.OID.1.2.840.10045.4.3.4", "SHA512withECDSA");
map.put("Alg.Alias.Signature.1.2.840.10045.4.3.4", "SHA512withECDSA");
+ map.put("Signature.NONEwithECDSAinP1363Format",
+ "sun.security.ec.ECDSASignature$RawinP1363Format");
+ map.put("Signature.SHA1withECDSAinP1363Format",
+ "sun.security.ec.ECDSASignature$SHA1inP1363Format");
+ map.put("Signature.SHA224withECDSAinP1363Format",
+ "sun.security.ec.ECDSASignature$SHA224inP1363Format");
+ map.put("Signature.SHA256withECDSAinP1363Format",
+ "sun.security.ec.ECDSASignature$SHA256inP1363Format");
+ map.put("Signature.SHA384withECDSAinP1363Format",
+ "sun.security.ec.ECDSASignature$SHA384inP1363Format");
+ map.put("Signature.SHA512withECDSAinP1363Format",
+ "sun.security.ec.ECDSASignature$SHA512inP1363Format");
+
String ecKeyClasses = "java.security.interfaces.ECPublicKey" +
"|java.security.interfaces.ECPrivateKey";
map.put("Signature.NONEwithECDSA SupportedKeyClasses", ecKeyClasses);
diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Signature.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Signature.java
index e5f498ffc71..7a5dffd9ad7 100644
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Signature.java
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/P11Signature.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, 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
@@ -50,6 +50,8 @@ import sun.security.util.KeyUtil;
* . DSA
* . NONEwithDSA (RawDSA)
* . SHA1withDSA
+ * . NONEwithDSAinP1363Format (RawDSAinP1363Format)
+ * . SHA1withDSAinP1363Format
* . RSA:
* . MD2withRSA
* . MD5withRSA
@@ -65,6 +67,12 @@ import sun.security.util.KeyUtil;
* . SHA256withECDSA
* . SHA384withECDSA
* . SHA512withECDSA
+ * . NONEwithECDSAinP1363Format
+ * . SHA1withECDSAinP1363Format
+ * . SHA224withECDSAinP1363Format
+ * . SHA256withECDSAinP1363Format
+ * . SHA384withECDSAinP1363Format
+ * . SHA512withECDSAinP1363Format
*
* Note that the underlying PKCS#11 token may support complete signature
* algorithm (e.g. CKM_DSA_SHA1, CKM_MD5_RSA_PKCS), or it may just
@@ -117,6 +125,12 @@ final class P11Signature extends SignatureSpi {
// total number of bytes processed in current operation
private int bytesProcessed;
+ // The format, to be used for DSA and ECDSA signatures.
+ // If true, the IEEE P1363 format will be used, the concatenation of
+ // r and s. If false (default), the signature will be formatted as a
+ // DER-encoded ASN.1 sequence of r and s.
+ private boolean p1363Format = false;
+
// constant for signing mode
private final static int M_SIGN = 1;
// constant for verification mode
@@ -166,10 +180,12 @@ final class P11Signature extends SignatureSpi {
break;
case (int)CKM_DSA:
keyAlgorithm = "DSA";
- if (algorithm.equals("DSA")) {
+ if (algorithm.equals("DSA") ||
+ algorithm.equals("DSAinP1363Format")) {
type = T_DIGEST;
md = MessageDigest.getInstance("SHA-1");
- } else if (algorithm.equals("RawDSA")) {
+ } else if (algorithm.equals("RawDSA") ||
+ algorithm.equals("RawDSAinP1363Format")) {
type = T_RAW;
buffer = new byte[20];
} else {
@@ -178,20 +194,26 @@ final class P11Signature extends SignatureSpi {
break;
case (int)CKM_ECDSA:
keyAlgorithm = "EC";
- if (algorithm.equals("NONEwithECDSA")) {
+ if (algorithm.equals("NONEwithECDSA") ||
+ algorithm.equals("NONEwithECDSAinP1363Format")) {
type = T_RAW;
buffer = new byte[RAW_ECDSA_MAX];
} else {
String digestAlg;
- if (algorithm.equals("SHA1withECDSA")) {
+ if (algorithm.equals("SHA1withECDSA") ||
+ algorithm.equals("SHA1withECDSAinP1363Format")) {
digestAlg = "SHA-1";
- } else if (algorithm.equals("SHA224withECDSA")) {
+ } else if (algorithm.equals("SHA224withECDSA") ||
+ algorithm.equals("SHA224withECDSAinP1363Format")) {
digestAlg = "SHA-224";
- } else if (algorithm.equals("SHA256withECDSA")) {
+ } else if (algorithm.equals("SHA256withECDSA") ||
+ algorithm.equals("SHA256withECDSAinP1363Format")) {
digestAlg = "SHA-256";
- } else if (algorithm.equals("SHA384withECDSA")) {
+ } else if (algorithm.equals("SHA384withECDSA") ||
+ algorithm.equals("SHA384withECDSAinP1363Format")) {
digestAlg = "SHA-384";
- } else if (algorithm.equals("SHA512withECDSA")) {
+ } else if (algorithm.equals("SHA512withECDSA") ||
+ algorithm.equals("SHA512withECDSAinP1363Format")) {
digestAlg = "SHA-512";
} else {
throw new ProviderException(algorithm);
@@ -235,6 +257,9 @@ final class P11Signature extends SignatureSpi {
this.buffer = buffer;
this.digestOID = digestOID;
this.md = md;
+ if (algorithm.endsWith("inP1363Format")) {
+ this.p1363Format = true;
+ }
}
private void ensureInitialized() {
@@ -582,10 +607,14 @@ final class P11Signature extends SignatureSpi {
signature = token.p11.C_Sign(session.id(), data);
}
}
- if (keyAlgorithm.equals("RSA") == false) {
- return dsaToASN1(signature);
- } else {
+ if (keyAlgorithm.equals("RSA")) {
return signature;
+ } else {
+ if (p1363Format) {
+ return signature;
+ } else {
+ return dsaToASN1(signature);
+ }
}
} catch (PKCS11Exception e) {
throw new ProviderException(e);
@@ -599,10 +628,12 @@ final class P11Signature extends SignatureSpi {
protected boolean engineVerify(byte[] signature) throws SignatureException {
ensureInitialized();
try {
- if (keyAlgorithm.equals("DSA")) {
- signature = asn1ToDSA(signature);
- } else if (keyAlgorithm.equals("EC")) {
- signature = asn1ToECDSA(signature);
+ if (!p1363Format) {
+ if (keyAlgorithm.equals("DSA")) {
+ signature = asn1ToDSA(signature);
+ } else if (keyAlgorithm.equals("EC")) {
+ signature = asn1ToECDSA(signature);
+ }
}
if (type == T_UPDATE) {
token.p11.C_VerifyFinal(session.id(), signature);
diff --git a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java
index 74e5d1e56af..ec4f231ec37 100644
--- a/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java
+++ b/jdk/src/jdk.crypto.pkcs11/share/classes/sun/security/pkcs11/SunPKCS11.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2014, 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
@@ -680,6 +680,12 @@ public final class SunPKCS11 extends AuthProvider {
s("SHA1withDSA", "1.3.14.3.2.13", "1.3.14.3.2.27",
"1.2.840.10040.4.3", "OID.1.2.840.10040.4.3"),
m(CKM_DSA_SHA1, CKM_DSA));
+ d(SIG, "RawDSAinP1363Format", P11Signature,
+ s("NONEwithDSAinP1363Format"),
+ m(CKM_DSA));
+ d(SIG, "DSAinP1363Format", P11Signature,
+ s("SHA1withDSAinP1363Format"),
+ m(CKM_DSA_SHA1, CKM_DSA));
d(SIG, "NONEwithECDSA", P11Signature,
m(CKM_ECDSA));
d(SIG, "SHA1withECDSA", P11Signature,
@@ -697,6 +703,18 @@ public final class SunPKCS11 extends AuthProvider {
d(SIG, "SHA512withECDSA", P11Signature,
s("1.2.840.10045.4.3.4", "OID.1.2.840.10045.4.3.4"),
m(CKM_ECDSA));
+ d(SIG, "NONEwithECDSAinP1363Format", P11Signature,
+ m(CKM_ECDSA));
+ d(SIG, "SHA1withECDSAinP1363Format", P11Signature,
+ m(CKM_ECDSA_SHA1, CKM_ECDSA));
+ d(SIG, "SHA224withECDSAinP1363Format", P11Signature,
+ m(CKM_ECDSA));
+ d(SIG, "SHA256withECDSAinP1363Format", P11Signature,
+ m(CKM_ECDSA));
+ d(SIG, "SHA384withECDSAinP1363Format", P11Signature,
+ m(CKM_ECDSA));
+ d(SIG, "SHA512withECDSAinP1363Format", P11Signature,
+ m(CKM_ECDSA));
d(SIG, "MD2withRSA", P11Signature,
s("1.2.840.113549.1.1.2", "OID.1.2.840.113549.1.1.2"),
m(CKM_MD2_RSA_PKCS, CKM_RSA_PKCS, CKM_RSA_X_509));
@@ -1061,7 +1079,7 @@ public final class SunPKCS11 extends AuthProvider {
}
// EC
if (((type == KA) && algorithm.equals("ECDH"))
- || ((type == SIG) && algorithm.endsWith("ECDSA"))) {
+ || ((type == SIG) && algorithm.contains("ECDSA"))) {
if (keyAlgorithm.equals("EC") == false) {
return false;
}
@@ -1070,7 +1088,8 @@ public final class SunPKCS11 extends AuthProvider {
|| (key instanceof ECPublicKey);
}
// DSA signatures
- if ((type == SIG) && algorithm.endsWith("DSA")) {
+ if ((type == SIG) && algorithm.contains("DSA") &&
+ !algorithm.contains("ECDSA")) {
if (keyAlgorithm.equals("DSA") == false) {
return false;
}
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/PolicyTool.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/PolicyTool.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_de.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_de.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_de.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_de.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_es.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_es.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_es.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_es.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_fr.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_fr.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_fr.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_fr.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_it.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_it.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_it.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_it.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ja.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ja.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ja.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ja.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ko.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ko.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_ko.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_ko.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_pt_BR.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_pt_BR.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_pt_BR.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_pt_BR.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_sv.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_sv.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_sv.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_sv.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_CN.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_CN.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_CN.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_CN.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_HK.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_HK.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_HK.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_HK.java
diff --git a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_TW.java b/jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_TW.java
similarity index 100%
rename from jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/Resources_zh_TW.java
rename to jdk/src/jdk.dev/share/classes/sun/security/tools/policytool/Resources_zh_TW.java
diff --git a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/BatchEnvironment.java b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/BatchEnvironment.java
index 0a4e5435e5f..fff8bb02a0b 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/BatchEnvironment.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/BatchEnvironment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -61,6 +61,7 @@ import sun.tools.java.ClassPath;
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("deprecation")
public class BatchEnvironment extends sun.tools.javac.BatchEnvironment {
/** instance of Main which created this environment */
diff --git a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java
index de93258d7c8..288ad5270b8 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/rmi/rmic/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -676,7 +676,7 @@ public class Main implements sun.rmi.rmic.Constants {
* Compile a single class.
* Fallthrough is intentional
*/
- @SuppressWarnings("fallthrough")
+ @SuppressWarnings({"fallthrough", "deprecation"})
public boolean compileClass (ClassDeclaration c,
ByteArrayOutputStream buf,
BatchEnvironment env)
diff --git a/jdk/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java b/jdk/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java
index b7d75e44799..6824a855a48 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/BinaryClass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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,6 +39,7 @@ import java.util.Enumeration;
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("deprecation")
public final
class BinaryClass extends ClassDefinition implements Constants {
BinaryConstantPool cpool;
diff --git a/jdk/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java b/jdk/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java
index f096205c0f4..039eaa139e0 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/ClassDefinition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -41,6 +41,7 @@ import sun.tools.tree.UplevelReference;
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("deprecation")
public
class ClassDefinition implements Constants {
diff --git a/jdk/src/jdk.rmic/share/classes/sun/tools/java/MemberDefinition.java b/jdk/src/jdk.rmic/share/classes/sun/tools/java/MemberDefinition.java
index c7060e729d0..c426e9e66ac 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/MemberDefinition.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/MemberDefinition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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 @@ import java.util.HashMap;
* supported API. Code that depends on them does so at its own risk:
* they are subject to change or removal without notice.
*/
+@SuppressWarnings("deprecation")
public
class MemberDefinition implements Constants {
protected long where;
diff --git a/jdk/src/jdk.rmic/share/classes/sun/tools/java/Scanner.java b/jdk/src/jdk.rmic/share/classes/sun/tools/java/Scanner.java
index 7dfa6ee37c8..e2112102ae8 100644
--- a/jdk/src/jdk.rmic/share/classes/sun/tools/java/Scanner.java
+++ b/jdk/src/jdk.rmic/share/classes/sun/tools/java/Scanner.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -58,6 +58,7 @@ import java.util.Hashtable;
* @author Arthur van Hoff
*/
+@SuppressWarnings("deprecation")
public
class Scanner implements Constants {
/**
diff --git a/jdk/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c b/jdk/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c
index 2e8d1f9a59a..1e1b9f87685 100644
--- a/jdk/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c
+++ b/jdk/src/jdk.sctp/unix/native/libsctp/SctpChannelImpl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -464,11 +464,6 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0
union sctp_notification *snp;
jboolean allocated = JNI_FALSE;
- if (rv > SCTP_NOTIFICATION_SIZE) {
- JNU_ThrowInternalError(env, "should not reach here");
- return -1;
- }
-
if (!(msg->msg_flags & MSG_EOR) && length < SCTP_NOTIFICATION_SIZE) {
char* newBuf;
int rvSAVE = rv;
diff --git a/jdk/test/TEST.groups b/jdk/test/TEST.groups
index 7acb6ab9147..e102455ec8d 100644
--- a/jdk/test/TEST.groups
+++ b/jdk/test/TEST.groups
@@ -407,6 +407,7 @@ needs_jdk = \
com/sun/tools \
demo \
sun/security/tools/jarsigner \
+ sun/security/tools/policytool \
sun/rmi/rmic \
sun/tools \
sun/jvmstat \
@@ -456,7 +457,6 @@ needs_jre = \
com/oracle/security/ucrypto/TestRSA.java \
sun/net/ftp \
sun/net/www/protocol/ftp \
- sun/security/tools/policytool \
java/net/URI/URItoURLTest.java \
java/net/URL/URIToURLTest.java \
java/net/URLConnection/HandleContentTypeWithAttrs.java \
diff --git a/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java
new file mode 100644
index 00000000000..8d05806dc5f
--- /dev/null
+++ b/jdk/test/com/sun/crypto/provider/Cipher/AES/TestGHASH.java
@@ -0,0 +1,166 @@
+/*
+ * Copyright (c) 2015, Red Hat, Inc.
+ * 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 8069072
+ * @summary Test vectors for com.sun.crypto.provider.GHASH
+ */
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.nio.ByteBuffer;
+
+public class TestGHASH {
+
+ private final Constructor> GHASH;
+ private final Method UPDATE;
+ private final Method DIGEST;
+
+ TestGHASH(String className) throws Exception {
+ Class> cls = Class.forName(className);
+ GHASH = cls.getDeclaredConstructor(byte[].class);
+ GHASH.setAccessible(true);
+ UPDATE = cls.getDeclaredMethod("update", byte[].class);
+ UPDATE.setAccessible(true);
+ DIGEST = cls.getDeclaredMethod("digest");
+ DIGEST.setAccessible(true);
+ }
+
+
+ private Object newGHASH(byte[] H) throws Exception {
+ return GHASH.newInstance(H);
+ }
+
+ private void updateGHASH(Object hash, byte[] data)
+ throws Exception {
+ UPDATE.invoke(hash, data);
+ }
+
+ private byte[] digestGHASH(Object hash) throws Exception {
+ return (byte[]) DIGEST.invoke(hash);
+ }
+
+ private static final String HEX_DIGITS = "0123456789abcdef";
+
+ private static String hex(byte[] bs) {
+ StringBuilder sb = new StringBuilder(2 * bs.length);
+ for (byte b : bs) {
+ sb.append(HEX_DIGITS.charAt((b >> 4) & 0xF));
+ sb.append(HEX_DIGITS.charAt(b & 0xF));
+ }
+ return sb.toString();
+ }
+
+ private static byte[] bytes(String hex) {
+ if ((hex.length() & 1) != 0) {
+ throw new AssertionError();
+ }
+ byte[] result = new byte[hex.length() / 2];
+ for (int i = 0; i < result.length; ++i) {
+ int a = HEX_DIGITS.indexOf(hex.charAt(2 * i));
+ int b = HEX_DIGITS.indexOf(hex.charAt(2 * i + 1));
+ if ((a | b) < 0) {
+ if (a < 0) {
+ throw new AssertionError(
+ "bad character " + (int) hex.charAt(2 * i));
+ }
+ throw new AssertionError(
+ "bad character " + (int) hex.charAt(2 * i + 1));
+ }
+ result[i] = (byte) ((a << 4) | b);
+ }
+ return result;
+ }
+
+ private static byte[] bytes(long L0, long L1) {
+ return ByteBuffer.allocate(16)
+ .putLong(L0)
+ .putLong(L1)
+ .array();
+ }
+
+ private void check(int testCase, String H, String A,
+ String C, String expected) throws Exception {
+ int lenA = A.length() * 4;
+ while ((A.length() % 32) != 0) {
+ A += '0';
+ }
+ int lenC = C.length() * 4;
+ while ((C.length() % 32) != 0) {
+ C += '0';
+ }
+
+ Object hash = newGHASH(bytes(H));
+ updateGHASH(hash, bytes(A));
+ updateGHASH(hash, bytes(C));
+ updateGHASH(hash, bytes(lenA, lenC));
+ byte[] digest = digestGHASH(hash);
+ String actual = hex(digest);
+ if (!expected.equals(actual)) {
+ throw new AssertionError(String.format("%d: expected %s, got %s",
+ testCase, expected, actual));
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ TestGHASH test;
+ if (args.length == 0) {
+ test = new TestGHASH("com.sun.crypto.provider.GHASH");
+ } else {
+ test = new TestGHASH(args[0]);
+ }
+
+ // Test vectors from David A. McGrew, John Viega,
+ // "The Galois/Counter Mode of Operation (GCM)", 2005.
+ //
+
+ test.check(1, "66e94bd4ef8a2c3b884cfa59ca342b2e", "", "",
+ "00000000000000000000000000000000");
+ test.check(2,
+ "66e94bd4ef8a2c3b884cfa59ca342b2e", "",
+ "0388dace60b6a392f328c2b971b2fe78",
+ "f38cbb1ad69223dcc3457ae5b6b0f885");
+ test.check(3,
+ "b83b533708bf535d0aa6e52980d53b78", "",
+ "42831ec2217774244b7221b784d0d49c" +
+ "e3aa212f2c02a4e035c17e2329aca12e" +
+ "21d514b25466931c7d8f6a5aac84aa05" +
+ "1ba30b396a0aac973d58e091473f5985",
+ "7f1b32b81b820d02614f8895ac1d4eac");
+ test.check(4,
+ "b83b533708bf535d0aa6e52980d53b78",
+ "feedfacedeadbeeffeedfacedeadbeef" + "abaddad2",
+ "42831ec2217774244b7221b784d0d49c" +
+ "e3aa212f2c02a4e035c17e2329aca12e" +
+ "21d514b25466931c7d8f6a5aac84aa05" +
+ "1ba30b396a0aac973d58e091",
+ "698e57f70e6ecc7fd9463b7260a9ae5f");
+ test.check(5, "b83b533708bf535d0aa6e52980d53b78",
+ "feedfacedeadbeeffeedfacedeadbeef" + "abaddad2",
+ "61353b4c2806934a777ff51fa22a4755" +
+ "699b2a714fcdc6f83766e5f97b6c7423" +
+ "73806900e49f24b22b097544d4896b42" +
+ "4989b5e1ebac0f07c23f4598",
+ "df586bb4c249b92cb6922877e444d37b");
+ }
+}
diff --git a/jdk/test/com/sun/jdi/ShellScaffold.sh b/jdk/test/com/sun/jdi/ShellScaffold.sh
index d2fd876a509..cf0cdbe43d0 100644
--- a/jdk/test/com/sun/jdi/ShellScaffold.sh
+++ b/jdk/test/com/sun/jdi/ShellScaffold.sh
@@ -259,7 +259,7 @@ setup()
;;
esac
- if [ -r $jdk/bin/dt_shmem.dll -o -r $jdk/jre/bin/dt_shmem.dll ] ; then
+ if [ -r $jdk/bin/dt_shmem.dll ] ; then
transport=dt_shmem
address=kkkk.$$
else
@@ -933,18 +933,10 @@ dojstack()
debuggeeCmd=`$jdk/bin/jps -v | $grep $debuggeeKeyword`
realDebuggeePid=`echo "$debuggeeCmd" | sed -e 's@ .*@@'`
if [ ! -z "$realDebuggeePid" ] ; then
- if [ -r "$jdk/lib/sa-jdi.jar" ] ; then
- # disableVersionCheck can be removed after 6475822
- # is fixed.
- moption="-m -J-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck"
- else
- moption=
- fi
-
echo "-- debuggee process info ----------------------" >&2
echo " $debuggeeCmd" >&2
echo "-- debuggee threads: jstack $moption $realDebuggeePid" >&2
- $jdk/bin/$jstack $moption $realDebuggeePid >&2
+ $jdk/bin/$jstack $realDebuggeePid >&2
echo "=============================================" >&2
echo >&2
fi
diff --git a/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java
new file mode 100644
index 00000000000..18f7a4c7815
--- /dev/null
+++ b/jdk/test/com/sun/nio/sctp/SctpMultiChannel/SendFailed.java
@@ -0,0 +1,189 @@
+/*
+ * 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 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 8067846
+ * @summary Test for send failed notification
+ */
+
+import com.sun.nio.sctp.*;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import static java.lang.System.out;
+import static java.nio.ByteBuffer.*;
+
+public class SendFailed {
+
+ static final SocketAddress remoteAddress = new InetSocketAddress("127.0.0.1", 3000);
+
+ static final int[] bufferSizes =
+ { 20, 49, 50, 51, 100, 101, 1024, 1025, 4095, 4096, 4097, 8191, 8192, 8193};
+
+ void test(String[] args) throws IOException {
+ SocketAddress address = null;
+
+ if (!Util.isSCTPSupported()) {
+ out.println("SCTP protocol is not supported");
+ out.println("Test cannot be run");
+ return;
+ }
+
+ System.out.println("remote address: " + remoteAddress);
+ System.out.println("Note, remote address should not be up");
+
+ /* combinations with various buffer sizes, and offsets */
+ for (int send=0; send < bufferSizes.length; send++) {
+ for (int recv=0; recv < bufferSizes.length; recv++) {
+ for (boolean direct : new boolean[] {true, false})
+ runWithManyOffsets(bufferSizes[send], bufferSizes[recv], direct);
+ }
+ }
+ }
+
+ void runWithManyOffsets(int sendBufferSize, int recvBufferSize, boolean direct)
+ throws IOException
+ {
+ doTest(sendBufferSize, recvBufferSize, direct, 0);
+ doTest(sendBufferSize, recvBufferSize, direct, 1);
+ doTest(sendBufferSize, recvBufferSize, direct, 3);
+ doTest(sendBufferSize, recvBufferSize, direct, 7);
+ doTest(sendBufferSize, recvBufferSize, direct, 9);
+ doTest(sendBufferSize, recvBufferSize, direct, 13);
+ doTest(sendBufferSize, recvBufferSize, direct, 15);
+ }
+
+ void doTest(int sendBufferSize, int recvBufferSize, boolean direct, int offset)
+ throws IOException
+ {
+ debug("%n--- Testing with send size:[%d], recv size:[%d], offset:[%d] "
+ + ", direct [%s]. ", sendBufferSize, recvBufferSize, offset, direct);
+
+ try (SctpMultiChannel channel = SctpMultiChannel.open()) {
+ MessageInfo messageInfo = MessageInfo.createOutgoing(remoteAddress, 0);
+ ByteBuffer sendBuffer = filledBuffer(sendBufferSize, direct);
+
+ debug("%nAttempting to send to %s. ", remoteAddress);
+ int sent = channel.send(sendBuffer, messageInfo);
+ sendBuffer.flip();
+
+ SendFailedNotificationHandler handler =
+ new SendFailedNotificationHandler();
+ ByteBuffer recvBuffer = direct ? allocateDirect(recvBufferSize)
+ : allocate((recvBufferSize));
+ channel.receive(recvBuffer, null, handler);
+
+ // verify sent buffer received by send failed notification
+ ByteBuffer buffer = handler.getSendFailedByteBuffer();
+ check(buffer.remaining() == sent);
+ check(buffer.position() == 0);
+ check(buffer.limit() == sent);
+ assertSameContent(sendBuffer, handler.getSendFailedByteBuffer());
+ }
+ }
+
+ class SendFailedNotificationHandler extends AbstractNotificationHandler