This commit is contained in:
J. Duke 2017-07-05 20:30:53 +02:00
commit ee04c5414a
416 changed files with 5401 additions and 2493 deletions

View File

@ -304,3 +304,4 @@ f25ee9f62427a9ba27418e5531a89754791a305b jdk9-b57
39e8a131289e8386aa4c3e4b184faa812a7c0421 jdk9-b59 39e8a131289e8386aa4c3e4b184faa812a7c0421 jdk9-b59
9fa2185bee17462d1014538bff60af6e6f0b01e7 jdk9-b60 9fa2185bee17462d1014538bff60af6e6f0b01e7 jdk9-b60
ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61 ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62

View File

@ -478,6 +478,15 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
AUTOCONF_DIR=$TOPDIR/common/autoconf AUTOCONF_DIR=$TOPDIR/common/autoconf
]) ])
# Evaluates platform specific overrides for devkit variables.
# $1: Name of variable
AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
[
if test "x[$]$1" = x; then
eval $1="\${$1_${OPENJDK_TARGET_CPU}}"
fi
])
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT], AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
[ [
AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
@ -487,12 +496,27 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
DEVKIT_ROOT="$with_devkit" DEVKIT_ROOT="$with_devkit"
# Check for a meta data info file in the root of the devkit # Check for a meta data info file in the root of the devkit
if test -f "$DEVKIT_ROOT/devkit.info"; then if test -f "$DEVKIT_ROOT/devkit.info"; then
# This potentially sets the following:
# DEVKIT_NAME: A descriptive name of the devkit
# DEVKIT_TOOLCHAIN_PATH: Corresponds to --with-toolchain-path
# DEVKIT_EXTRA_PATH: Corresponds to --with-extra-path
# DEVKIT_SYSROOT: Corresponds to --with-sysroot
. $DEVKIT_ROOT/devkit.info . $DEVKIT_ROOT/devkit.info
# This potentially sets the following:
# A descriptive name of the devkit
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_NAME])
# Corresponds to --with-extra-path
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_EXTRA_PATH])
# Corresponds to --with-toolchain-path
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_TOOLCHAIN_PATH])
# Corresponds to --with-sysroot
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_SYSROOT])
# Identifies the Visual Studio version in the devkit
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_VERSION])
# The Visual Studio include environment variable
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_INCLUDE])
# The Visual Studio lib environment variable
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_VS_LIB])
# Corresponds to --with-msvcr-dll
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCR_DLL])
# Corresponds to --with-msvcp-dll
BASIC_EVAL_DEVKIT_VARIABLE([DEVKIT_MSVCP_DLL])
fi fi
AC_MSG_CHECKING([for devkit]) AC_MSG_CHECKING([for devkit])
@ -502,9 +526,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
AC_MSG_RESULT([$DEVKIT_ROOT]) AC_MSG_RESULT([$DEVKIT_ROOT])
fi fi
if test "x$DEVKIT_EXTRA_PATH" != x; then BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
BASIC_PREPEND_TO_PATH([EXTRA_PATH],$DEVKIT_EXTRA_PATH)
fi
# Fallback default of just /bin if DEVKIT_PATH is not defined # Fallback default of just /bin if DEVKIT_PATH is not defined
if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
@ -681,8 +703,12 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
files_present=`$LS $OUTPUT_ROOT` files_present=`$LS $OUTPUT_ROOT`
# Configure has already touched config.log and confdefs.h in the current dir when this check # Configure has already touched config.log and confdefs.h in the current dir when this check
# is performed. # is performed.
filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \ filtered_files=`$ECHO "$files_present" \
| $TR -d '\n'` | $SED -e 's/config.log//g' \
-e 's/confdefs.h//g' \
-e 's/fixpath.exe//g' \
-e 's/ //g' \
| $TR -d '\n'`
if test "x$filtered_files" != x; then if test "x$filtered_files" != x; then
AC_MSG_NOTICE([Current directory is $CURDIR.]) AC_MSG_NOTICE([Current directory is $CURDIR.])
AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here]) AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])

View File

@ -66,7 +66,7 @@ AC_DEFUN([BASIC_MAKE_WINDOWS_SPACE_SAFE_CYGWIN],
# Going to short mode and back again did indeed matter. Since short mode is # Going to short mode and back again did indeed matter. Since short mode is
# case insensitive, let's make it lowercase to improve readability. # case insensitive, let's make it lowercase to improve readability.
shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Now convert it back to Unix-stile (cygpath) # Now convert it back to Unix-style (cygpath)
input_path=`$CYGPATH -u "$shortmode_path"` input_path=`$CYGPATH -u "$shortmode_path"`
new_path="$input_path" new_path="$input_path"
fi fi

File diff suppressed because it is too large Load Diff

View File

@ -189,11 +189,15 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
ORG_CFLAGS="$CFLAGS" ORG_CFLAGS="$CFLAGS"
ORG_CXXFLAGS="$CXXFLAGS" ORG_CXXFLAGS="$CXXFLAGS"
# autoconf magic only relies on PATH, so update it if tools dir is specified
OLD_PATH="$PATH"
# On Windows, we need to detect the visual studio installation first. # On Windows, we need to detect the visual studio installation first.
# This will change the PATH, but we need to keep that new PATH even # This will change the PATH, but we need to keep that new PATH even
# after toolchain detection is done, since the compiler (on x86) uses # after toolchain detection is done, since the compiler (on x86) uses
# it for DLL resolution in runtime. # it for DLL resolution in runtime.
if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then if test "x$OPENJDK_BUILD_OS" = "xwindows" \
&& test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
# Reset path to VS_PATH. It will include everything that was on PATH at the time we # Reset path to VS_PATH. It will include everything that was on PATH at the time we
# ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV. # ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV.
@ -203,9 +207,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
export LIB="$VS_LIB" export LIB="$VS_LIB"
fi fi
# autoconf magic only relies on PATH, so update it if tools dir is specified
OLD_PATH="$PATH"
# For solaris we really need solaris tools, and not the GNU equivalent. # For solaris we really need solaris tools, and not the GNU equivalent.
# The build tools on Solaris reside in /usr/ccs (C Compilation System), # The build tools on Solaris reside in /usr/ccs (C Compilation System),
# so add that to path before starting to probe. # so add that to path before starting to probe.

View File

@ -210,6 +210,37 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO],
done done
exit 0 exit 0
elif test "x$DEVKIT_VS_VERSION" != x; then
VS_VERSION=$DEVKIT_VS_VERSION
TOOLCHAIN_VERSION=$VS_VERSION
eval VS_DESCRIPTION="\${VS_DESCRIPTION_${VS_VERSION}}"
eval VS_VERSION_INTERNAL="\${VS_VERSION_INTERNAL_${VS_VERSION}}"
eval MSVCR_NAME="\${VS_MSVCR_${VS_VERSION}}"
eval MSVCP_NAME="\${VS_MSVCP_${VS_VERSION}}"
eval PLATFORM_TOOLSET="\${VS_VS_PLATFORM_NAME_${VS_VERSION}}"
VS_PATH="$TOOLCHAIN_PATH:$PATH"
# Convert DEVKIT_VS_INCLUDE into windows style VS_INCLUDE so that it
# can still be exported as INCLUDE for compiler invocations without
# SYSROOT_CFLAGS
OLDIFS="$IFS"
IFS=";"
for i in $DEVKIT_VS_INCLUDE; do
ipath=$i
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([ipath])
VS_INCLUDE="$VS_INCLUDE;$ipath"
done
# Convert DEVKIT_VS_LIB into VS_LIB so that it can still be exported
# as LIB for compiler invocations without SYSROOT_LDFLAGS
for i in $DEVKIT_VS_LIB; do
libpath=$i
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([libpath])
VS_LIB="$VS_LIB;$libpath"
done
IFS="$OLDIFS"
AC_MSG_NOTICE([Found devkit $VS_DESCRIPTION])
elif test "x$with_toolchain_version" != x; then elif test "x$with_toolchain_version" != x; then
# User override; check that it is valid # User override; check that it is valid
if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then if test "x${VALID_VS_VERSIONS/$with_toolchain_version/}" = "x${VALID_VS_VERSIONS}"; then
@ -262,71 +293,81 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
# First-hand choice is to locate and run the vsvars bat file. # First-hand choice is to locate and run the vsvars bat file.
TOOLCHAIN_FIND_VISUAL_STUDIO TOOLCHAIN_FIND_VISUAL_STUDIO
if test "x$VS_ENV_CMD" != x; then # If we have a devkit, skip all of the below.
# We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file. if test "x$DEVKIT_VS_VERSION" = x; then
BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD) if test "x$VS_ENV_CMD" != x; then
# We have found a Visual Studio environment on disk, let's extract variables from the vsvars bat file.
BASIC_FIXUP_EXECUTABLE(VS_ENV_CMD)
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
AC_MSG_NOTICE([Trying to extract Visual Studio environment variables]) AC_MSG_NOTICE([Trying to extract Visual Studio environment variables])
# We need to create a couple of temporary files. # We need to create a couple of temporary files.
VS_ENV_TMP_DIR="$CONFIGURESUPPORT_OUTPUTDIR/vs-env" VS_ENV_TMP_DIR="$CONFIGURESUPPORT_OUTPUTDIR/vs-env"
$MKDIR -p $VS_ENV_TMP_DIR $MKDIR -p $VS_ENV_TMP_DIR
# Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment). # Cannot use the VS10 setup script directly (since it only updates the DOS subshell environment).
# Instead create a shell script which will set the relevant variables when run. # Instead create a shell script which will set the relevant variables when run.
WINPATH_VS_ENV_CMD="$VS_ENV_CMD" WINPATH_VS_ENV_CMD="$VS_ENV_CMD"
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD]) BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_VS_ENV_CMD])
WINPATH_BASH="$BASH" WINPATH_BASH="$BASH"
BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH]) BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([WINPATH_BASH])
# Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell # Generate a DOS batch file which runs $VS_ENV_CMD, and then creates a shell
# script (executable by bash) that will setup the important variables. # script (executable by bash) that will setup the important variables.
EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat" EXTRACT_VC_ENV_BAT_FILE="$VS_ENV_TMP_DIR/extract-vs-env.bat"
$ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE $ECHO "@echo off" > $EXTRACT_VC_ENV_BAT_FILE
# This will end up something like: # This will end up something like:
# call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat # call C:/progra~2/micros~2.0/vc/bin/amd64/vcvars64.bat
$ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE $ECHO "call $WINPATH_VS_ENV_CMD $VS_ENV_ARGS" >> $EXTRACT_VC_ENV_BAT_FILE
# These will end up something like: # These will end up something like:
# C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh # C:/CygWin/bin/bash -c 'echo VS_PATH=\"$PATH\" > localdevenv.sh
# The trailing space for everyone except PATH is no typo, but is needed due # 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. # 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_PATH="'\"$PATH\" > set-vs-env.sh' \
$ECHO "$WINPATH_BASH -c 'echo VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE >> $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 VS_INCLUDE="'\"$INCLUDE\;$include \" >> set-vs-env.sh' \
$ECHO "$WINPATH_BASH -c 'echo VCINSTALLDIR="'\"$VCINSTALLDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE >> $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 VS_LIB="'\"$LIB\;$lib \" >> set-vs-env.sh' \
$ECHO "$WINPATH_BASH -c 'echo WINDOWSSDKDIR="'\"$WINDOWSSDKDIR \" >> set-vs-env.sh' >> $EXTRACT_VC_ENV_BAT_FILE >> $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
# Now execute the newly created bat file. # Now execute the newly created bat file.
# The | cat is to stop SetEnv.Cmd to mess with system colors on msys. # The | cat is to stop SetEnv.Cmd to mess with system colors on msys.
# Change directory so we don't need to mess with Windows paths in redirects. # Change directory so we don't need to mess with Windows paths in redirects.
cd $VS_ENV_TMP_DIR cd $VS_ENV_TMP_DIR
cmd /c extract-vs-env.bat | $CAT cmd /c extract-vs-env.bat | $CAT
cd $CURDIR cd $CURDIR
if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then if test ! -s $VS_ENV_TMP_DIR/set-vs-env.sh; then
AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.]) AC_MSG_NOTICE([Could not succesfully extract the envionment variables needed for the VS setup.])
AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation]) AC_MSG_NOTICE([Try setting --with-tools-dir to the VC/bin directory within the VS installation])
AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.])
AC_MSG_ERROR([Cannot continue]) AC_MSG_ERROR([Cannot continue])
fi
# Now set all paths and other env variables. This will allow the rest of
# the configure script to find and run the compiler in the proper way.
AC_MSG_NOTICE([Setting extracted environment variables])
. $VS_ENV_TMP_DIR/set-vs-env.sh
# Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we
# also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
else
# We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
fi fi
# Now set all paths and other env variables. This will allow the rest of
# the configure script to find and run the compiler in the proper way.
AC_MSG_NOTICE([Setting extracted environment variables])
. $VS_ENV_TMP_DIR/set-vs-env.sh
# Now we have VS_PATH, VS_INCLUDE, VS_LIB. For further checking, we
# also define VCINSTALLDIR, WindowsSdkDir and WINDOWSSDKDIR.
else
# We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
AC_MSG_NOTICE([Cannot locate a valid Visual Studio installation, checking current environment])
fi fi
# At this point, we should have correct variables in the environment, or we can't continue. # At this point, we should have correct variables in the environment, or we can't continue.
AC_MSG_CHECKING([for Visual Studio variables]) AC_MSG_CHECKING([for Visual Studio variables])
if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x \
|| test "x$WINDOWSSDKDIR" != x || test "x$DEVKIT_NAME" != x; then
if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then if test "x$VS_INCLUDE" = x || test "x$VS_LIB" = x; then
AC_MSG_RESULT([present but broken]) AC_MSG_RESULT([present but broken])
AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.]) AC_MSG_ERROR([Your VC command prompt seems broken, INCLUDE and/or LIB is missing.])
@ -403,10 +444,10 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL],
POSSIBLE_MSVC_DLL="$2" POSSIBLE_MSVC_DLL="$2"
METHOD="$3" METHOD="$3"
if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then if test -n "$POSSIBLE_MSVC_DLL" -a -e "$POSSIBLE_MSVC_DLL"; then
AC_MSG_NOTICE([Found $1 at $POSSIBLE_MSVC_DLL using $METHOD]) AC_MSG_NOTICE([Found $DLL_NAME at $POSSIBLE_MSVC_DLL using $METHOD])
# Need to check if the found msvcr is correct architecture # Need to check if the found msvcr is correct architecture
AC_MSG_CHECKING([found $1 architecture]) AC_MSG_CHECKING([found $DLL_NAME architecture])
MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"` MSVC_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVC_DLL"`
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
# The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit" # The MSYS 'file' command returns "PE32 executable for MS Windows (DLL) (GUI) Intel 80386 32-bit"
@ -426,19 +467,19 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL],
if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
AC_MSG_RESULT([ok]) AC_MSG_RESULT([ok])
MSVC_DLL="$POSSIBLE_MSVC_DLL" MSVC_DLL="$POSSIBLE_MSVC_DLL"
AC_MSG_CHECKING([for $1]) BASIC_FIXUP_PATH(MSVC_DLL)
AC_MSG_CHECKING([for $DLL_NAME])
AC_MSG_RESULT([$MSVC_DLL]) AC_MSG_RESULT([$MSVC_DLL])
else else
AC_MSG_RESULT([incorrect, ignoring]) AC_MSG_RESULT([incorrect, ignoring])
AC_MSG_NOTICE([The file type of the located $1 is $MSVC_DLL_FILETYPE]) AC_MSG_NOTICE([The file type of the located $DLL_NAME is $MSVC_DLL_FILETYPE])
fi fi
fi fi
]) ])
AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL], AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
[ [
VAR_NAME="$1" DLL_NAME="$1"
DLL_NAME="$2"
MSVC_DLL= MSVC_DLL=
if test "x$MSVC_DLL" = x; then if test "x$MSVC_DLL" = x; then
@ -517,10 +558,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVC_DLL],
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.]) AC_MSG_ERROR([Could not find $DLL_NAME. Please specify using --with-msvcr-dll.])
fi fi
$1=$MSVC_DLL
BASIC_FIXUP_PATH($1)
AC_SUBST($1, [$]$1)
]) ])
AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS], AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
@ -530,14 +567,22 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
if test "x$with_msvcr_dll" != x; then if test "x$with_msvcr_dll" != x; then
# If given explicitely by user, do not probe. If not present, fail directly. # If given explicitely by user, do not probe. If not present, fail directly.
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcr_dll], TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$with_msvcr_dll], [--with-msvcr-dll])
[--with-msvcr-dll])
if test "x$MSVC_DLL" = x; then if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll]) AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by --with-msvcr-dll])
fi fi
MSVCR_DLL="$MSVC_DLL"
elif test "x$DEVKIT_MSVCR_DLL" != x; then
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCR_NAME, [$DEVKIT_MSVCR_DLL], [devkit])
if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCR_NAME as specified by devkit])
fi
MSVCR_DLL="$MSVC_DLL"
else else
TOOLCHAIN_SETUP_MSVC_DLL([MSVCR_DLL], [${MSVCR_NAME}]) TOOLCHAIN_SETUP_MSVC_DLL([${MSVCR_NAME}])
MSVCR_DLL="$MSVC_DLL"
fi fi
AC_SUBST(MSVCR_DLL)
AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll], AC_ARG_WITH(msvcp-dll, [AS_HELP_STRING([--with-msvcp-dll],
[path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])]) [path to microsoft C++ runtime dll (msvcp*.dll) (Windows only) @<:@probed@:>@])])
@ -545,13 +590,21 @@ AC_DEFUN([TOOLCHAIN_SETUP_VS_RUNTIME_DLLS],
if test "x$MSVCP_NAME" != "x"; then if test "x$MSVCP_NAME" != "x"; then
if test "x$with_msvcp_dll" != x; then if test "x$with_msvcp_dll" != x; then
# If given explicitely by user, do not probe. If not present, fail directly. # If given explicitely by user, do not probe. If not present, fail directly.
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL([$DLL_NAME], [$with_msvcp_dll], TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$with_msvcp_dll], [--with-msvcp-dll])
[--with-msvcp-dll])
if test "x$MSVC_DLL" = x; then if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll]) AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by --with-msvcp-dll])
fi fi
MSVCP_DLL="$MSVC_DLL"
elif test "x$DEVKIT_MSVCP_DLL" != x; then
TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL($MSVCP_NAME, [$DEVKIT_MSVCP_DLL], [devkit])
if test "x$MSVC_DLL" = x; then
AC_MSG_ERROR([Could not find a proper $MSVCP_NAME as specified by devkit])
fi
MSVCP_DLL="$MSVC_DLL"
else else
TOOLCHAIN_SETUP_MSVC_DLL([MSVCP_DLL], [${MSVCP_NAME}]) TOOLCHAIN_SETUP_MSVC_DLL([${MSVCP_NAME}])
MSVCP_DLL="$MSVC_DLL"
fi fi
AC_SUBST(MSVCP_DLL)
fi fi
]) ])

View File

@ -304,3 +304,4 @@ d8ebf1a5b18ccbc849f5bf0f80aa3d78583eee68 jdk9-b57
cda6ae062f85fac5555f4e1318885b0ecd998bd1 jdk9-b59 cda6ae062f85fac5555f4e1318885b0ecd998bd1 jdk9-b59
caa330b275f39282793466529f6864766b31d9fd jdk9-b60 caa330b275f39282793466529f6864766b31d9fd jdk9-b60
d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61 d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61
d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62

View File

@ -464,3 +464,4 @@ ee878f3d6732856f7725c590312bfbe2ffa52cc7 jdk9-b58
96bcaec07cb165782bae1b9a1f28450b37a10e3a jdk9-b59 96bcaec07cb165782bae1b9a1f28450b37a10e3a jdk9-b59
9c916db4bf3bc164a47b5a9cefe5ffd71e111f6a jdk9-b60 9c916db4bf3bc164a47b5a9cefe5ffd71e111f6a jdk9-b60
715d2da5801c410746e92f08066d53bde1496286 jdk9-b61 715d2da5801c410746e92f08066d53bde1496286 jdk9-b61
1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62

View File

@ -74,7 +74,8 @@ LP64=1
!if "$(BUILDARCH)" == "i486" !if "$(BUILDARCH)" == "i486"
MACHINE=I386 MACHINE=I386
CXX_FLAGS=$(CXX_FLAGS) /D "IA32" # VS2013 generates bad l2f without /arch:IA32
CXX_FLAGS=$(CXX_FLAGS) /D "IA32" /arch:IA32
!endif !endif
CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS" CXX_FLAGS=$(CXX_FLAGS) /D "WIN32" /D "_WINDOWS"

View File

@ -449,7 +449,7 @@ reg_class no_special_reg32(
R26 R26
/* R27, */ // heapbase /* R27, */ // heapbase
/* R28, */ // thread /* R28, */ // thread
/* R29, */ // fp R29, // fp
/* R30, */ // lr /* R30, */ // lr
/* R31 */ // sp /* R31 */ // sp
); );
@ -483,7 +483,7 @@ reg_class no_special_reg(
R26, R26_H, R26, R26_H,
/* R27, R27_H, */ // heapbase /* R27, R27_H, */ // heapbase
/* R28, R28_H, */ // thread /* R28, R28_H, */ // thread
/* R29, R29_H, */ // fp R29, R29_H, // fp
/* R30, R30_H, */ // lr /* R30, R30_H, */ // lr
/* R31, R31_H */ // sp /* R31, R31_H */ // sp
); );
@ -758,6 +758,8 @@ definitions %{
source_hpp %{ source_hpp %{
#include "memory/cardTableModRefBS.hpp"
class CallStubImpl { class CallStubImpl {
//-------------------------------------------------------------- //--------------------------------------------------------------
@ -2538,7 +2540,7 @@ RegMask Matcher::modL_proj_mask() {
} }
const RegMask Matcher::method_handle_invoke_SP_save_mask() { const RegMask Matcher::method_handle_invoke_SP_save_mask() {
return RegMask(); return FP_REG_mask();
} }
// helper for encoding java_to_runtime calls on sim // helper for encoding java_to_runtime calls on sim

View File

@ -77,12 +77,6 @@ inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) {
inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) { inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc) {
intptr_t a = intptr_t(sp); intptr_t a = intptr_t(sp);
intptr_t b = intptr_t(fp); intptr_t b = intptr_t(fp);
#ifndef PRODUCT
if (fp)
if (sp > fp || (fp - sp > 0x100000))
for(;;)
asm("nop");
#endif
_sp = sp; _sp = sp;
_unextended_sp = unextended_sp; _unextended_sp = unextended_sp;
_fp = fp; _fp = fp;
@ -104,12 +98,6 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address
inline frame::frame(intptr_t* sp, intptr_t* fp) { inline frame::frame(intptr_t* sp, intptr_t* fp) {
intptr_t a = intptr_t(sp); intptr_t a = intptr_t(sp);
intptr_t b = intptr_t(fp); intptr_t b = intptr_t(fp);
#ifndef PRODUCT
if (fp)
if (sp > fp || (fp - sp > 0x100000))
for(;;)
asm("nop");
#endif
_sp = sp; _sp = sp;
_unextended_sp = sp; _unextended_sp = sp;
_fp = fp; _fp = fp;

View File

@ -32,22 +32,14 @@
#include "compiler/disassembler.hpp" #include "compiler/disassembler.hpp"
#include "memory/resourceArea.hpp" #include "memory/resourceArea.hpp"
#include "nativeInst_aarch64.hpp"
#include "opto/compile.hpp"
#include "opto/node.hpp"
#include "runtime/biasedLocking.hpp" #include "runtime/biasedLocking.hpp"
#include "runtime/icache.hpp" #include "runtime/icache.hpp"
#include "runtime/interfaceSupport.hpp" #include "runtime/interfaceSupport.hpp"
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
// #include "gc_interface/collectedHeap.inline.hpp"
// #include "interpreter/interpreter.hpp"
// #include "memory/cardTableModRefBS.hpp"
// #include "prims/methodHandles.hpp"
// #include "runtime/biasedLocking.hpp"
// #include "runtime/interfaceSupport.hpp"
// #include "runtime/objectMonitor.hpp"
// #include "runtime/os.hpp"
// #include "runtime/sharedRuntime.hpp"
// #include "runtime/stubRoutines.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_ALL_GCS
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"

View File

@ -25,7 +25,7 @@
* @test * @test
* @bug 8015396 * @bug 8015396
* @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X) * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X)
* * @ignore 8015396
* @run main ModNaN * @run main ModNaN
*/ */
public class ModNaN { public class ModNaN {

View File

@ -304,3 +304,4 @@ d5b5a010a16688f188f5a9247ed873f5100b530c jdk9-b53
a1a9d943446911a4a0f74f0d082c32094af944ae jdk9-b59 a1a9d943446911a4a0f74f0d082c32094af944ae jdk9-b59
c12db18748dacfccd6581ead29228c2cb6e51b34 jdk9-b60 c12db18748dacfccd6581ead29228c2cb6e51b34 jdk9-b60
f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61 f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61
3bcf83c1bbc1b7663e930d72c133a9bd86c7618d jdk9-b62

View File

@ -304,3 +304,4 @@ c76339e86ea7da5d9ac7856f3fae9ef73eef04a2 jdk9-b57
48ee960f29df93a9b2a895621321358a86909086 jdk9-b59 48ee960f29df93a9b2a895621321358a86909086 jdk9-b59
84c5527f742bc64562e47d3149c16197fe1c4c1a jdk9-b60 84c5527f742bc64562e47d3149c16197fe1c4c1a jdk9-b60
da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61 da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62

View File

@ -711,7 +711,7 @@ public final class JceKeyStore extends KeyStoreSpi {
cf = CertificateFactory.getInstance("X509"); cf = CertificateFactory.getInstance("X509");
} else { } else {
// version 2 // version 2
cfs = new Hashtable<String, CertificateFactory>(3); cfs = new Hashtable<>(3);
} }
entries.clear(); entries.clear();

View File

@ -56,7 +56,7 @@ abstract class PBEKeyFactory extends SecretKeyFactorySpi {
} }
static { static {
validTypes = new HashSet<String>(17); validTypes = new HashSet<>(17);
validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH)); validTypes.add("PBEWithMD5AndDES".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH)); validTypes.add("PBEWithSHA1AndDESede".toUpperCase(Locale.ENGLISH));
validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH)); validTypes.add("PBEWithSHA1AndRC2_40".toUpperCase(Locale.ENGLISH));

View File

@ -115,7 +115,7 @@ public final class SunJCE extends Provider {
final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING"; final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING";
AccessController.doPrivileged( AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() { new java.security.PrivilegedAction<>() {
public Object run() { public Object run() {
/* /*

View File

@ -63,7 +63,7 @@ public class KeyManagerFactory {
*/ */
public final static String getDefaultAlgorithm() { public final static String getDefaultAlgorithm() {
String type; String type;
type = AccessController.doPrivileged(new PrivilegedAction<String>() { type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty("sun.ssl.keymanager.type"); return Security.getProperty("sun.ssl.keymanager.type");
} }

View File

@ -63,7 +63,7 @@ public class TrustManagerFactory {
*/ */
public final static String getDefaultAlgorithm() { public final static String getDefaultAlgorithm() {
String type; String type;
type = AccessController.doPrivileged(new PrivilegedAction<String>() { type = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty("sun.ssl.trustmanager.type"); return Security.getProperty("sun.ssl.trustmanager.type");
} }

View File

@ -32,9 +32,9 @@ import sun.reflect.Reflection;
/** /**
* Every Java application has a single instance of class * Every Java application has a single instance of class
* <code>Runtime</code> that allows the application to interface with * {@code Runtime} that allows the application to interface with
* the environment in which the application is running. The current * the environment in which the application is running. The current
* runtime can be obtained from the <code>getRuntime</code> method. * runtime can be obtained from the {@code getRuntime} method.
* <p> * <p>
* An application cannot create its own instance of this class. * An application cannot create its own instance of this class.
* *
@ -48,10 +48,10 @@ public class Runtime {
/** /**
* Returns the runtime object associated with the current Java application. * Returns the runtime object associated with the current Java application.
* Most of the methods of class <code>Runtime</code> are instance * Most of the methods of class {@code Runtime} are instance
* methods and must be invoked with respect to the current runtime object. * methods and must be invoked with respect to the current runtime object.
* *
* @return the <code>Runtime</code> object associated with the current * @return the {@code Runtime} object associated with the current
* Java application. * Java application.
*/ */
public static Runtime getRuntime() { public static Runtime getRuntime() {
@ -72,8 +72,7 @@ public class Runtime {
* if any, are started in some unspecified order and allowed to run * if any, are started in some unspecified order and allowed to run
* concurrently until they finish. In the second phase all uninvoked * concurrently until they finish. In the second phase all uninvoked
* finalizers are run if {@link #runFinalizersOnExit finalization-on-exit} * finalizers are run if {@link #runFinalizersOnExit finalization-on-exit}
* has been enabled. Once this is done the virtual machine {@link #halt * has been enabled. Once this is done the virtual machine {@link #halt halts}.
* halts}.
* *
* <p> If this method is invoked after the virtual machine has begun its * <p> If this method is invoked after the virtual machine has begun its
* shutdown sequence then if shutdown hooks are being run this method will * shutdown sequence then if shutdown hooks are being run this method will
@ -82,7 +81,7 @@ public class Runtime {
* with the given status code if the status is nonzero; otherwise, it * with the given status code if the status is nonzero; otherwise, it
* blocks indefinitely. * blocks indefinitely.
* *
* <p> The <tt>{@link System#exit(int) System.exit}</tt> method is the * <p> The {@link System#exit(int) System.exit} method is the
* conventional and convenient means of invoking this method. * conventional and convenient means of invoking this method.
* *
* @param status * @param status
@ -90,8 +89,8 @@ public class Runtime {
* indicates abnormal termination. * indicates abnormal termination.
* *
* @throws SecurityException * @throws SecurityException
* If a security manager is present and its <tt>{@link * If a security manager is present and its
* SecurityManager#checkExit checkExit}</tt> method does not permit * {@link SecurityManager#checkExit checkExit} method does not permit
* exiting with the specified status * exiting with the specified status
* *
* @see java.lang.SecurityException * @see java.lang.SecurityException
@ -118,11 +117,11 @@ public class Runtime {
* <ul> * <ul>
* *
* <li> The program <i>exits</i> normally, when the last non-daemon * <li> The program <i>exits</i> normally, when the last non-daemon
* thread exits or when the <tt>{@link #exit exit}</tt> (equivalently, * thread exits or when the {@link #exit exit} (equivalently,
* {@link System#exit(int) System.exit}) method is invoked, or * {@link System#exit(int) System.exit}) method is invoked, or
* *
* <li> The virtual machine is <i>terminated</i> in response to a * <li> The virtual machine is <i>terminated</i> in response to a
* user interrupt, such as typing <tt>^C</tt>, or a system-wide event, * user interrupt, such as typing {@code ^C}, or a system-wide event,
* such as user logoff or system shutdown. * such as user logoff or system shutdown.
* *
* </ul> * </ul>
@ -134,17 +133,16 @@ public class Runtime {
* run all uninvoked finalizers if finalization-on-exit has been enabled. * run all uninvoked finalizers if finalization-on-exit has been enabled.
* Finally, the virtual machine will halt. Note that daemon threads will * Finally, the virtual machine will halt. Note that daemon threads will
* continue to run during the shutdown sequence, as will non-daemon threads * continue to run during the shutdown sequence, as will non-daemon threads
* if shutdown was initiated by invoking the <tt>{@link #exit exit}</tt> * if shutdown was initiated by invoking the {@link #exit exit} method.
* method.
* *
* <p> Once the shutdown sequence has begun it can be stopped only by * <p> Once the shutdown sequence has begun it can be stopped only by
* invoking the <tt>{@link #halt halt}</tt> method, which forcibly * invoking the {@link #halt halt} method, which forcibly
* terminates the virtual machine. * terminates the virtual machine.
* *
* <p> Once the shutdown sequence has begun it is impossible to register a * <p> Once the shutdown sequence has begun it is impossible to register a
* new shutdown hook or de-register a previously-registered hook. * new shutdown hook or de-register a previously-registered hook.
* Attempting either of these operations will cause an * Attempting either of these operations will cause an
* <tt>{@link IllegalStateException}</tt> to be thrown. * {@link IllegalStateException} to be thrown.
* *
* <p> Shutdown hooks run at a delicate time in the life cycle of a virtual * <p> Shutdown hooks run at a delicate time in the life cycle of a virtual
* machine and should therefore be coded defensively. They should, in * machine and should therefore be coded defensively. They should, in
@ -156,7 +154,7 @@ public class Runtime {
* deadlocks. * deadlocks.
* *
* <p> Shutdown hooks should also finish their work quickly. When a * <p> Shutdown hooks should also finish their work quickly. When a
* program invokes <tt>{@link #exit exit}</tt> the expectation is * program invokes {@link #exit exit} the expectation is
* that the virtual machine will promptly shut down and exit. When the * that the virtual machine will promptly shut down and exit. When the
* virtual machine is terminated due to user logoff or system shutdown the * virtual machine is terminated due to user logoff or system shutdown the
* underlying operating system may only allow a fixed amount of time in * underlying operating system may only allow a fixed amount of time in
@ -165,17 +163,17 @@ public class Runtime {
* hook. * hook.
* *
* <p> Uncaught exceptions are handled in shutdown hooks just as in any * <p> Uncaught exceptions are handled in shutdown hooks just as in any
* other thread, by invoking the <tt>{@link ThreadGroup#uncaughtException * other thread, by invoking the
* uncaughtException}</tt> method of the thread's <tt>{@link * {@link ThreadGroup#uncaughtException uncaughtException} method of the
* ThreadGroup}</tt> object. The default implementation of this method * thread's {@link ThreadGroup} object. The default implementation of this
* prints the exception's stack trace to <tt>{@link System#err}</tt> and * method prints the exception's stack trace to {@link System#err} and
* terminates the thread; it does not cause the virtual machine to exit or * terminates the thread; it does not cause the virtual machine to exit or
* halt. * halt.
* *
* <p> In rare circumstances the virtual machine may <i>abort</i>, that is, * <p> In rare circumstances the virtual machine may <i>abort</i>, that is,
* stop running without shutting down cleanly. This occurs when the * stop running without shutting down cleanly. This occurs when the
* virtual machine is terminated externally, for example with the * virtual machine is terminated externally, for example with the
* <tt>SIGKILL</tt> signal on Unix or the <tt>TerminateProcess</tt> call on * {@code SIGKILL} signal on Unix or the {@code TerminateProcess} call on
* Microsoft Windows. The virtual machine may also abort if a native * Microsoft Windows. The virtual machine may also abort if a native
* method goes awry by, for example, corrupting internal data structures or * method goes awry by, for example, corrupting internal data structures or
* attempting to access nonexistent memory. If the virtual machine aborts * attempting to access nonexistent memory. If the virtual machine aborts
@ -183,7 +181,7 @@ public class Runtime {
* will be run. * will be run.
* *
* @param hook * @param hook
* An initialized but unstarted <tt>{@link Thread}</tt> object * An initialized but unstarted {@link Thread} object
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If the specified hook has already been registered, * If the specified hook has already been registered,
@ -196,7 +194,7 @@ public class Runtime {
* *
* @throws SecurityException * @throws SecurityException
* If a security manager is present and it denies * If a security manager is present and it denies
* <tt>{@link RuntimePermission}("shutdownHooks")</tt> * {@link RuntimePermission}("shutdownHooks")
* *
* @see #removeShutdownHook * @see #removeShutdownHook
* @see #halt(int) * @see #halt(int)
@ -212,11 +210,11 @@ public class Runtime {
} }
/** /**
* De-registers a previously-registered virtual-machine shutdown hook. <p> * De-registers a previously-registered virtual-machine shutdown hook.
* *
* @param hook the hook to remove * @param hook the hook to remove
* @return <tt>true</tt> if the specified hook had previously been * @return {@code true} if the specified hook had previously been
* registered and was successfully de-registered, <tt>false</tt> * registered and was successfully de-registered, {@code false}
* otherwise. * otherwise.
* *
* @throws IllegalStateException * @throws IllegalStateException
@ -225,7 +223,7 @@ public class Runtime {
* *
* @throws SecurityException * @throws SecurityException
* If a security manager is present and it denies * If a security manager is present and it denies
* <tt>{@link RuntimePermission}("shutdownHooks")</tt> * {@link RuntimePermission}("shutdownHooks")
* *
* @see #addShutdownHook * @see #addShutdownHook
* @see #exit(int) * @see #exit(int)
@ -244,23 +242,23 @@ public class Runtime {
* method never returns normally. * method never returns normally.
* *
* <p> This method should be used with extreme caution. Unlike the * <p> This method should be used with extreme caution. Unlike the
* <tt>{@link #exit exit}</tt> method, this method does not cause shutdown * {@link #exit exit} method, this method does not cause shutdown
* hooks to be started and does not run uninvoked finalizers if * hooks to be started and does not run uninvoked finalizers if
* finalization-on-exit has been enabled. If the shutdown sequence has * finalization-on-exit has been enabled. If the shutdown sequence has
* already been initiated then this method does not wait for any running * already been initiated then this method does not wait for any running
* shutdown hooks or finalizers to finish their work. * shutdown hooks or finalizers to finish their work.
* *
* @param status * @param status
* Termination status. By convention, a nonzero status code * Termination status. By convention, a nonzero status code
* indicates abnormal termination. If the <tt>{@link Runtime#exit * indicates abnormal termination. If the {@link Runtime#exit exit}
* exit}</tt> (equivalently, <tt>{@link System#exit(int) * (equivalently, {@link System#exit(int) System.exit}) method
* System.exit}</tt>) method has already been invoked then this * has already been invoked then this status code
* status code will override the status code passed to that method. * will override the status code passed to that method.
* *
* @throws SecurityException * @throws SecurityException
* If a security manager is present and its <tt>{@link * If a security manager is present and its
* SecurityManager#checkExit checkExit}</tt> method does not permit * {@link SecurityManager#checkExit checkExit} method
* an exit with the specified status * does not permit an exit with the specified status
* *
* @see #exit * @see #exit
* @see #addShutdownHook * @see #addShutdownHook
@ -282,7 +280,7 @@ public class Runtime {
* By default, finalization on exit is disabled. * By default, finalization on exit is disabled.
* *
* <p>If there is a security manager, * <p>If there is a security manager,
* its <code>checkExit</code> method is first called * its {@code checkExit} method is first called
* with 0 as its argument to ensure the exit is allowed. * with 0 as its argument to ensure the exit is allowed.
* This could result in a SecurityException. * This could result in a SecurityException.
* *
@ -293,7 +291,7 @@ public class Runtime {
* behavior or deadlock. * behavior or deadlock.
* *
* @throws SecurityException * @throws SecurityException
* if a security manager exists and its <code>checkExit</code> * if a security manager exists and its {@code checkExit}
* method doesn't allow the exit. * method doesn't allow the exit.
* *
* @see java.lang.Runtime#exit(int) * @see java.lang.Runtime#exit(int)
@ -318,9 +316,9 @@ public class Runtime {
* Executes the specified string command in a separate process. * Executes the specified string command in a separate process.
* *
* <p>This is a convenience method. An invocation of the form * <p>This is a convenience method. An invocation of the form
* <tt>exec(command)</tt> * {@code exec(command)}
* behaves in exactly the same way as the invocation * behaves in exactly the same way as the invocation
* <tt>{@link #exec(String, String[], File) exec}(command, null, null)</tt>. * {@link #exec(String, String[], File) exec}{@code (command, null, null)}.
* *
* @param command a specified system command. * @param command a specified system command.
* *
@ -335,10 +333,10 @@ public class Runtime {
* If an I/O error occurs * If an I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>command</code> is <code>null</code> * If {@code command} is {@code null}
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If <code>command</code> is empty * If {@code command} is empty
* *
* @see #exec(String[], String[], File) * @see #exec(String[], String[], File)
* @see ProcessBuilder * @see ProcessBuilder
@ -352,16 +350,16 @@ public class Runtime {
* specified environment. * specified environment.
* *
* <p>This is a convenience method. An invocation of the form * <p>This is a convenience method. An invocation of the form
* <tt>exec(command, envp)</tt> * {@code exec(command, envp)}
* behaves in exactly the same way as the invocation * behaves in exactly the same way as the invocation
* <tt>{@link #exec(String, String[], File) exec}(command, envp, null)</tt>. * {@link #exec(String, String[], File) exec}{@code (command, envp, null)}.
* *
* @param command a specified system command. * @param command a specified system command.
* *
* @param envp array of strings, each element of which * @param envp array of strings, each element of which
* has environment variable settings in the format * has environment variable settings in the format
* <i>name</i>=<i>value</i>, or * <i>name</i>=<i>value</i>, or
* <tt>null</tt> if the subprocess should inherit * {@code null} if the subprocess should inherit
* the environment of the current process. * the environment of the current process.
* *
* @return A new {@link Process} object for managing the subprocess * @return A new {@link Process} object for managing the subprocess
@ -375,11 +373,11 @@ public class Runtime {
* If an I/O error occurs * If an I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>command</code> is <code>null</code>, * If {@code command} is {@code null},
* or one of the elements of <code>envp</code> is <code>null</code> * or one of the elements of {@code envp} is {@code null}
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If <code>command</code> is empty * If {@code command} is empty
* *
* @see #exec(String[], String[], File) * @see #exec(String[], String[], File)
* @see ProcessBuilder * @see ProcessBuilder
@ -393,29 +391,29 @@ public class Runtime {
* specified environment and working directory. * specified environment and working directory.
* *
* <p>This is a convenience method. An invocation of the form * <p>This is a convenience method. An invocation of the form
* <tt>exec(command, envp, dir)</tt> * {@code exec(command, envp, dir)}
* behaves in exactly the same way as the invocation * behaves in exactly the same way as the invocation
* <tt>{@link #exec(String[], String[], File) exec}(cmdarray, envp, dir)</tt>, * {@link #exec(String[], String[], File) exec}{@code (cmdarray, envp, dir)},
* where <code>cmdarray</code> is an array of all the tokens in * where {@code cmdarray} is an array of all the tokens in
* <code>command</code>. * {@code command}.
* *
* <p>More precisely, the <code>command</code> string is broken * <p>More precisely, the {@code command} string is broken
* into tokens using a {@link StringTokenizer} created by the call * into tokens using a {@link StringTokenizer} created by the call
* <code>new {@link StringTokenizer}(command)</code> with no * {@code new {@link StringTokenizer}(command)} with no
* further modification of the character categories. The tokens * further modification of the character categories. The tokens
* produced by the tokenizer are then placed in the new string * produced by the tokenizer are then placed in the new string
* array <code>cmdarray</code>, in the same order. * array {@code cmdarray}, in the same order.
* *
* @param command a specified system command. * @param command a specified system command.
* *
* @param envp array of strings, each element of which * @param envp array of strings, each element of which
* has environment variable settings in the format * has environment variable settings in the format
* <i>name</i>=<i>value</i>, or * <i>name</i>=<i>value</i>, or
* <tt>null</tt> if the subprocess should inherit * {@code null} if the subprocess should inherit
* the environment of the current process. * the environment of the current process.
* *
* @param dir the working directory of the subprocess, or * @param dir the working directory of the subprocess, or
* <tt>null</tt> if the subprocess should inherit * {@code null} if the subprocess should inherit
* the working directory of the current process. * the working directory of the current process.
* *
* @return A new {@link Process} object for managing the subprocess * @return A new {@link Process} object for managing the subprocess
@ -429,11 +427,11 @@ public class Runtime {
* If an I/O error occurs * If an I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>command</code> is <code>null</code>, * If {@code command} is {@code null},
* or one of the elements of <code>envp</code> is <code>null</code> * or one of the elements of {@code envp} is {@code null}
* *
* @throws IllegalArgumentException * @throws IllegalArgumentException
* If <code>command</code> is empty * If {@code command} is empty
* *
* @see ProcessBuilder * @see ProcessBuilder
* @since 1.3 * @since 1.3
@ -454,9 +452,9 @@ public class Runtime {
* Executes the specified command and arguments in a separate process. * Executes the specified command and arguments in a separate process.
* *
* <p>This is a convenience method. An invocation of the form * <p>This is a convenience method. An invocation of the form
* <tt>exec(cmdarray)</tt> * {@code exec(cmdarray)}
* behaves in exactly the same way as the invocation * behaves in exactly the same way as the invocation
* <tt>{@link #exec(String[], String[], File) exec}(cmdarray, null, null)</tt>. * {@link #exec(String[], String[], File) exec}{@code (cmdarray, null, null)}.
* *
* @param cmdarray array containing the command to call and * @param cmdarray array containing the command to call and
* its arguments. * its arguments.
@ -472,12 +470,12 @@ public class Runtime {
* If an I/O error occurs * If an I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>cmdarray</code> is <code>null</code>, * If {@code cmdarray} is {@code null},
* or one of the elements of <code>cmdarray</code> is <code>null</code> * or one of the elements of {@code cmdarray} is {@code null}
* *
* @throws IndexOutOfBoundsException * @throws IndexOutOfBoundsException
* If <code>cmdarray</code> is an empty array * If {@code cmdarray} is an empty array
* (has length <code>0</code>) * (has length {@code 0})
* *
* @see ProcessBuilder * @see ProcessBuilder
*/ */
@ -490,9 +488,9 @@ public class Runtime {
* with the specified environment. * with the specified environment.
* *
* <p>This is a convenience method. An invocation of the form * <p>This is a convenience method. An invocation of the form
* <tt>exec(cmdarray, envp)</tt> * {@code exec(cmdarray, envp)}
* behaves in exactly the same way as the invocation * behaves in exactly the same way as the invocation
* <tt>{@link #exec(String[], String[], File) exec}(cmdarray, envp, null)</tt>. * {@link #exec(String[], String[], File) exec}{@code (cmdarray, envp, null)}.
* *
* @param cmdarray array containing the command to call and * @param cmdarray array containing the command to call and
* its arguments. * its arguments.
@ -500,7 +498,7 @@ public class Runtime {
* @param envp array of strings, each element of which * @param envp array of strings, each element of which
* has environment variable settings in the format * has environment variable settings in the format
* <i>name</i>=<i>value</i>, or * <i>name</i>=<i>value</i>, or
* <tt>null</tt> if the subprocess should inherit * {@code null} if the subprocess should inherit
* the environment of the current process. * the environment of the current process.
* *
* @return A new {@link Process} object for managing the subprocess * @return A new {@link Process} object for managing the subprocess
@ -514,13 +512,13 @@ public class Runtime {
* If an I/O error occurs * If an I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>cmdarray</code> is <code>null</code>, * If {@code cmdarray} is {@code null},
* or one of the elements of <code>cmdarray</code> is <code>null</code>, * or one of the elements of {@code cmdarray} is {@code null},
* or one of the elements of <code>envp</code> is <code>null</code> * or one of the elements of {@code envp} is {@code null}
* *
* @throws IndexOutOfBoundsException * @throws IndexOutOfBoundsException
* If <code>cmdarray</code> is an empty array * If {@code cmdarray} is an empty array
* (has length <code>0</code>) * (has length {@code 0})
* *
* @see ProcessBuilder * @see ProcessBuilder
*/ */
@ -533,17 +531,17 @@ public class Runtime {
* Executes the specified command and arguments in a separate process with * Executes the specified command and arguments in a separate process with
* the specified environment and working directory. * the specified environment and working directory.
* *
* <p>Given an array of strings <code>cmdarray</code>, representing the * <p>Given an array of strings {@code cmdarray}, representing the
* tokens of a command line, and an array of strings <code>envp</code>, * tokens of a command line, and an array of strings {@code envp},
* representing "environment" variable settings, this method creates * representing "environment" variable settings, this method creates
* a new process in which to execute the specified command. * a new process in which to execute the specified command.
* *
* <p>This method checks that <code>cmdarray</code> is a valid operating * <p>This method checks that {@code cmdarray} is a valid operating
* system command. Which commands are valid is system-dependent, * system command. Which commands are valid is system-dependent,
* but at the very least the command must be a non-empty list of * but at the very least the command must be a non-empty list of
* non-null strings. * non-null strings.
* *
* <p>If <tt>envp</tt> is <tt>null</tt>, the subprocess inherits the * <p>If {@code envp} is {@code null}, the subprocess inherits the
* environment settings of the current process. * environment settings of the current process.
* *
* <p>A minimal set of system dependent environment variables may * <p>A minimal set of system dependent environment variables may
@ -554,14 +552,14 @@ public class Runtime {
* <p>{@link ProcessBuilder#start()} is now the preferred way to * <p>{@link ProcessBuilder#start()} is now the preferred way to
* start a process with a modified environment. * start a process with a modified environment.
* *
* <p>The working directory of the new subprocess is specified by <tt>dir</tt>. * <p>The working directory of the new subprocess is specified by {@code dir}.
* If <tt>dir</tt> is <tt>null</tt>, the subprocess inherits the * If {@code dir} is {@code null}, the subprocess inherits the
* current working directory of the current process. * current working directory of the current process.
* *
* <p>If a security manager exists, its * <p>If a security manager exists, its
* {@link SecurityManager#checkExec checkExec} * {@link SecurityManager#checkExec checkExec}
* method is invoked with the first component of the array * method is invoked with the first component of the array
* <code>cmdarray</code> as its argument. This may result in a * {@code cmdarray} as its argument. This may result in a
* {@link SecurityException} being thrown. * {@link SecurityException} being thrown.
* *
* <p>Starting an operating system process is highly system-dependent. * <p>Starting an operating system process is highly system-dependent.
@ -586,11 +584,11 @@ public class Runtime {
* @param envp array of strings, each element of which * @param envp array of strings, each element of which
* has environment variable settings in the format * has environment variable settings in the format
* <i>name</i>=<i>value</i>, or * <i>name</i>=<i>value</i>, or
* <tt>null</tt> if the subprocess should inherit * {@code null} if the subprocess should inherit
* the environment of the current process. * the environment of the current process.
* *
* @param dir the working directory of the subprocess, or * @param dir the working directory of the subprocess, or
* <tt>null</tt> if the subprocess should inherit * {@code null} if the subprocess should inherit
* the working directory of the current process. * the working directory of the current process.
* *
* @return A new {@link Process} object for managing the subprocess * @return A new {@link Process} object for managing the subprocess
@ -607,13 +605,13 @@ public class Runtime {
* If an I/O error occurs * If an I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>cmdarray</code> is <code>null</code>, * If {@code cmdarray} is {@code null},
* or one of the elements of <code>cmdarray</code> is <code>null</code>, * or one of the elements of {@code cmdarray} is {@code null},
* or one of the elements of <code>envp</code> is <code>null</code> * or one of the elements of {@code envp} is {@code null}
* *
* @throws IndexOutOfBoundsException * @throws IndexOutOfBoundsException
* If <code>cmdarray</code> is an empty array * If {@code cmdarray} is an empty array
* (has length <code>0</code>) * (has length {@code 0})
* *
* @see ProcessBuilder * @see ProcessBuilder
* @since 1.3 * @since 1.3
@ -643,8 +641,8 @@ public class Runtime {
/** /**
* Returns the amount of free memory in the Java Virtual Machine. * Returns the amount of free memory in the Java Virtual Machine.
* Calling the * Calling the
* <code>gc</code> method may result in increasing the value returned * {@code gc} method may result in increasing the value returned
* by <code>freeMemory.</code> * by {@code freeMemory.}
* *
* @return an approximation to the total amount of memory currently * @return an approximation to the total amount of memory currently
* available for future allocated objects, measured in bytes. * available for future allocated objects, measured in bytes.
@ -665,9 +663,9 @@ public class Runtime {
public native long totalMemory(); public native long totalMemory();
/** /**
* Returns the maximum amount of memory that the Java virtual machine will * Returns the maximum amount of memory that the Java virtual machine
* attempt to use. If there is no inherent limit then the value {@link * will attempt to use. If there is no inherent limit then the value
* java.lang.Long#MAX_VALUE} will be returned. * {@link java.lang.Long#MAX_VALUE} will be returned.
* *
* @return the maximum amount of memory that the virtual machine will * @return the maximum amount of memory that the virtual machine will
* attempt to use, measured in bytes * attempt to use, measured in bytes
@ -683,10 +681,10 @@ public class Runtime {
* returns from the method call, the virtual machine has made * returns from the method call, the virtual machine has made
* its best effort to recycle all discarded objects. * its best effort to recycle all discarded objects.
* <p> * <p>
* The name <code>gc</code> stands for "garbage * The name {@code gc} stands for "garbage
* collector". The virtual machine performs this recycling * collector". The virtual machine performs this recycling
* process automatically as needed, in a separate thread, even if the * process automatically as needed, in a separate thread, even if the
* <code>gc</code> method is not invoked explicitly. * {@code gc} method is not invoked explicitly.
* <p> * <p>
* The method {@link System#gc()} is the conventional and convenient * The method {@link System#gc()} is the conventional and convenient
* means of invoking this method. * means of invoking this method.
@ -699,15 +697,15 @@ public class Runtime {
/** /**
* Runs the finalization methods of any objects pending finalization. * Runs the finalization methods of any objects pending finalization.
* Calling this method suggests that the Java virtual machine expend * Calling this method suggests that the Java virtual machine expend
* effort toward running the <code>finalize</code> methods of objects * effort toward running the {@code finalize} methods of objects
* that have been found to be discarded but whose <code>finalize</code> * that have been found to be discarded but whose {@code finalize}
* methods have not yet been run. When control returns from the * methods have not yet been run. When control returns from the
* method call, the virtual machine has made a best effort to * method call, the virtual machine has made a best effort to
* complete all outstanding finalizations. * complete all outstanding finalizations.
* <p> * <p>
* The virtual machine performs the finalization process * The virtual machine performs the finalization process
* automatically as needed, in a separate thread, if the * automatically as needed, in a separate thread, if the
* <code>runFinalization</code> method is not invoked explicitly. * {@code runFinalization} method is not invoked explicitly.
* <p> * <p>
* The method {@link System#runFinalization()} is the conventional * The method {@link System#runFinalization()} is the conventional
* and convenient means of invoking this method. * and convenient means of invoking this method.
@ -720,7 +718,7 @@ public class Runtime {
/** /**
* Enables/Disables tracing of instructions. * Enables/Disables tracing of instructions.
* If the <code>boolean</code> argument is <code>true</code>, this * If the {@code boolean} argument is {@code true}, this
* method suggests that the Java virtual machine emit debugging * method suggests that the Java virtual machine emit debugging
* information for each instruction in the virtual machine as it * information for each instruction in the virtual machine as it
* is executed. The format of this information, and the file or other * is executed. The format of this information, and the file or other
@ -729,18 +727,18 @@ public class Runtime {
* this feature. The destination of the trace output is system * this feature. The destination of the trace output is system
* dependent. * dependent.
* <p> * <p>
* If the <code>boolean</code> argument is <code>false</code>, this * If the {@code boolean} argument is {@code false}, this
* method causes the virtual machine to stop performing the * method causes the virtual machine to stop performing the
* detailed instruction trace it is performing. * detailed instruction trace it is performing.
* *
* @param on <code>true</code> to enable instruction tracing; * @param on {@code true} to enable instruction tracing;
* <code>false</code> to disable this feature. * {@code false} to disable this feature.
*/ */
public void traceInstructions(boolean on) { } public void traceInstructions(boolean on) { }
/** /**
* Enables/Disables tracing of method calls. * Enables/Disables tracing of method calls.
* If the <code>boolean</code> argument is <code>true</code>, this * If the {@code boolean} argument is {@code true}, this
* method suggests that the Java virtual machine emit debugging * method suggests that the Java virtual machine emit debugging
* information for each method in the virtual machine as it is * information for each method in the virtual machine as it is
* called. The format of this information, and the file or other output * called. The format of this information, and the file or other output
@ -751,8 +749,8 @@ public class Runtime {
* Calling this method with argument false suggests that the * Calling this method with argument false suggests that the
* virtual machine cease emitting per-call debugging information. * virtual machine cease emitting per-call debugging information.
* *
* @param on <code>true</code> to enable instruction tracing; * @param on {@code true} to enable instruction tracing;
* <code>false</code> to disable this feature. * {@code false} to disable this feature.
*/ */
public void traceMethodCalls(boolean on) { } public void traceMethodCalls(boolean on) { }
@ -760,7 +758,7 @@ public class Runtime {
* Loads the native library specified by the filename argument. The filename * Loads the native library specified by the filename argument. The filename
* argument must be an absolute path name. * argument must be an absolute path name.
* (for example * (for example
* <code>Runtime.getRuntime().load("/home/avh/lib/libX11.so");</code>). * {@code Runtime.getRuntime().load("/home/avh/lib/libX11.so");}).
* *
* If the filename argument, when stripped of any platform-specific library * If the filename argument, when stripped of any platform-specific library
* prefix, path, and file extension, indicates a library whose name is, * prefix, path, and file extension, indicates a library whose name is,
@ -773,8 +771,8 @@ public class Runtime {
* Otherwise, the filename argument is mapped to a native library image in * Otherwise, the filename argument is mapped to a native library image in
* an implementation-dependent manner. * an implementation-dependent manner.
* <p> * <p>
* First, if there is a security manager, its <code>checkLink</code> * First, if there is a security manager, its {@code checkLink}
* method is called with the <code>filename</code> as its argument. * method is called with the {@code filename} as its argument.
* This may result in a security exception. * This may result in a security exception.
* <p> * <p>
* This is similar to the method {@link #loadLibrary(String)}, but it * This is similar to the method {@link #loadLibrary(String)}, but it
@ -786,14 +784,14 @@ public class Runtime {
* *
* @param filename the file to load. * @param filename the file to load.
* @exception SecurityException if a security manager exists and its * @exception SecurityException if a security manager exists and its
* <code>checkLink</code> method doesn't allow * {@code checkLink} method doesn't allow
* loading of the specified dynamic library * loading of the specified dynamic library
* @exception UnsatisfiedLinkError if either the filename is not an * @exception UnsatisfiedLinkError if either the filename is not an
* absolute path name, the native library is not statically * absolute path name, the native library is not statically
* linked with the VM, or the library cannot be mapped to * linked with the VM, or the library cannot be mapped to
* a native library image by the host system. * a native library image by the host system.
* @exception NullPointerException if <code>filename</code> is * @exception NullPointerException if {@code filename} is
* <code>null</code> * {@code null}
* @see java.lang.Runtime#getRuntime() * @see java.lang.Runtime#getRuntime()
* @see java.lang.SecurityException * @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkLink(java.lang.String) * @see java.lang.SecurityManager#checkLink(java.lang.String)
@ -816,26 +814,26 @@ public class Runtime {
} }
/** /**
* Loads the native library specified by the <code>libname</code> * Loads the native library specified by the {@code libname}
* argument. The <code>libname</code> argument must not contain any platform * argument. The {@code libname} argument must not contain any platform
* specific prefix, file extension or path. If a native library * specific prefix, file extension or path. If a native library
* called <code>libname</code> is statically linked with the VM, then the * called {@code libname} is statically linked with the VM, then the
* JNI_OnLoad_<code>libname</code> function exported by the library is invoked. * JNI_OnLoad_{@code libname} function exported by the library is invoked.
* See the JNI Specification for more details. * See the JNI Specification for more details.
* *
* Otherwise, the libname argument is loaded from a system library * Otherwise, the libname argument is loaded from a system library
* location and mapped to a native library image in an implementation- * location and mapped to a native library image in an implementation-
* dependent manner. * dependent manner.
* <p> * <p>
* First, if there is a security manager, its <code>checkLink</code> * First, if there is a security manager, its {@code checkLink}
* method is called with the <code>libname</code> as its argument. * method is called with the {@code libname} as its argument.
* This may result in a security exception. * This may result in a security exception.
* <p> * <p>
* The method {@link System#loadLibrary(String)} is the conventional * The method {@link System#loadLibrary(String)} is the conventional
* and convenient means of invoking this method. If native * and convenient means of invoking this method. If native
* methods are to be used in the implementation of a class, a standard * methods are to be used in the implementation of a class, a standard
* strategy is to put the native code in a library file (call it * strategy is to put the native code in a library file (call it
* <code>LibFile</code>) and then to put a static initializer: * {@code LibFile}) and then to put a static initializer:
* <blockquote><pre> * <blockquote><pre>
* static { System.loadLibrary("LibFile"); } * static { System.loadLibrary("LibFile"); }
* </pre></blockquote> * </pre></blockquote>
@ -848,14 +846,14 @@ public class Runtime {
* *
* @param libname the name of the library. * @param libname the name of the library.
* @exception SecurityException if a security manager exists and its * @exception SecurityException if a security manager exists and its
* <code>checkLink</code> method doesn't allow * {@code checkLink} method doesn't allow
* loading of the specified dynamic library * loading of the specified dynamic library
* @exception UnsatisfiedLinkError if either the libname argument * @exception UnsatisfiedLinkError if either the libname argument
* contains a file path, the native library is not statically * contains a file path, the native library is not statically
* linked with the VM, or the library cannot be mapped to a * linked with the VM, or the library cannot be mapped to a
* native library image by the host system. * native library image by the host system.
* @exception NullPointerException if <code>libname</code> is * @exception NullPointerException if {@code libname} is
* <code>null</code> * {@code null}
* @see java.lang.SecurityException * @see java.lang.SecurityException
* @see java.lang.SecurityManager#checkLink(java.lang.String) * @see java.lang.SecurityManager#checkLink(java.lang.String)
*/ */
@ -878,7 +876,7 @@ public class Runtime {
/** /**
* Creates a localized version of an input stream. This method takes * Creates a localized version of an input stream. This method takes
* an <code>InputStream</code> and returns an <code>InputStream</code> * an {@code InputStream} and returns an {@code InputStream}
* equivalent to the argument in all respects except that it is * equivalent to the argument in all respects except that it is
* localized: as characters in the local character set are read from * localized: as characters in the local character set are read from
* the stream, they are automatically converted from the local * the stream, they are automatically converted from the local
@ -894,7 +892,7 @@ public class Runtime {
* @see java.io.InputStreamReader#InputStreamReader(java.io.InputStream) * @see java.io.InputStreamReader#InputStreamReader(java.io.InputStream)
* @deprecated As of JDK&nbsp;1.1, the preferred way to translate a byte * @deprecated As of JDK&nbsp;1.1, the preferred way to translate a byte
* stream in the local encoding into a character stream in Unicode is via * stream in the local encoding into a character stream in Unicode is via
* the <code>InputStreamReader</code> and <code>BufferedReader</code> * the {@code InputStreamReader} and {@code BufferedReader}
* classes. * classes.
*/ */
@Deprecated @Deprecated
@ -904,8 +902,8 @@ public class Runtime {
/** /**
* Creates a localized version of an output stream. This method * Creates a localized version of an output stream. This method
* takes an <code>OutputStream</code> and returns an * takes an {@code OutputStream} and returns an
* <code>OutputStream</code> equivalent to the argument in all respects * {@code OutputStream} equivalent to the argument in all respects
* except that it is localized: as Unicode characters are written to * except that it is localized: as Unicode characters are written to
* the stream, they are automatically converted to the local * the stream, they are automatically converted to the local
* character set. * character set.
@ -915,8 +913,8 @@ public class Runtime {
* *
* @deprecated As of JDK&nbsp;1.1, the preferred way to translate a * @deprecated As of JDK&nbsp;1.1, the preferred way to translate a
* Unicode character stream into a byte stream in the local encoding is via * Unicode character stream into a byte stream in the local encoding is via
* the <code>OutputStreamWriter</code>, <code>BufferedWriter</code>, and * the {@code OutputStreamWriter}, {@code BufferedWriter}, and
* <code>PrintWriter</code> classes. * {@code PrintWriter} classes.
* *
* @param out OutputStream to localize * @param out OutputStream to localize
* @return a localized output stream * @return a localized output stream

View File

@ -631,7 +631,7 @@ class LambdaForm {
* as a sort of pre-invocation linkage step.) * as a sort of pre-invocation linkage step.)
*/ */
public void prepare() { public void prepare() {
if (COMPILE_THRESHOLD == 0) { if (COMPILE_THRESHOLD == 0 && !isCompiled) {
compileToBytecode(); compileToBytecode();
} }
if (this.vmentry != null) { if (this.vmentry != null) {
@ -645,11 +645,11 @@ class LambdaForm {
/** Generate optimizable bytecode for this form. */ /** Generate optimizable bytecode for this form. */
MemberName compileToBytecode() { MemberName compileToBytecode() {
MethodType invokerType = methodType();
assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
if (vmentry != null && isCompiled) { if (vmentry != null && isCompiled) {
return vmentry; // already compiled somehow return vmentry; // already compiled somehow
} }
MethodType invokerType = methodType();
assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
try { try {
vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType); vmentry = InvokerBytecodeGenerator.generateCustomizedCode(this, invokerType);
if (TRACE_INTERPRETER) if (TRACE_INTERPRETER)

View File

@ -45,7 +45,7 @@ public class AtomicMoveNotSupportedException
* @param target * @param target
* a string identifying the target file or {@code null} if not known * a string identifying the target file or {@code null} if not known
* @param reason * @param reason
* a reason message with additional information * a reason message with additional information or {@code null}
*/ */
public AtomicMoveNotSupportedException(String source, public AtomicMoveNotSupportedException(String source,
String target, String target,

View File

@ -458,7 +458,7 @@ public final class AccessControlContext {
Thread.dumpStack(); Thread.dumpStack();
final ProtectionDomain pd = context[i]; final ProtectionDomain pd = context[i];
final Debug db = debug; final Debug db = debug;
AccessController.doPrivileged (new PrivilegedAction<Void>() { AccessController.doPrivileged (new PrivilegedAction<>() {
public Void run() { public Void run() {
db.println("domain that failed "+pd); db.println("domain that failed "+pd);
return null; return null;

View File

@ -612,7 +612,7 @@ public final class AccessController {
private static ProtectionDomain getCallerPD(final Class <?> caller) { private static ProtectionDomain getCallerPD(final Class <?> caller) {
ProtectionDomain callerPd = doPrivileged ProtectionDomain callerPd = doPrivileged
(new PrivilegedAction<ProtectionDomain>() { (new PrivilegedAction<>() {
public ProtectionDomain run() { public ProtectionDomain run() {
return caller.getProtectionDomain(); return caller.getProtectionDomain();
} }

View File

@ -212,7 +212,7 @@ final class AllPermissionCollection
* @return an enumeration of all the AllPermission objects. * @return an enumeration of all the AllPermission objects.
*/ */
public Enumeration<Permission> elements() { public Enumeration<Permission> elements() {
return new Enumeration<Permission>() { return new Enumeration<>() {
private boolean hasMore = all_allowed; private boolean hasMore = all_allowed;
public boolean hasMoreElements() { public boolean hasMoreElements() {

View File

@ -332,7 +332,7 @@ final class BasicPermissionCollection
*/ */
public BasicPermissionCollection(Class<?> clazz) { public BasicPermissionCollection(Class<?> clazz) {
perms = new HashMap<String, Permission>(11); perms = new HashMap<>(11);
all_allowed = false; all_allowed = false;
permClass = clazz; permClass = clazz;
} }
@ -533,7 +533,7 @@ final class BasicPermissionCollection
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Hashtable<String, Permission> permissions = Hashtable<String, Permission> permissions =
(Hashtable<String, Permission>)gfields.get("permissions", null); (Hashtable<String, Permission>)gfields.get("permissions", null);
perms = new HashMap<String, Permission>(permissions.size()*2); perms = new HashMap<>(permissions.size()*2);
perms.putAll(permissions); perms.putAll(permissions);
// Get all_allowed // Get all_allowed

View File

@ -543,7 +543,7 @@ public class CodeSource implements java.io.Serializable {
if (size > 0) { if (size > 0) {
// we know of 3 different cert types: X.509, PGP, SDSI, which // we know of 3 different cert types: X.509, PGP, SDSI, which
// could all be present in the stream at the same time // could all be present in the stream at the same time
cfs = new Hashtable<String, CertificateFactory>(3); cfs = new Hashtable<>(3);
this.certs = new java.security.cert.Certificate[size]; this.certs = new java.security.cert.Certificate[size];
} }

View File

@ -185,7 +185,7 @@ public abstract class Identity implements Principal, Serializable {
check("setIdentityPublicKey"); check("setIdentityPublicKey");
this.publicKey = key; this.publicKey = key;
certificates = new Vector<Certificate>(); certificates = new Vector<>();
} }
/** /**
@ -248,7 +248,7 @@ public abstract class Identity implements Principal, Serializable {
check("addIdentityCertificate"); check("addIdentityCertificate");
if (certificates == null) { if (certificates == null) {
certificates = new Vector<Certificate>(); certificates = new Vector<>();
} }
if (publicKey != null) { if (publicKey != null) {
if (!keyEquals(publicKey, certificate.getPublicKey())) { if (!keyEquals(publicKey, certificate.getPublicKey())) {

View File

@ -74,7 +74,7 @@ class IdentityScope extends Identity {
private static void initializeSystemScope() { private static void initializeSystemScope() {
String classname = AccessController.doPrivileged( String classname = AccessController.doPrivileged(
new PrivilegedAction<String>() { new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty("system.scope"); return Security.getProperty("system.scope");
} }

View File

@ -976,7 +976,7 @@ public class KeyStore {
*/ */
public final static String getDefaultType() { public final static String getDefaultType() {
String kstype; String kstype;
kstype = AccessController.doPrivileged(new PrivilegedAction<String>() { kstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty(KEYSTORE_TYPE); return Security.getProperty(KEYSTORE_TYPE);
} }

View File

@ -99,7 +99,7 @@ implements Serializable
* Creates a new Permissions object containing no PermissionCollections. * Creates a new Permissions object containing no PermissionCollections.
*/ */
public Permissions() { public Permissions() {
permsMap = new HashMap<Class<?>, PermissionCollection>(11); permsMap = new HashMap<>(11);
allPermission = null; allPermission = null;
} }
@ -394,7 +394,7 @@ implements Serializable
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Hashtable<Class<?>, PermissionCollection> perms = Hashtable<Class<?>, PermissionCollection> perms =
(Hashtable<Class<?>, PermissionCollection>)gfields.get("perms", null); (Hashtable<Class<?>, PermissionCollection>)gfields.get("perms", null);
permsMap = new HashMap<Class<?>, PermissionCollection>(perms.size()*2); permsMap = new HashMap<>(perms.size()*2);
permsMap.putAll(perms); permsMap.putAll(perms);
// Set hasUnresolved // Set hasUnresolved
@ -488,7 +488,7 @@ implements Serializable
*/ */
PermissionsHash() { PermissionsHash() {
permsMap = new HashMap<Permission, Permission>(11); permsMap = new HashMap<>(11);
} }
/** /**
@ -597,7 +597,7 @@ implements Serializable
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Hashtable<Permission, Permission> perms = Hashtable<Permission, Permission> perms =
(Hashtable<Permission, Permission>)gfields.get("perms", null); (Hashtable<Permission, Permission>)gfields.get("perms", null);
permsMap = new HashMap<Permission, Permission>(perms.size()*2); permsMap = new HashMap<>(perms.size()*2);
permsMap.putAll(perms); permsMap.putAll(perms);
} }
} }

View File

@ -170,7 +170,7 @@ public abstract class Policy {
PolicyInfo pinfo = policy.get(); PolicyInfo pinfo = policy.get();
if (pinfo.policy == null) { if (pinfo.policy == null) {
String policy_class = AccessController.doPrivileged( String policy_class = AccessController.doPrivileged(
new PrivilegedAction<String>() { new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty("policy.provider"); return Security.getProperty("policy.provider");
} }
@ -199,7 +199,7 @@ public abstract class Policy {
final String pc = policy_class; final String pc = policy_class;
Policy pol = AccessController.doPrivileged( Policy pol = AccessController.doPrivileged(
new PrivilegedAction<Policy>() { new PrivilegedAction<>() {
public Policy run() { public Policy run() {
try { try {
ClassLoader cl = ClassLoader cl =
@ -303,7 +303,7 @@ public abstract class Policy {
*/ */
ProtectionDomain policyDomain = ProtectionDomain policyDomain =
AccessController.doPrivileged(new PrivilegedAction<ProtectionDomain>() { AccessController.doPrivileged(new PrivilegedAction<>() {
public ProtectionDomain run() { public ProtectionDomain run() {
return p.getClass().getProtectionDomain(); return p.getClass().getProtectionDomain();
} }

View File

@ -367,7 +367,7 @@ public class ProtectionDomain {
PermissionCollection perms = PermissionCollection perms =
java.security.AccessController.doPrivileged java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<PermissionCollection>() { (new java.security.PrivilegedAction<>() {
public PermissionCollection run() { public PermissionCollection run() {
Policy p = Policy.getPolicyNoCheck(); Policy p = Policy.getPolicyNoCheck();
return p.getPermissions(ProtectionDomain.this); return p.getPermissions(ProtectionDomain.this);

View File

@ -711,7 +711,7 @@ public abstract class Provider extends Properties {
legacyChanged = true; legacyChanged = true;
if (legacyStrings == null) { if (legacyStrings == null) {
legacyStrings = new LinkedHashMap<String,String>(); legacyStrings = new LinkedHashMap<>();
} }
return true; return true;
} }
@ -773,7 +773,7 @@ public abstract class Provider extends Properties {
private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) { private void implReplaceAll(BiFunction<? super Object, ? super Object, ? extends Object> function) {
legacyChanged = true; legacyChanged = true;
if (legacyStrings == null) { if (legacyStrings == null) {
legacyStrings = new LinkedHashMap<String,String>(); legacyStrings = new LinkedHashMap<>();
} else { } else {
legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function); legacyStrings.replaceAll((BiFunction<? super String, ? super String, ? extends String>) function);
} }
@ -905,7 +905,7 @@ public abstract class Provider extends Properties {
} }
serviceSet = null; serviceSet = null;
if (legacyMap == null) { if (legacyMap == null) {
legacyMap = new LinkedHashMap<ServiceKey,Service>(); legacyMap = new LinkedHashMap<>();
} else { } else {
legacyMap.clear(); legacyMap.clear();
} }
@ -1133,7 +1133,7 @@ public abstract class Provider extends Properties {
("service.getProvider() must match this Provider object"); ("service.getProvider() must match this Provider object");
} }
if (serviceMap == null) { if (serviceMap == null) {
serviceMap = new LinkedHashMap<ServiceKey,Service>(); serviceMap = new LinkedHashMap<>();
} }
servicesChanged = true; servicesChanged = true;
String type = s.getType(); String type = s.getType();
@ -1305,7 +1305,7 @@ public abstract class Provider extends Properties {
} }
static { static {
knownEngines = new HashMap<String,EngineDescription>(); knownEngines = new HashMap<>();
// JCA // JCA
addEngine("AlgorithmParameterGenerator", false, null); addEngine("AlgorithmParameterGenerator", false, null);
addEngine("AlgorithmParameters", false, null); addEngine("AlgorithmParameters", false, null);
@ -1431,14 +1431,14 @@ public abstract class Provider extends Properties {
private void addAlias(String alias) { private void addAlias(String alias) {
if (aliases.isEmpty()) { if (aliases.isEmpty()) {
aliases = new ArrayList<String>(2); aliases = new ArrayList<>(2);
} }
aliases.add(alias); aliases.add(alias);
} }
void addAttribute(String type, String value) { void addAttribute(String type, String value) {
if (attributes.isEmpty()) { if (attributes.isEmpty()) {
attributes = new HashMap<UString,String>(8); attributes = new HashMap<>(8);
} }
attributes.put(new UString(type), value); attributes.put(new UString(type), value);
} }
@ -1471,12 +1471,12 @@ public abstract class Provider extends Properties {
if (aliases == null) { if (aliases == null) {
this.aliases = Collections.<String>emptyList(); this.aliases = Collections.<String>emptyList();
} else { } else {
this.aliases = new ArrayList<String>(aliases); this.aliases = new ArrayList<>(aliases);
} }
if (attributes == null) { if (attributes == null) {
this.attributes = Collections.<UString,String>emptyMap(); this.attributes = Collections.<UString,String>emptyMap();
} else { } else {
this.attributes = new HashMap<UString,String>(); this.attributes = new HashMap<>();
for (Map.Entry<String,String> entry : attributes.entrySet()) { for (Map.Entry<String,String> entry : attributes.entrySet()) {
this.attributes.put(new UString(entry.getKey()), entry.getValue()); this.attributes.put(new UString(entry.getKey()), entry.getValue());
} }
@ -1644,7 +1644,7 @@ public abstract class Provider extends Properties {
("class configured for " + type + " (provider: " + ("class configured for " + type + " (provider: " +
provider.getName() + ") is not public."); provider.getName() + ") is not public.");
} }
classRef = new WeakReference<Class<?>>(clazz); classRef = new WeakReference<>(clazz);
} }
return clazz; return clazz;
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {

View File

@ -616,7 +616,7 @@ public class SecureRandom extends java.util.Random {
throws NoSuchAlgorithmException { throws NoSuchAlgorithmException {
String property = AccessController.doPrivileged( String property = AccessController.doPrivileged(
new PrivilegedAction<String>() { new PrivilegedAction<>() {
@Override @Override
public String run() { public String run() {
return Security.getProperty( return Security.getProperty(

View File

@ -66,7 +66,7 @@ public final class Security {
// things in initialize that might require privs. // things in initialize that might require privs.
// (the FileInputStream call and the File.exists call, // (the FileInputStream call and the File.exists call,
// the securityPropFile call, etc) // the securityPropFile call, etc)
AccessController.doPrivileged(new PrivilegedAction<Void>() { AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() { public Void run() {
initialize(); initialize();
return null; return null;
@ -810,7 +810,7 @@ public final class Security {
final boolean pd = key.equals("package.definition"); final boolean pd = key.equals("package.definition");
if (pa || pd) { if (pa || pd) {
AccessController.doPrivileged(new PrivilegedAction<Void>() { AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() { public Void run() {
try { try {
/* Get the class via the bootstrap class loader. */ /* Get the class via the bootstrap class loader. */

View File

@ -265,7 +265,7 @@ public abstract class Signature extends SignatureSpi {
private final static Map<String,Boolean> signatureInfo; private final static Map<String,Boolean> signatureInfo;
static { static {
signatureInfo = new ConcurrentHashMap<String,Boolean>(); signatureInfo = new ConcurrentHashMap<>();
Boolean TRUE = Boolean.TRUE; Boolean TRUE = Boolean.TRUE;
// pre-initialize with values for our SignatureSpi implementations // pre-initialize with values for our SignatureSpi implementations
signatureInfo.put("sun.security.provider.DSA$RawDSA", TRUE); signatureInfo.put("sun.security.provider.DSA$RawDSA", TRUE);

View File

@ -140,7 +140,7 @@ public abstract class Signer extends Identity {
} }
try { try {
AccessController.doPrivileged( AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() { new PrivilegedExceptionAction<>() {
public Void run() throws KeyManagementException { public Void run() throws KeyManagementException {
setPublicKey(pub); setPublicKey(pub);
return null; return null;

View File

@ -560,7 +560,7 @@ implements java.io.Serializable
if (size > 0) { if (size > 0) {
// we know of 3 different cert types: X.509, PGP, SDSI, which // we know of 3 different cert types: X.509, PGP, SDSI, which
// could all be present in the stream at the same time // could all be present in the stream at the same time
cfs = new Hashtable<String, CertificateFactory>(3); cfs = new Hashtable<>(3);
this.certs = new java.security.cert.Certificate[size]; this.certs = new java.security.cert.Certificate[size];
} }

View File

@ -61,7 +61,7 @@ implements java.io.Serializable
* *
*/ */
public UnresolvedPermissionCollection() { public UnresolvedPermissionCollection() {
perms = new HashMap<String, List<UnresolvedPermission>>(11); perms = new HashMap<>(11);
} }
/** /**
@ -82,7 +82,7 @@ implements java.io.Serializable
synchronized (this) { synchronized (this) {
v = perms.get(up.getName()); v = perms.get(up.getName());
if (v == null) { if (v == null) {
v = new ArrayList<UnresolvedPermission>(); v = new ArrayList<>();
perms.put(up.getName(), v); perms.put(up.getName(), v);
} }
} }
@ -203,7 +203,7 @@ implements java.io.Serializable
Hashtable<String, Vector<UnresolvedPermission>> permissions = Hashtable<String, Vector<UnresolvedPermission>> permissions =
(Hashtable<String, Vector<UnresolvedPermission>>) (Hashtable<String, Vector<UnresolvedPermission>>)
gfields.get("permissions", null); gfields.get("permissions", null);
perms = new HashMap<String, List<UnresolvedPermission>>(permissions.size()*2); perms = new HashMap<>(permissions.size()*2);
// Convert each entry (Vector) into a List // Convert each entry (Vector) into a List
Set<Map.Entry<String, Vector<UnresolvedPermission>>> set = permissions.entrySet(); Set<Map.Entry<String, Vector<UnresolvedPermission>>> set = permissions.entrySet();

View File

@ -301,7 +301,7 @@ public class CertPathBuilder {
*/ */
public final static String getDefaultType() { public final static String getDefaultType() {
String cpbtype = String cpbtype =
AccessController.doPrivileged(new PrivilegedAction<String>() { AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty(CPB_TYPE); return Security.getProperty(CPB_TYPE);
} }

View File

@ -313,7 +313,7 @@ public class CertPathValidator {
*/ */
public final static String getDefaultType() { public final static String getDefaultType() {
String cpvtype = String cpvtype =
AccessController.doPrivileged(new PrivilegedAction<String>() { AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty(CPV_TYPE); return Security.getProperty(CPV_TYPE);
} }

View File

@ -409,7 +409,7 @@ public class CertStore {
*/ */
public final static String getDefaultType() { public final static String getDefaultType() {
String cstype; String cstype;
cstype = AccessController.doPrivileged(new PrivilegedAction<String>() { cstype = AccessController.doPrivileged(new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty(CERTSTORE_TYPE); return Security.getProperty(CERTSTORE_TYPE);
} }

View File

@ -231,7 +231,7 @@ public class CertificateRevokedException extends CertificateException {
if (size == 0) { if (size == 0) {
extensions = Collections.emptyMap(); extensions = Collections.emptyMap();
} else { } else {
extensions = new HashMap<String, Extension>(size); extensions = new HashMap<>(size);
} }
// Read in the extensions and put the mappings in the extensions map // Read in the extensions and put the mappings in the extensions map

View File

@ -120,8 +120,8 @@ public class PKIXParameters implements CertPathParameters {
setTrustAnchors(trustAnchors); setTrustAnchors(trustAnchors);
this.unmodInitialPolicies = Collections.<String>emptySet(); this.unmodInitialPolicies = Collections.<String>emptySet();
this.certPathCheckers = new ArrayList<PKIXCertPathChecker>(); this.certPathCheckers = new ArrayList<>();
this.certStores = new ArrayList<CertStore>(); this.certStores = new ArrayList<>();
} }
/** /**
@ -144,7 +144,7 @@ public class PKIXParameters implements CertPathParameters {
if (keystore == null) if (keystore == null)
throw new NullPointerException("the keystore parameter must be " + throw new NullPointerException("the keystore parameter must be " +
"non-null"); "non-null");
Set<TrustAnchor> hashSet = new HashSet<TrustAnchor>(); Set<TrustAnchor> hashSet = new HashSet<>();
Enumeration<String> aliases = keystore.aliases(); Enumeration<String> aliases = keystore.aliases();
while (aliases.hasMoreElements()) { while (aliases.hasMoreElements()) {
String alias = aliases.nextElement(); String alias = aliases.nextElement();
@ -156,8 +156,8 @@ public class PKIXParameters implements CertPathParameters {
} }
setTrustAnchors(hashSet); setTrustAnchors(hashSet);
this.unmodInitialPolicies = Collections.<String>emptySet(); this.unmodInitialPolicies = Collections.<String>emptySet();
this.certPathCheckers = new ArrayList<PKIXCertPathChecker>(); this.certPathCheckers = new ArrayList<>();
this.certStores = new ArrayList<CertStore>(); this.certStores = new ArrayList<>();
} }
/** /**
@ -207,7 +207,7 @@ public class PKIXParameters implements CertPathParameters {
} }
} }
this.unmodTrustAnchors = Collections.unmodifiableSet this.unmodTrustAnchors = Collections.unmodifiableSet
(new HashSet<TrustAnchor>(trustAnchors)); (new HashSet<>(trustAnchors));
} }
/** /**
@ -256,7 +256,7 @@ public class PKIXParameters implements CertPathParameters {
+ "of type java.lang.String"); + "of type java.lang.String");
} }
this.unmodInitialPolicies = this.unmodInitialPolicies =
Collections.unmodifiableSet(new HashSet<String>(initialPolicies)); Collections.unmodifiableSet(new HashSet<>(initialPolicies));
} else } else
this.unmodInitialPolicies = Collections.<String>emptySet(); this.unmodInitialPolicies = Collections.<String>emptySet();
} }
@ -280,7 +280,7 @@ public class PKIXParameters implements CertPathParameters {
*/ */
public void setCertStores(List<CertStore> stores) { public void setCertStores(List<CertStore> stores) {
if (stores == null) { if (stores == null) {
this.certStores = new ArrayList<CertStore>(); this.certStores = new ArrayList<>();
} else { } else {
for (Iterator<CertStore> i = stores.iterator(); i.hasNext();) { for (Iterator<CertStore> i = stores.iterator(); i.hasNext();) {
if (!(i.next() instanceof CertStore)) { if (!(i.next() instanceof CertStore)) {
@ -288,7 +288,7 @@ public class PKIXParameters implements CertPathParameters {
+ "of type java.security.cert.CertStore"); + "of type java.security.cert.CertStore");
} }
} }
this.certStores = new ArrayList<CertStore>(stores); this.certStores = new ArrayList<>(stores);
} }
} }
@ -316,7 +316,7 @@ public class PKIXParameters implements CertPathParameters {
*/ */
public List<CertStore> getCertStores() { public List<CertStore> getCertStores() {
return Collections.unmodifiableList return Collections.unmodifiableList
(new ArrayList<CertStore>(this.certStores)); (new ArrayList<>(this.certStores));
} }
/** /**
@ -544,14 +544,13 @@ public class PKIXParameters implements CertPathParameters {
*/ */
public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) { public void setCertPathCheckers(List<PKIXCertPathChecker> checkers) {
if (checkers != null) { if (checkers != null) {
List<PKIXCertPathChecker> tmpList = List<PKIXCertPathChecker> tmpList = new ArrayList<>();
new ArrayList<PKIXCertPathChecker>();
for (PKIXCertPathChecker checker : checkers) { for (PKIXCertPathChecker checker : checkers) {
tmpList.add((PKIXCertPathChecker)checker.clone()); tmpList.add((PKIXCertPathChecker)checker.clone());
} }
this.certPathCheckers = tmpList; this.certPathCheckers = tmpList;
} else { } else {
this.certPathCheckers = new ArrayList<PKIXCertPathChecker>(); this.certPathCheckers = new ArrayList<>();
} }
} }
@ -567,7 +566,7 @@ public class PKIXParameters implements CertPathParameters {
* @see #setCertPathCheckers * @see #setCertPathCheckers
*/ */
public List<PKIXCertPathChecker> getCertPathCheckers() { public List<PKIXCertPathChecker> getCertPathCheckers() {
List<PKIXCertPathChecker> tmpList = new ArrayList<PKIXCertPathChecker>(); List<PKIXCertPathChecker> tmpList = new ArrayList<>();
for (PKIXCertPathChecker ck : certPathCheckers) { for (PKIXCertPathChecker ck : certPathCheckers) {
tmpList.add((PKIXCertPathChecker)ck.clone()); tmpList.add((PKIXCertPathChecker)ck.clone());
} }
@ -667,11 +666,11 @@ public class PKIXParameters implements CertPathParameters {
// must clone these because addCertStore, et al. modify them // must clone these because addCertStore, et al. modify them
if (certStores != null) { if (certStores != null) {
copy.certStores = new ArrayList<CertStore>(certStores); copy.certStores = new ArrayList<>(certStores);
} }
if (certPathCheckers != null) { if (certPathCheckers != null) {
copy.certPathCheckers = copy.certPathCheckers =
new ArrayList<PKIXCertPathChecker>(certPathCheckers.size()); new ArrayList<>(certPathCheckers.size());
for (PKIXCertPathChecker checker : certPathCheckers) { for (PKIXCertPathChecker checker : certPathCheckers) {
copy.certPathCheckers.add( copy.certPathCheckers.add(
(PKIXCertPathChecker)checker.clone()); (PKIXCertPathChecker)checker.clone());

View File

@ -170,7 +170,7 @@ public abstract class PKIXRevocationChecker extends PKIXCertPathChecker {
{ {
this.ocspExtensions = (extensions == null) this.ocspExtensions = (extensions == null)
? Collections.<Extension>emptyList() ? Collections.<Extension>emptyList()
: new ArrayList<Extension>(extensions); : new ArrayList<>(extensions);
} }
/** /**
@ -232,7 +232,7 @@ public abstract class PKIXRevocationChecker extends PKIXCertPathChecker {
public void setOptions(Set<Option> options) { public void setOptions(Set<Option> options) {
this.options = (options == null) this.options = (options == null)
? Collections.<Option>emptySet() ? Collections.<Option>emptySet()
: new HashSet<Option>(options); : new HashSet<>(options);
} }
/** /**

View File

@ -124,8 +124,8 @@ public class X509CRLSelector implements CRLSelector {
issuerX500Principals = null; issuerX500Principals = null;
} else { } else {
// clone // clone
issuerX500Principals = new HashSet<X500Principal>(issuers); issuerX500Principals = new HashSet<>(issuers);
issuerNames = new HashSet<Object>(); issuerNames = new HashSet<>();
for (X500Principal p : issuerX500Principals) { for (X500Principal p : issuerX500Principals) {
issuerNames.add(p.getEncoded()); issuerNames.add(p.getEncoded());
} }
@ -288,10 +288,10 @@ public class X509CRLSelector implements CRLSelector {
*/ */
private void addIssuerNameInternal(Object name, X500Principal principal) { private void addIssuerNameInternal(Object name, X500Principal principal) {
if (issuerNames == null) { if (issuerNames == null) {
issuerNames = new HashSet<Object>(); issuerNames = new HashSet<>();
} }
if (issuerX500Principals == null) { if (issuerX500Principals == null) {
issuerX500Principals = new HashSet<X500Principal>(); issuerX500Principals = new HashSet<>();
} }
issuerNames.add(name); issuerNames.add(name);
issuerX500Principals.add(principal); issuerX500Principals.add(principal);
@ -311,7 +311,7 @@ public class X509CRLSelector implements CRLSelector {
private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names) private static HashSet<Object> cloneAndCheckIssuerNames(Collection<?> names)
throws IOException throws IOException
{ {
HashSet<Object> namesCopy = new HashSet<Object>(); HashSet<Object> namesCopy = new HashSet<>();
Iterator<?> i = names.iterator(); Iterator<?> i = names.iterator();
while (i.hasNext()) { while (i.hasNext()) {
Object nameObject = i.next(); Object nameObject = i.next();
@ -363,7 +363,7 @@ public class X509CRLSelector implements CRLSelector {
*/ */
private static HashSet<X500Principal> parseIssuerNames(Collection<Object> names) private static HashSet<X500Principal> parseIssuerNames(Collection<Object> names)
throws IOException { throws IOException {
HashSet<X500Principal> x500Principals = new HashSet<X500Principal>(); HashSet<X500Principal> x500Principals = new HashSet<>();
for (Iterator<Object> t = names.iterator(); t.hasNext(); ) { for (Iterator<Object> t = names.iterator(); t.hasNext(); ) {
Object nameObject = t.next(); Object nameObject = t.next();
if (nameObject instanceof String) { if (nameObject instanceof String) {
@ -701,9 +701,9 @@ public class X509CRLSelector implements CRLSelector {
X509CRLSelector copy = (X509CRLSelector)super.clone(); X509CRLSelector copy = (X509CRLSelector)super.clone();
if (issuerNames != null) { if (issuerNames != null) {
copy.issuerNames = copy.issuerNames =
new HashSet<Object>(issuerNames); new HashSet<>(issuerNames);
copy.issuerX500Principals = copy.issuerX500Principals =
new HashSet<X500Principal>(issuerX500Principals); new HashSet<>(issuerX500Principals);
} }
return copy; return copy;
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {

View File

@ -619,8 +619,8 @@ public class X509CertSelector implements CertSelector {
keyPurposeOIDSet = null; keyPurposeOIDSet = null;
} else { } else {
this.keyPurposeSet = this.keyPurposeSet =
Collections.unmodifiableSet(new HashSet<String>(keyPurposeSet)); Collections.unmodifiableSet(new HashSet<>(keyPurposeSet));
keyPurposeOIDSet = new HashSet<ObjectIdentifier>(); keyPurposeOIDSet = new HashSet<>();
for (String s : this.keyPurposeSet) { for (String s : this.keyPurposeSet) {
keyPurposeOIDSet.add(new ObjectIdentifier(s)); keyPurposeOIDSet.add(new ObjectIdentifier(s));
} }
@ -815,12 +815,12 @@ public class X509CertSelector implements CertSelector {
// First, ensure that the name parses // First, ensure that the name parses
GeneralNameInterface tempName = makeGeneralNameInterface(type, name); GeneralNameInterface tempName = makeGeneralNameInterface(type, name);
if (subjectAlternativeNames == null) { if (subjectAlternativeNames == null) {
subjectAlternativeNames = new HashSet<List<?>>(); subjectAlternativeNames = new HashSet<>();
} }
if (subjectAlternativeGeneralNames == null) { if (subjectAlternativeGeneralNames == null) {
subjectAlternativeGeneralNames = new HashSet<GeneralNameInterface>(); subjectAlternativeGeneralNames = new HashSet<>();
} }
List<Object> list = new ArrayList<Object>(2); List<Object> list = new ArrayList<>(2);
list.add(Integer.valueOf(type)); list.add(Integer.valueOf(type));
list.add(name); list.add(name);
subjectAlternativeNames.add(list); subjectAlternativeNames.add(list);
@ -845,7 +845,7 @@ public class X509CertSelector implements CertSelector {
* @throws IOException if a parsing error occurs * @throws IOException if a parsing error occurs
*/ */
private static Set<GeneralNameInterface> parseNames(Collection<List<?>> names) throws IOException { private static Set<GeneralNameInterface> parseNames(Collection<List<?>> names) throws IOException {
Set<GeneralNameInterface> genNames = new HashSet<GeneralNameInterface>(); Set<GeneralNameInterface> genNames = new HashSet<>();
for (List<?> nameList : names) { for (List<?> nameList : names) {
if (nameList.size() != 2) { if (nameList.size() != 2) {
throw new IOException("name list size not 2"); throw new IOException("name list size not 2");
@ -1096,10 +1096,10 @@ public class X509CertSelector implements CertSelector {
} else { } else {
// Snapshot set and parse it // Snapshot set and parse it
Set<String> tempSet = Collections.unmodifiableSet Set<String> tempSet = Collections.unmodifiableSet
(new HashSet<String>(certPolicySet)); (new HashSet<>(certPolicySet));
/* Convert to Vector of ObjectIdentifiers */ /* Convert to Vector of ObjectIdentifiers */
Iterator<String> i = tempSet.iterator(); Iterator<String> i = tempSet.iterator();
Vector<CertificatePolicyId> polIdVector = new Vector<CertificatePolicyId>(); Vector<CertificatePolicyId> polIdVector = new Vector<>();
while (i.hasNext()) { while (i.hasNext()) {
Object o = i.next(); Object o = i.next();
if (!(o instanceof String)) { if (!(o instanceof String)) {
@ -1267,10 +1267,10 @@ public class X509CertSelector implements CertSelector {
// First, ensure that the name parses // First, ensure that the name parses
GeneralNameInterface tempName = makeGeneralNameInterface(type, name); GeneralNameInterface tempName = makeGeneralNameInterface(type, name);
if (pathToGeneralNames == null) { if (pathToGeneralNames == null) {
pathToNames = new HashSet<List<?>>(); pathToNames = new HashSet<>();
pathToGeneralNames = new HashSet<GeneralNameInterface>(); pathToGeneralNames = new HashSet<>();
} }
List<Object> list = new ArrayList<Object>(2); List<Object> list = new ArrayList<>(2);
list.add(Integer.valueOf(type)); list.add(Integer.valueOf(type));
list.add(name); list.add(name);
pathToNames.add(list); pathToNames.add(list);
@ -1671,10 +1671,10 @@ public class X509CertSelector implements CertSelector {
*/ */
private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException { private static Set<List<?>> cloneAndCheckNames(Collection<List<?>> names) throws IOException {
// Copy the Lists and Collection // Copy the Lists and Collection
Set<List<?>> namesCopy = new HashSet<List<?>>(); Set<List<?>> namesCopy = new HashSet<>();
for (List<?> o : names) for (List<?> o : names)
{ {
namesCopy.add(new ArrayList<Object>(o)); namesCopy.add(new ArrayList<>(o));
} }
// Check the contents of the Lists and clone any byte arrays // Check the contents of the Lists and clone any byte arrays
@ -2397,7 +2397,7 @@ public class X509CertSelector implements CertSelector {
* Convert the Vector of PolicyInformation to a Vector * Convert the Vector of PolicyInformation to a Vector
* of CertificatePolicyIds for easier comparison. * of CertificatePolicyIds for easier comparison.
*/ */
List<CertificatePolicyId> policyIDs = new ArrayList<CertificatePolicyId>(policies.size()); List<CertificatePolicyId> policyIDs = new ArrayList<>(policies.size());
for (PolicyInformation info : policies) { for (PolicyInformation info : policies) {
policyIDs.add(info.getPolicyIdentifier()); policyIDs.add(info.getPolicyIdentifier());
} }

View File

@ -53,9 +53,9 @@ import sun.util.calendar.ZoneInfo;
* ------------------------------------------------------ * ------------------------------------------------------
* }</pre> * }</pre>
* *
* <p><code>ERA</code> value 0 specifies the years before Meiji and * <p>{@code ERA} value 0 specifies the years before Meiji and
* the Gregorian year values are used. Unlike {@link * the Gregorian year values are used. Unlike
* GregorianCalendar}, the Julian to Gregorian transition is not * {@link GregorianCalendar}, the Julian to Gregorian transition is not
* supported because it doesn't make any sense to the Japanese * supported because it doesn't make any sense to the Japanese
* calendar systems used before Meiji. To represent the years before * calendar systems used before Meiji. To represent the years before
* Gregorian year 1, 0 and negative values are used. The Japanese * Gregorian year 1, 0 and negative values are used. The Japanese
@ -66,7 +66,7 @@ import sun.util.calendar.ZoneInfo;
* <p>A new era can be specified using property * <p>A new era can be specified using property
* jdk.calendar.japanese.supplemental.era. The new era is added to the * jdk.calendar.japanese.supplemental.era. The new era is added to the
* predefined eras. The syntax of the property is as follows. * predefined eras. The syntax of the property is as follows.
* <p><pre> * <pre>
* {@code name=<name>,abbr=<abbr>,since=<time['u']>} * {@code name=<name>,abbr=<abbr>,since=<time['u']>}
* </pre> * </pre>
* where * where
@ -83,7 +83,7 @@ import sun.util.calendar.ZoneInfo;
* ignored. * ignored.
* *
* <p>The following is an example of the property usage. * <p>The following is an example of the property usage.
* <p><pre> * <pre>
* java -Djdk.calendar.japanese.supplemental.era="name=NewEra,abbr=N,since=253374307200000" * java -Djdk.calendar.japanese.supplemental.era="name=NewEra,abbr=N,since=253374307200000"
* </pre> * </pre>
* The property specifies an era change to NewEra at 9999-02-11T00:00:00 local time. * The property specifies an era change to NewEra at 9999-02-11T00:00:00 local time.
@ -315,7 +315,7 @@ class JapaneseImperialCalendar extends Calendar {
private transient int[] originalFields; private transient int[] originalFields;
/** /**
* Constructs a <code>JapaneseImperialCalendar</code> based on the current time * Constructs a {@code JapaneseImperialCalendar} based on the current time
* in the given time zone with the given locale. * in the given time zone with the given locale.
* *
* @param zone the given time zone. * @param zone the given time zone.
@ -351,16 +351,16 @@ class JapaneseImperialCalendar extends Calendar {
} }
/** /**
* Compares this <code>JapaneseImperialCalendar</code> to the specified * Compares this {@code JapaneseImperialCalendar} to the specified
* <code>Object</code>. The result is <code>true</code> if and * {@code Object}. The result is {@code true} if and
* only if the argument is a <code>JapaneseImperialCalendar</code> object * only if the argument is a {@code JapaneseImperialCalendar} object
* that represents the same time value (millisecond offset from * that represents the same time value (millisecond offset from
* the <a href="Calendar.html#Epoch">Epoch</a>) under the same * the <a href="Calendar.html#Epoch">Epoch</a>) under the same
* <code>Calendar</code> parameters. * {@code Calendar} parameters.
* *
* @param obj the object to compare with. * @param obj the object to compare with.
* @return <code>true</code> if this object is equal to <code>obj</code>; * @return {@code true} if this object is equal to {@code obj};
* <code>false</code> otherwise. * {@code false} otherwise.
* @see Calendar#compareTo(Calendar) * @see Calendar#compareTo(Calendar)
*/ */
@Override @Override
@ -371,7 +371,7 @@ class JapaneseImperialCalendar extends Calendar {
/** /**
* Generates the hash code for this * Generates the hash code for this
* <code>JapaneseImperialCalendar</code> object. * {@code JapaneseImperialCalendar} object.
*/ */
@Override @Override
public int hashCode() { public int hashCode() {
@ -382,27 +382,27 @@ class JapaneseImperialCalendar extends Calendar {
* Adds the specified (signed) amount of time to the given calendar field, * Adds the specified (signed) amount of time to the given calendar field,
* based on the calendar's rules. * based on the calendar's rules.
* *
* <p><em>Add rule 1</em>. The value of <code>field</code> * <p><em>Add rule 1</em>. The value of {@code field}
* after the call minus the value of <code>field</code> before the * after the call minus the value of {@code field} before the
* call is <code>amount</code>, modulo any overflow that has occurred in * call is {@code amount}, modulo any overflow that has occurred in
* <code>field</code>. Overflow occurs when a field value exceeds its * {@code field}. Overflow occurs when a field value exceeds its
* range and, as a result, the next larger field is incremented or * range and, as a result, the next larger field is incremented or
* decremented and the field value is adjusted back into its range.</p> * decremented and the field value is adjusted back into its range.</p>
* *
* <p><em>Add rule 2</em>. If a smaller field is expected to be * <p><em>Add rule 2</em>. If a smaller field is expected to be
* invariant, but it is impossible for it to be equal to its * invariant, but it is impossible for it to be equal to its
* prior value because of changes in its minimum or maximum after * prior value because of changes in its minimum or maximum after
* <code>field</code> is changed, then its value is adjusted to be as close * {@code field} is changed, then its value is adjusted to be as close
* as possible to its expected value. A smaller field represents a * as possible to its expected value. A smaller field represents a
* smaller unit of time. <code>HOUR</code> is a smaller field than * smaller unit of time. {@code HOUR} is a smaller field than
* <code>DAY_OF_MONTH</code>. No adjustment is made to smaller fields * {@code DAY_OF_MONTH}. No adjustment is made to smaller fields
* that are not expected to be invariant. The calendar system * that are not expected to be invariant. The calendar system
* determines what fields are expected to be invariant.</p> * determines what fields are expected to be invariant.</p>
* *
* @param field the calendar field. * @param field the calendar field.
* @param amount the amount of date or time to be added to the field. * @param amount the amount of date or time to be added to the field.
* @exception IllegalArgumentException if <code>field</code> is * @exception IllegalArgumentException if {@code field} is
* <code>ZONE_OFFSET</code>, <code>DST_OFFSET</code>, or unknown, * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown,
* or if any calendar fields have out-of-range values in * or if any calendar fields have out-of-range values in
* non-lenient mode. * non-lenient mode.
*/ */
@ -548,12 +548,12 @@ class JapaneseImperialCalendar extends Calendar {
* <p>This method calls {@link #complete()} before adding the * <p>This method calls {@link #complete()} before adding the
* amount so that all the calendar fields are normalized. If there * amount so that all the calendar fields are normalized. If there
* is any calendar field having an out-of-range value in non-lenient mode, then an * is any calendar field having an out-of-range value in non-lenient mode, then an
* <code>IllegalArgumentException</code> is thrown. * {@code IllegalArgumentException} is thrown.
* *
* @param field the calendar field. * @param field the calendar field.
* @param amount the signed amount to add to <code>field</code>. * @param amount the signed amount to add to {@code field}.
* @exception IllegalArgumentException if <code>field</code> is * @exception IllegalArgumentException if {@code field} is
* <code>ZONE_OFFSET</code>, <code>DST_OFFSET</code>, or unknown, * {@code ZONE_OFFSET}, {@code DST_OFFSET}, or unknown,
* or if any calendar fields have out-of-range values in * or if any calendar fields have out-of-range values in
* non-lenient mode. * non-lenient mode.
* @see #roll(int,boolean) * @see #roll(int,boolean)
@ -1055,9 +1055,9 @@ class JapaneseImperialCalendar extends Calendar {
/** /**
* Returns the minimum value for the given calendar field of this * Returns the minimum value for the given calendar field of this
* <code>Calendar</code> instance. The minimum value is * {@code Calendar} instance. The minimum value is
* defined as the smallest value returned by the {@link * defined as the smallest value returned by the
* Calendar#get(int) get} method for any possible time value, * {@link Calendar#get(int) get} method for any possible time value,
* taking into consideration the current values of the * taking into consideration the current values of the
* {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek}, * {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek},
* {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek}, * {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek},
@ -1077,9 +1077,9 @@ class JapaneseImperialCalendar extends Calendar {
/** /**
* Returns the maximum value for the given calendar field of this * Returns the maximum value for the given calendar field of this
* <code>GregorianCalendar</code> instance. The maximum value is * {@code GregorianCalendar} instance. The maximum value is
* defined as the largest value returned by the {@link * defined as the largest value returned by the
* Calendar#get(int) get} method for any possible time value, * {@link Calendar#get(int) get} method for any possible time value,
* taking into consideration the current values of the * taking into consideration the current values of the
* {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek}, * {@link Calendar#getFirstDayOfWeek() getFirstDayOfWeek},
* {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek}, * {@link Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek},
@ -1108,7 +1108,7 @@ class JapaneseImperialCalendar extends Calendar {
/** /**
* Returns the highest minimum value for the given calendar field * Returns the highest minimum value for the given calendar field
* of this <code>GregorianCalendar</code> instance. The highest * of this {@code GregorianCalendar} instance. The highest
* minimum value is defined as the largest value returned by * minimum value is defined as the largest value returned by
* {@link #getActualMinimum(int)} for any possible time value, * {@link #getActualMinimum(int)} for any possible time value,
* taking into consideration the current values of the * taking into consideration the current values of the
@ -1130,7 +1130,7 @@ class JapaneseImperialCalendar extends Calendar {
/** /**
* Returns the lowest maximum value for the given calendar field * Returns the lowest maximum value for the given calendar field
* of this <code>GregorianCalendar</code> instance. The lowest * of this {@code GregorianCalendar} instance. The lowest
* maximum value is defined as the smallest value returned by * maximum value is defined as the smallest value returned by
* {@link #getActualMaximum(int)} for any possible time value, * {@link #getActualMaximum(int)} for any possible time value,
* taking into consideration the current values of the * taking into consideration the current values of the
@ -1166,7 +1166,7 @@ class JapaneseImperialCalendar extends Calendar {
* *
* @param field the calendar field * @param field the calendar field
* @return the minimum of the given field for the time value of * @return the minimum of the given field for the time value of
* this <code>JapaneseImperialCalendar</code> * this {@code JapaneseImperialCalendar}
* @see #getMinimum(int) * @see #getMinimum(int)
* @see #getMaximum(int) * @see #getMaximum(int)
* @see #getGreatestMinimum(int) * @see #getGreatestMinimum(int)
@ -1269,13 +1269,13 @@ class JapaneseImperialCalendar extends Calendar {
* and * and
* {@link Calendar#getTimeZone() getTimeZone} methods. * {@link Calendar#getTimeZone() getTimeZone} methods.
* For example, if the date of this instance is Heisei 16February 1, * For example, if the date of this instance is Heisei 16February 1,
* the actual maximum value of the <code>DAY_OF_MONTH</code> field * the actual maximum value of the {@code DAY_OF_MONTH} field
* is 29 because Heisei 16 is a leap year, and if the date of this * is 29 because Heisei 16 is a leap year, and if the date of this
* instance is Heisei 17 February 1, it's 28. * instance is Heisei 17 February 1, it's 28.
* *
* @param field the calendar field * @param field the calendar field
* @return the maximum of the given field for the time value of * @return the maximum of the given field for the time value of
* this <code>JapaneseImperialCalendar</code> * this {@code JapaneseImperialCalendar}
* @see #getMinimum(int) * @see #getMinimum(int)
* @see #getMaximum(int) * @see #getMaximum(int)
* @see #getGreatestMinimum(int) * @see #getGreatestMinimum(int)
@ -1558,7 +1558,7 @@ class JapaneseImperialCalendar extends Calendar {
* href="Calendar.html#Epoch">Epoch</a>) to calendar field values. * href="Calendar.html#Epoch">Epoch</a>) to calendar field values.
* The time is <em>not</em> * The time is <em>not</em>
* recomputed first; to recompute the time, then the fields, call the * recomputed first; to recompute the time, then the fields, call the
* <code>complete</code> method. * {@code complete} method.
* *
* @see Calendar#complete * @see Calendar#complete
*/ */

View File

@ -2411,7 +2411,7 @@ public class ForkJoinPool extends AbstractExecutorService {
int j = ((am & s) << ASHIFT) + ABASE; int j = ((am & s) << ASHIFT) + ABASE;
U.putOrderedObject(a, j, task); U.putOrderedObject(a, j, task);
U.putOrderedInt(q, QTOP, s + 1); U.putOrderedInt(q, QTOP, s + 1);
U.putOrderedInt(q, QLOCK, 0); U.putIntVolatile(q, QLOCK, 0);
if (n <= 1) if (n <= 1)
signalWork(ws, q); signalWork(ws, q);
return; return;

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -140,11 +140,24 @@ import java.util.Locale;
*/ */
public abstract class LocaleServiceProvider { public abstract class LocaleServiceProvider {
private static Void checkPermission() {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new RuntimePermission("localeServiceProvider"));
}
return null;
}
private LocaleServiceProvider(Void ignore) { }
/** /**
* Sole constructor. (For invocation by subclass constructors, typically * Initializes a new locale service provider.
* implicit.) *
* @throws SecurityException
* If a security manager has been installed and it denies
* {@link RuntimePermission RuntimePermission("localeServiceProvider")}
*/ */
protected LocaleServiceProvider() { protected LocaleServiceProvider() {
this(checkPermission());
} }
/** /**

View File

@ -76,7 +76,7 @@ final class JceSecurity {
static { static {
try { try {
AccessController.doPrivileged( AccessController.doPrivileged(
new PrivilegedExceptionAction<Void> () { new PrivilegedExceptionAction<> () {
@Override @Override
public Void run() throws Exception { public Void run() throws Exception {
setupJurisdictionPolicies(); setupJurisdictionPolicies();
@ -225,7 +225,7 @@ final class JceSecurity {
URL url = codeBaseCacheRef.get(clazz); URL url = codeBaseCacheRef.get(clazz);
if (url == null) { if (url == null) {
url = AccessController.doPrivileged( url = AccessController.doPrivileged(
new PrivilegedAction<URL>() { new PrivilegedAction<>() {
@Override @Override
public URL run() { public URL run() {
ProtectionDomain pd = clazz.getProtectionDomain(); ProtectionDomain pd = clazz.getProtectionDomain();

View File

@ -66,7 +66,7 @@ final class JceSecurityManager extends SecurityManager {
exemptPolicy = JceSecurity.getExemptPolicy(); exemptPolicy = JceSecurity.getExemptPolicy();
allPerm = CryptoAllPermission.INSTANCE; allPerm = CryptoAllPermission.INSTANCE;
INSTANCE = AccessController.doPrivileged( INSTANCE = AccessController.doPrivileged(
new PrivilegedAction<JceSecurityManager>() { new PrivilegedAction<>() {
public JceSecurityManager run() { public JceSecurityManager run() {
return new JceSecurityManager(); return new JceSecurityManager();
} }

View File

@ -63,7 +63,7 @@ public class KeyManagerFactory {
*/ */
public final static String getDefaultAlgorithm() { public final static String getDefaultAlgorithm() {
String type; String type;
type = AccessController.doPrivileged(new PrivilegedAction<String>() { type = AccessController.doPrivileged(new PrivilegedAction<>() {
@Override @Override
public String run() { public String run() {
return Security.getProperty( return Security.getProperty(

View File

@ -126,7 +126,7 @@ public abstract class SSLSocketFactory extends SocketFactory
} }
static String getSecurityProperty(final String name) { static String getSecurityProperty(final String name) {
return AccessController.doPrivileged(new PrivilegedAction<String>() { return AccessController.doPrivileged(new PrivilegedAction<>() {
@Override @Override
public String run() { public String run() {
String s = java.security.Security.getProperty(name); String s = java.security.Security.getProperty(name);

View File

@ -63,7 +63,7 @@ public class TrustManagerFactory {
*/ */
public final static String getDefaultAlgorithm() { public final static String getDefaultAlgorithm() {
String type; String type;
type = AccessController.doPrivileged(new PrivilegedAction<String>() { type = AccessController.doPrivileged(new PrivilegedAction<>() {
@Override @Override
public String run() { public String run() {
return Security.getProperty( return Security.getProperty(

View File

@ -154,11 +154,11 @@ public final class Subject implements java.io.Serializable {
public Subject() { public Subject() {
this.principals = Collections.synchronizedSet this.principals = Collections.synchronizedSet
(new SecureSet<Principal>(this, PRINCIPAL_SET)); (new SecureSet<>(this, PRINCIPAL_SET));
this.pubCredentials = Collections.synchronizedSet this.pubCredentials = Collections.synchronizedSet
(new SecureSet<Object>(this, PUB_CREDENTIAL_SET)); (new SecureSet<>(this, PUB_CREDENTIAL_SET));
this.privCredentials = Collections.synchronizedSet this.privCredentials = Collections.synchronizedSet
(new SecureSet<Object>(this, PRIV_CREDENTIAL_SET)); (new SecureSet<>(this, PRIV_CREDENTIAL_SET));
} }
/** /**
@ -206,11 +206,11 @@ public final class Subject implements java.io.Serializable {
collectionNullClean(pubCredentials); collectionNullClean(pubCredentials);
collectionNullClean(privCredentials); collectionNullClean(privCredentials);
this.principals = Collections.synchronizedSet(new SecureSet<Principal> this.principals = Collections.synchronizedSet(new SecureSet<>
(this, PRINCIPAL_SET, principals)); (this, PRINCIPAL_SET, principals));
this.pubCredentials = Collections.synchronizedSet(new SecureSet<Object> this.pubCredentials = Collections.synchronizedSet(new SecureSet<>
(this, PUB_CREDENTIAL_SET, pubCredentials)); (this, PUB_CREDENTIAL_SET, pubCredentials));
this.privCredentials = Collections.synchronizedSet(new SecureSet<Object> this.privCredentials = Collections.synchronizedSet(new SecureSet<>
(this, PRIV_CREDENTIAL_SET, privCredentials)); (this, PRIV_CREDENTIAL_SET, privCredentials));
this.readOnly = readOnly; this.readOnly = readOnly;
} }
@ -292,7 +292,7 @@ public final class Subject implements java.io.Serializable {
// return the Subject from the DomainCombiner of the provided context // return the Subject from the DomainCombiner of the provided context
return AccessController.doPrivileged return AccessController.doPrivileged
(new java.security.PrivilegedAction<Subject>() { (new java.security.PrivilegedAction<>() {
public Subject run() { public Subject run() {
DomainCombiner dc = acc.getDomainCombiner(); DomainCombiner dc = acc.getDomainCombiner();
if (!(dc instanceof SubjectDomainCombiner)) { if (!(dc instanceof SubjectDomainCombiner)) {
@ -555,7 +555,7 @@ public final class Subject implements java.io.Serializable {
return java.security.AccessController.doPrivileged return java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<AccessControlContext>() { (new java.security.PrivilegedAction<>() {
public AccessControlContext run() { public AccessControlContext run() {
if (subject == null) { if (subject == null) {
return new AccessControlContext(acc, null); return new AccessControlContext(acc, null);
@ -801,7 +801,7 @@ public final class Subject implements java.io.Serializable {
Set<Principal> thatPrincipals; Set<Principal> thatPrincipals;
synchronized(that.principals) { synchronized(that.principals) {
// avoid deadlock from dual locks // avoid deadlock from dual locks
thatPrincipals = new HashSet<Principal>(that.principals); thatPrincipals = new HashSet<>(that.principals);
} }
if (!principals.equals(thatPrincipals)) { if (!principals.equals(thatPrincipals)) {
return false; return false;
@ -810,7 +810,7 @@ public final class Subject implements java.io.Serializable {
Set<Object> thatPubCredentials; Set<Object> thatPubCredentials;
synchronized(that.pubCredentials) { synchronized(that.pubCredentials) {
// avoid deadlock from dual locks // avoid deadlock from dual locks
thatPubCredentials = new HashSet<Object>(that.pubCredentials); thatPubCredentials = new HashSet<>(that.pubCredentials);
} }
if (!pubCredentials.equals(thatPubCredentials)) { if (!pubCredentials.equals(thatPubCredentials)) {
return false; return false;
@ -819,7 +819,7 @@ public final class Subject implements java.io.Serializable {
Set<Object> thatPrivCredentials; Set<Object> thatPrivCredentials;
synchronized(that.privCredentials) { synchronized(that.privCredentials) {
// avoid deadlock from dual locks // avoid deadlock from dual locks
thatPrivCredentials = new HashSet<Object>(that.privCredentials); thatPrivCredentials = new HashSet<>(that.privCredentials);
} }
if (!privCredentials.equals(thatPrivCredentials)) { if (!privCredentials.equals(thatPrivCredentials)) {
return false; return false;
@ -970,21 +970,21 @@ public final class Subject implements java.io.Serializable {
// Rewrap the principals into a SecureSet // Rewrap the principals into a SecureSet
try { try {
principals = Collections.synchronizedSet(new SecureSet<Principal> principals = Collections.synchronizedSet(new SecureSet<>
(this, PRINCIPAL_SET, inputPrincs)); (this, PRINCIPAL_SET, inputPrincs));
} catch (NullPointerException npe) { } catch (NullPointerException npe) {
// Sometimes people deserialize the principals set only. // Sometimes people deserialize the principals set only.
// Subject is not accessible, so just don't fail. // Subject is not accessible, so just don't fail.
principals = Collections.synchronizedSet principals = Collections.synchronizedSet
(new SecureSet<Principal>(this, PRINCIPAL_SET)); (new SecureSet<>(this, PRINCIPAL_SET));
} }
// The Credential {@code Set} is not serialized, but we do not // The Credential {@code Set} is not serialized, but we do not
// want the default deserialization routine to set it to null. // want the default deserialization routine to set it to null.
this.pubCredentials = Collections.synchronizedSet this.pubCredentials = Collections.synchronizedSet
(new SecureSet<Object>(this, PUB_CREDENTIAL_SET)); (new SecureSet<>(this, PUB_CREDENTIAL_SET));
this.privCredentials = Collections.synchronizedSet this.privCredentials = Collections.synchronizedSet
(new SecureSet<Object>(this, PRIV_CREDENTIAL_SET)); (new SecureSet<>(this, PRIV_CREDENTIAL_SET));
} }
/** /**
@ -1497,7 +1497,7 @@ public final class Subject implements java.io.Serializable {
Object next; Object next;
if (which == Subject.PRIV_CREDENTIAL_SET) { if (which == Subject.PRIV_CREDENTIAL_SET) {
next = java.security.AccessController.doPrivileged next = java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<Object>() { (new java.security.PrivilegedAction<>() {
public Object run() { public Object run() {
return iterator.next(); return iterator.next();
} }

View File

@ -229,7 +229,7 @@ public abstract class Configuration {
if (configuration == null) { if (configuration == null) {
String config_class = null; String config_class = null;
config_class = AccessController.doPrivileged config_class = AccessController.doPrivileged
(new PrivilegedAction<String>() { (new PrivilegedAction<>() {
public String run() { public String run() {
return java.security.Security.getProperty return java.security.Security.getProperty
("login.configuration.provider"); ("login.configuration.provider");
@ -242,7 +242,7 @@ public abstract class Configuration {
try { try {
final String finalClass = config_class; final String finalClass = config_class;
Configuration untrustedImpl = AccessController.doPrivileged( Configuration untrustedImpl = AccessController.doPrivileged(
new PrivilegedExceptionAction<Configuration>() { new PrivilegedExceptionAction<>() {
public Configuration run() throws ClassNotFoundException, public Configuration run() throws ClassNotFoundException,
InstantiationException, InstantiationException,
IllegalAccessException { IllegalAccessException {
@ -254,7 +254,7 @@ public abstract class Configuration {
} }
}); });
AccessController.doPrivileged( AccessController.doPrivileged(
new PrivilegedExceptionAction<Void>() { new PrivilegedExceptionAction<>() {
public Void run() { public Void run() {
setConfiguration(untrustedImpl); setConfiguration(untrustedImpl);
return null; return null;

View File

@ -142,7 +142,7 @@ public abstract class X509Certificate extends Certificate {
static { static {
X509Provider = AccessController.doPrivileged( X509Provider = AccessController.doPrivileged(
new PrivilegedAction<String>() { new PrivilegedAction<>() {
public String run() { public String run() {
return Security.getProperty(X509_PROVIDER); return Security.getProperty(X509_PROVIDER);
} }

View File

@ -33,7 +33,7 @@ import java.security.BasicPermission;
* name, but no actions list. Callers either possess the permission or not. * name, but no actions list. Callers either possess the permission or not.
* <p> * <p>
* The following targets are defined: * The following targets are defined:
* <p> *
* <table border=1 cellpadding=5 summary="permission target name, * <table border=1 cellpadding=5 summary="permission target name,
* what the target allows,and associated risks"> * what the target allows,and associated risks">
* <tr> * <tr>

View File

@ -530,7 +530,7 @@ public class PKCS7 {
// CRLs (optional) // CRLs (optional)
if (crls != null && crls.length != 0) { if (crls != null && crls.length != 0) {
// cast to X509CRLImpl[] since X509CRLImpl implements DerEncoder // cast to X509CRLImpl[] since X509CRLImpl implements DerEncoder
Set<X509CRLImpl> implCRLs = new HashSet<X509CRLImpl>(crls.length); Set<X509CRLImpl> implCRLs = new HashSet<>(crls.length);
for (X509CRL crl: crls) { for (X509CRL crl: crls) {
if (crl instanceof X509CRLImpl) if (crl instanceof X509CRLImpl)
implCRLs.add((X509CRLImpl) crl); implCRLs.add((X509CRLImpl) crl);
@ -590,7 +590,7 @@ public class PKCS7 {
public SignerInfo[] verify(byte[] bytes) public SignerInfo[] verify(byte[] bytes)
throws NoSuchAlgorithmException, SignatureException { throws NoSuchAlgorithmException, SignatureException {
Vector<SignerInfo> intResult = new Vector<SignerInfo>(); Vector<SignerInfo> intResult = new Vector<>();
for (int i = 0; i < signerInfos.length; i++) { for (int i = 0; i < signerInfos.length; i++) {
SignerInfo signerInfo = verify(signerInfos[i], bytes); SignerInfo signerInfo = verify(signerInfos[i], bytes);

View File

@ -85,8 +85,7 @@ public class PKCS9Attributes {
DerInputStream in) throws IOException { DerInputStream in) throws IOException {
if (permittedAttributes != null) { if (permittedAttributes != null) {
this.permittedAttributes = this.permittedAttributes =
new Hashtable<ObjectIdentifier, ObjectIdentifier>( new Hashtable<>(permittedAttributes.length);
permittedAttributes.length);
for (int i = 0; i < permittedAttributes.length; i++) for (int i = 0; i < permittedAttributes.length; i++)
this.permittedAttributes.put(permittedAttributes[i], this.permittedAttributes.put(permittedAttributes[i],

View File

@ -237,7 +237,7 @@ public class SignerInfo implements DerEncoder {
if (userCert == null) if (userCert == null)
return null; return null;
ArrayList<X509Certificate> certList = new ArrayList<X509Certificate>(); ArrayList<X509Certificate> certList = new ArrayList<>();
certList.add(userCert); certList.add(userCert);
X509Certificate[] pkcsCerts = block.getCertificates(); X509Certificate[] pkcsCerts = block.getCertificates();

View File

@ -165,7 +165,7 @@ abstract class SeedGenerator {
md.update(b); md.update(b);
java.security.AccessController.doPrivileged java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<Void>() { (new java.security.PrivilegedAction<>() {
@Override @Override
public Void run() { public Void run() {
try { try {
@ -295,7 +295,7 @@ abstract class SeedGenerator {
final ThreadGroup[] finalsg = new ThreadGroup[1]; final ThreadGroup[] finalsg = new ThreadGroup[1];
Thread t = java.security.AccessController.doPrivileged Thread t = java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<Thread>() { (new java.security.PrivilegedAction<>() {
@Override @Override
public Thread run() { public Thread run() {
ThreadGroup parent, group = ThreadGroup parent, group =
@ -501,7 +501,7 @@ abstract class SeedGenerator {
final URL device = new URL(deviceName); final URL device = new URL(deviceName);
try { try {
seedStream = java.security.AccessController.doPrivileged seedStream = java.security.AccessController.doPrivileged
(new java.security.PrivilegedExceptionAction<InputStream>() { (new java.security.PrivilegedExceptionAction<>() {
@Override @Override
public InputStream run() throws IOException { public InputStream run() throws IOException {
/* /*

View File

@ -148,7 +148,7 @@ public abstract class SunJSSE extends java.security.Provider {
} }
private void registerAlgorithms(final boolean isfips) { private void registerAlgorithms(final boolean isfips) {
AccessController.doPrivileged(new PrivilegedAction<Object>() { AccessController.doPrivileged(new PrivilegedAction<>() {
@Override @Override
public Object run() { public Object run() {
doRegister(isfips); doRegister(isfips);

View File

@ -394,7 +394,7 @@ public class DerInputStream {
/* /*
* Pull values out of the stream. * Pull values out of the stream.
*/ */
Vector<DerValue> vec = new Vector<DerValue>(startLen); Vector<DerValue> vec = new Vector<>(startLen);
DerValue value; DerValue value;
do { do {

View File

@ -110,7 +110,7 @@ public class ManifestDigester {
public ManifestDigester(byte bytes[]) public ManifestDigester(byte bytes[])
{ {
rawBytes = bytes; rawBytes = bytes;
entries = new HashMap<String, Entry>(); entries = new HashMap<>();
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();

View File

@ -77,9 +77,9 @@ public class ManifestEntryVerifier {
*/ */
public ManifestEntryVerifier(Manifest man) public ManifestEntryVerifier(Manifest man)
{ {
createdDigests = new HashMap<String, MessageDigest>(11); createdDigests = new HashMap<>(11);
digests = new ArrayList<MessageDigest>(); digests = new ArrayList<>();
manifestHashes = new ArrayList<byte[]>(); manifestHashes = new ArrayList<>();
this.man = man; this.man = man;
} }

View File

@ -203,7 +203,7 @@ public class SignatureFileVerifier {
private MessageDigest getDigest(String algorithm) private MessageDigest getDigest(String algorithm)
{ {
if (createdDigests == null) if (createdDigests == null)
createdDigests = new HashMap<String, MessageDigest>(); createdDigests = new HashMap<>();
MessageDigest digest = createdDigests.get(algorithm); MessageDigest digest = createdDigests.get(algorithm);
@ -523,7 +523,7 @@ public class SignatureFileVerifier {
ArrayList<X509Certificate> chain = info.getCertificateChain(block); ArrayList<X509Certificate> chain = info.getCertificateChain(block);
CertPath certChain = certificateFactory.generateCertPath(chain); CertPath certChain = certificateFactory.generateCertPath(chain);
if (signers == null) { if (signers == null) {
signers = new ArrayList<CodeSigner>(); signers = new ArrayList<>();
} }
// Append the new code signer // Append the new code signer
signers.add(new CodeSigner(certChain, info.getTimestamp())); signers.add(new CodeSigner(certChain, info.getTimestamp()));

View File

@ -307,7 +307,7 @@ public class AVA implements DerEncoder {
// doublequote. // doublequote.
int c = readChar(in, "Quoted string did not end in quote"); int c = readChar(in, "Quoted string did not end in quote");
List<Byte> embeddedHex = new ArrayList<Byte>(); List<Byte> embeddedHex = new ArrayList<>();
boolean isPrintableString = true; boolean isPrintableString = true;
while (c != '"') { while (c != '"') {
if (c == '\\') { if (c == '\\') {

View File

@ -571,7 +571,7 @@ public class AlgorithmId implements Serializable, DerEncoder {
break; break;
} }
if (oidTable == null) { if (oidTable == null) {
oidTable = new HashMap<String,ObjectIdentifier>(); oidTable = new HashMap<>();
} }
oidString = alias.substring(index); oidString = alias.substring(index);
String stdAlgName = provs[i].getProperty(alias); String stdAlgName = provs[i].getProperty(alias);
@ -588,7 +588,7 @@ public class AlgorithmId implements Serializable, DerEncoder {
} }
if (oidTable == null) { if (oidTable == null) {
oidTable = new HashMap<String,ObjectIdentifier>(1); oidTable = new HashMap<>(1);
} }
initOidTable = true; initOidTable = true;
} }
@ -887,7 +887,7 @@ public class AlgorithmId implements Serializable, DerEncoder {
*/ */
sha1WithDSA_oid = ObjectIdentifier.newInternal(dsaWithSHA1_PKIX_data); sha1WithDSA_oid = ObjectIdentifier.newInternal(dsaWithSHA1_PKIX_data);
nameTable = new HashMap<ObjectIdentifier,String>(); nameTable = new HashMap<>();
nameTable.put(MD5_oid, "MD5"); nameTable.put(MD5_oid, "MD5");
nameTable.put(MD2_oid, "MD2"); nameTable.put(MD2_oid, "MD2");
nameTable.put(SHA_oid, "SHA-1"); nameTable.put(SHA_oid, "SHA-1");

View File

@ -58,7 +58,7 @@ public class CertificatePolicySet {
* @exception IOException on decoding errors. * @exception IOException on decoding errors.
*/ */
public CertificatePolicySet(DerInputStream in) throws IOException { public CertificatePolicySet(DerInputStream in) throws IOException {
ids = new Vector<CertificatePolicyId>(); ids = new Vector<>();
DerValue[] seq = in.getSequence(5); DerValue[] seq = in.getSequence(5);
for (int i = 0; i < seq.length; i++) { for (int i = 0; i < seq.length; i++) {

View File

@ -59,11 +59,11 @@ public class GeneralSubtrees implements Cloneable {
* The default constructor for the class. * The default constructor for the class.
*/ */
public GeneralSubtrees() { public GeneralSubtrees() {
trees = new ArrayList<GeneralSubtree>(); trees = new ArrayList<>();
} }
private GeneralSubtrees(GeneralSubtrees source) { private GeneralSubtrees(GeneralSubtrees source) {
trees = new ArrayList<GeneralSubtree>(source.trees); trees = new ArrayList<>(source.trees);
} }
/** /**

View File

@ -102,7 +102,7 @@ public class RDN {
int quoteCount = 0; int quoteCount = 0;
int searchOffset = 0; int searchOffset = 0;
int avaOffset = 0; int avaOffset = 0;
List<AVA> avaVec = new ArrayList<AVA>(3); List<AVA> avaVec = new ArrayList<>(3);
int nextPlus = name.indexOf('+'); int nextPlus = name.indexOf('+');
while (nextPlus >= 0) { while (nextPlus >= 0) {
quoteCount += X500Name.countQuotes(name, searchOffset, nextPlus); quoteCount += X500Name.countQuotes(name, searchOffset, nextPlus);
@ -182,7 +182,7 @@ public class RDN {
} }
int searchOffset = 0; int searchOffset = 0;
int avaOffset = 0; int avaOffset = 0;
List<AVA> avaVec = new ArrayList<AVA>(3); List<AVA> avaVec = new ArrayList<>(3);
int nextPlus = name.indexOf('+'); int nextPlus = name.indexOf('+');
while (nextPlus >= 0) { while (nextPlus >= 0) {
/* /*
@ -453,7 +453,7 @@ public class RDN {
} else { } else {
// order the string type AVA's alphabetically, // order the string type AVA's alphabetically,
// followed by the oid type AVA's numerically // followed by the oid type AVA's numerically
List<AVA> avaList = new ArrayList<AVA>(assertion.length); List<AVA> avaList = new ArrayList<>(assertion.length);
for (int i = 0; i < assertion.length; i++) { for (int i = 0; i < assertion.length; i++) {
avaList.add(assertion[i]); avaList.add(assertion[i]);
} }

View File

@ -342,7 +342,7 @@ public class X500Name implements GeneralNameInterface, Principal {
public List<AVA> allAvas() { public List<AVA> allAvas() {
List<AVA> list = allAvaList; List<AVA> list = allAvaList;
if (list == null) { if (list == null) {
list = new ArrayList<AVA>(); list = new ArrayList<>();
for (int i = 0; i < names.length; i++) { for (int i = 0; i < names.length; i++) {
list.addAll(names[i].avas()); list.addAll(names[i].avas());
} }
@ -1382,7 +1382,7 @@ public class X500Name implements GeneralNameInterface, Principal {
*/ */
static { static {
PrivilegedExceptionAction<Object[]> pa = PrivilegedExceptionAction<Object[]> pa =
new PrivilegedExceptionAction<Object[]>() { new PrivilegedExceptionAction<>() {
public Object[] run() throws Exception { public Object[] run() throws Exception {
Class<X500Principal> pClass = X500Principal.class; Class<X500Principal> pClass = X500Principal.class;
Class<?>[] args = new Class<?>[] { X500Name.class }; Class<?>[] args = new Class<?>[] { X500Name.class };

View File

@ -25,6 +25,8 @@
package sun.util.locale.provider; package sun.util.locale.provider;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.text.spi.BreakIteratorProvider; import java.text.spi.BreakIteratorProvider;
import java.text.spi.CollatorProvider; import java.text.spi.CollatorProvider;
import java.text.spi.DateFormatProvider; import java.text.spi.DateFormatProvider;
@ -177,7 +179,9 @@ public abstract class AuxLocaleProviderAdapter extends LocaleProviderAdapter {
* A dummy locale service provider that indicates there is no * A dummy locale service provider that indicates there is no
* provider available * provider available
*/ */
private static final NullProvider NULL_PROVIDER = new NullProvider(); private static final NullProvider NULL_PROVIDER = AccessController.doPrivileged(
(PrivilegedAction<NullProvider>) () -> new NullProvider());
private static class NullProvider extends LocaleServiceProvider { private static class NullProvider extends LocaleServiceProvider {
@Override @Override
public Locale[] getAvailableLocales() { public Locale[] getAvailableLocales() {

View File

@ -26,7 +26,7 @@
package sun.util.locale.provider; package sun.util.locale.provider;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedActionException; import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction; import java.security.PrivilegedExceptionAction;
import java.text.spi.BreakIteratorProvider; import java.text.spi.BreakIteratorProvider;
import java.text.spi.CollatorProvider; import java.text.spi.CollatorProvider;
@ -133,8 +133,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public BreakIteratorProvider getBreakIteratorProvider() { public BreakIteratorProvider getBreakIteratorProvider() {
if (breakIteratorProvider == null) { if (breakIteratorProvider == null) {
BreakIteratorProvider provider = new BreakIteratorProviderImpl(getAdapterType(), BreakIteratorProvider provider = AccessController.doPrivileged(
getLanguageTagSet("FormatData")); (PrivilegedAction<BreakIteratorProvider>) () ->
new BreakIteratorProviderImpl(
getAdapterType(),
getLanguageTagSet("FormatData")));
synchronized (this) { synchronized (this) {
if (breakIteratorProvider == null) { if (breakIteratorProvider == null) {
breakIteratorProvider = provider; breakIteratorProvider = provider;
@ -147,8 +151,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public CollatorProvider getCollatorProvider() { public CollatorProvider getCollatorProvider() {
if (collatorProvider == null) { if (collatorProvider == null) {
CollatorProvider provider = new CollatorProviderImpl(getAdapterType(), CollatorProvider provider = AccessController.doPrivileged(
getLanguageTagSet("CollationData")); (PrivilegedAction<CollatorProvider>) () ->
new CollatorProviderImpl(
getAdapterType(),
getLanguageTagSet("CollationData")));
synchronized (this) { synchronized (this) {
if (collatorProvider == null) { if (collatorProvider == null) {
collatorProvider = provider; collatorProvider = provider;
@ -161,8 +169,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public DateFormatProvider getDateFormatProvider() { public DateFormatProvider getDateFormatProvider() {
if (dateFormatProvider == null) { if (dateFormatProvider == null) {
DateFormatProvider provider = new DateFormatProviderImpl(getAdapterType(), DateFormatProvider provider = AccessController.doPrivileged(
getLanguageTagSet("FormatData")); (PrivilegedAction<DateFormatProvider>) () ->
new DateFormatProviderImpl(
getAdapterType(),
getLanguageTagSet("FormatData")));
synchronized (this) { synchronized (this) {
if (dateFormatProvider == null) { if (dateFormatProvider == null) {
dateFormatProvider = provider; dateFormatProvider = provider;
@ -175,8 +187,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public DateFormatSymbolsProvider getDateFormatSymbolsProvider() { public DateFormatSymbolsProvider getDateFormatSymbolsProvider() {
if (dateFormatSymbolsProvider == null) { if (dateFormatSymbolsProvider == null) {
DateFormatSymbolsProvider provider = new DateFormatSymbolsProviderImpl(getAdapterType(), DateFormatSymbolsProvider provider = AccessController.doPrivileged(
getLanguageTagSet("FormatData")); (PrivilegedAction<DateFormatSymbolsProvider>) () ->
new DateFormatSymbolsProviderImpl(
getAdapterType(),
getLanguageTagSet("FormatData")));
synchronized (this) { synchronized (this) {
if (dateFormatSymbolsProvider == null) { if (dateFormatSymbolsProvider == null) {
dateFormatSymbolsProvider = provider; dateFormatSymbolsProvider = provider;
@ -189,7 +205,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public DecimalFormatSymbolsProvider getDecimalFormatSymbolsProvider() { public DecimalFormatSymbolsProvider getDecimalFormatSymbolsProvider() {
if (decimalFormatSymbolsProvider == null) { if (decimalFormatSymbolsProvider == null) {
DecimalFormatSymbolsProvider provider = new DecimalFormatSymbolsProviderImpl(getAdapterType(), getLanguageTagSet("FormatData")); DecimalFormatSymbolsProvider provider = AccessController.doPrivileged(
(PrivilegedAction<DecimalFormatSymbolsProvider>) () ->
new DecimalFormatSymbolsProviderImpl(
getAdapterType(),
getLanguageTagSet("FormatData")));
synchronized (this) { synchronized (this) {
if (decimalFormatSymbolsProvider == null) { if (decimalFormatSymbolsProvider == null) {
decimalFormatSymbolsProvider = provider; decimalFormatSymbolsProvider = provider;
@ -202,8 +223,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public NumberFormatProvider getNumberFormatProvider() { public NumberFormatProvider getNumberFormatProvider() {
if (numberFormatProvider == null) { if (numberFormatProvider == null) {
NumberFormatProvider provider = new NumberFormatProviderImpl(getAdapterType(), NumberFormatProvider provider = AccessController.doPrivileged(
getLanguageTagSet("FormatData")); (PrivilegedAction<NumberFormatProvider>) () ->
new NumberFormatProviderImpl(
getAdapterType(),
getLanguageTagSet("FormatData")));
synchronized (this) { synchronized (this) {
if (numberFormatProvider == null) { if (numberFormatProvider == null) {
numberFormatProvider = provider; numberFormatProvider = provider;
@ -219,8 +244,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public CurrencyNameProvider getCurrencyNameProvider() { public CurrencyNameProvider getCurrencyNameProvider() {
if (currencyNameProvider == null) { if (currencyNameProvider == null) {
CurrencyNameProvider provider = new CurrencyNameProviderImpl(getAdapterType(), CurrencyNameProvider provider = AccessController.doPrivileged(
getLanguageTagSet("CurrencyNames")); (PrivilegedAction<CurrencyNameProvider>) () ->
new CurrencyNameProviderImpl(
getAdapterType(),
getLanguageTagSet("CurrencyNames")));
synchronized (this) { synchronized (this) {
if (currencyNameProvider == null) { if (currencyNameProvider == null) {
currencyNameProvider = provider; currencyNameProvider = provider;
@ -233,8 +262,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public LocaleNameProvider getLocaleNameProvider() { public LocaleNameProvider getLocaleNameProvider() {
if (localeNameProvider == null) { if (localeNameProvider == null) {
LocaleNameProvider provider = new LocaleNameProviderImpl(getAdapterType(), LocaleNameProvider provider = AccessController.doPrivileged(
getLanguageTagSet("LocaleNames")); (PrivilegedAction<LocaleNameProvider>) () ->
new LocaleNameProviderImpl(
getAdapterType(),
getLanguageTagSet("LocaleNames")));
synchronized (this) { synchronized (this) {
if (localeNameProvider == null) { if (localeNameProvider == null) {
localeNameProvider = provider; localeNameProvider = provider;
@ -247,8 +280,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public TimeZoneNameProvider getTimeZoneNameProvider() { public TimeZoneNameProvider getTimeZoneNameProvider() {
if (timeZoneNameProvider == null) { if (timeZoneNameProvider == null) {
TimeZoneNameProvider provider = new TimeZoneNameProviderImpl(getAdapterType(), TimeZoneNameProvider provider = AccessController.doPrivileged(
getLanguageTagSet("TimeZoneNames")); (PrivilegedAction<TimeZoneNameProvider>) () ->
new TimeZoneNameProviderImpl(
getAdapterType(),
getLanguageTagSet("TimeZoneNames")));
synchronized (this) { synchronized (this) {
if (timeZoneNameProvider == null) { if (timeZoneNameProvider == null) {
timeZoneNameProvider = provider; timeZoneNameProvider = provider;
@ -261,9 +298,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public CalendarDataProvider getCalendarDataProvider() { public CalendarDataProvider getCalendarDataProvider() {
if (calendarDataProvider == null) { if (calendarDataProvider == null) {
CalendarDataProvider provider; CalendarDataProvider provider = AccessController.doPrivileged(
provider = new CalendarDataProviderImpl(getAdapterType(), (PrivilegedAction<CalendarDataProvider>) () ->
getLanguageTagSet("CalendarData")); new CalendarDataProviderImpl(
getAdapterType(),
getLanguageTagSet("CalendarData")));
synchronized (this) { synchronized (this) {
if (calendarDataProvider == null) { if (calendarDataProvider == null) {
calendarDataProvider = provider; calendarDataProvider = provider;
@ -276,9 +316,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public CalendarNameProvider getCalendarNameProvider() { public CalendarNameProvider getCalendarNameProvider() {
if (calendarNameProvider == null) { if (calendarNameProvider == null) {
CalendarNameProvider provider; CalendarNameProvider provider = AccessController.doPrivileged(
provider = new CalendarNameProviderImpl(getAdapterType(), (PrivilegedAction<CalendarNameProvider>) () ->
getLanguageTagSet("FormatData")); new CalendarNameProviderImpl(
getAdapterType(),
getLanguageTagSet("FormatData")));
synchronized (this) { synchronized (this) {
if (calendarNameProvider == null) { if (calendarNameProvider == null) {
calendarNameProvider = provider; calendarNameProvider = provider;
@ -294,8 +337,12 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
@Override @Override
public CalendarProvider getCalendarProvider() { public CalendarProvider getCalendarProvider() {
if (calendarProvider == null) { if (calendarProvider == null) {
CalendarProvider provider = new CalendarProviderImpl(getAdapterType(), CalendarProvider provider = AccessController.doPrivileged(
getLanguageTagSet("CalendarData")); (PrivilegedAction<CalendarProvider>) () ->
new CalendarProviderImpl(
getAdapterType(),
getLanguageTagSet("CalendarData")));
synchronized (this) { synchronized (this) {
if (calendarProvider == null) { if (calendarProvider == null) {
calendarProvider = provider; calendarProvider = provider;
@ -319,6 +366,7 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
} }
// ResourceBundleBasedAdapter method implementation // ResourceBundleBasedAdapter method implementation
@Override @Override
public LocaleData getLocaleData() { public LocaleData getLocaleData() {
if (localeData == null) { if (localeData == null) {
@ -449,4 +497,4 @@ public class JRELocaleProviderAdapter extends LocaleProviderAdapter implements R
} }
return locales; return locales;
} }
} }

View File

@ -125,7 +125,7 @@ public final class NativePRNG extends SecureRandomSpi {
*/ */
private static RandomIO initIO(final Variant v) { private static RandomIO initIO(final Variant v) {
return AccessController.doPrivileged( return AccessController.doPrivileged(
new PrivilegedAction<RandomIO>() { new PrivilegedAction<>() {
@Override @Override
public RandomIO run() { public RandomIO run() {
@ -440,7 +440,7 @@ public final class NativePRNG extends SecureRandomSpi {
if (seedOutInitialized == false) { if (seedOutInitialized == false) {
seedOutInitialized = true; seedOutInitialized = true;
seedOut = AccessController.doPrivileged( seedOut = AccessController.doPrivileged(
new PrivilegedAction<OutputStream>() { new PrivilegedAction<>() {
@Override @Override
public OutputStream run() { public OutputStream run() {
try { try {

View File

@ -93,7 +93,7 @@ import javax.management.DynamicMBean;
* returns the diagnostic command description * returns the diagnostic command description
* (the same as the one return in the 'help' command)</li> * (the same as the one return in the 'help' command)</li>
* <li>{@link javax.management.MBeanOperationInfo#getImpact() getImpact()} * <li>{@link javax.management.MBeanOperationInfo#getImpact() getImpact()}
* returns <code>ACTION_INFO</code></li> * returns {@code ACTION_INFO}</li>
* <li>{@link javax.management.MBeanOperationInfo#getReturnType() getReturnType()} * <li>{@link javax.management.MBeanOperationInfo#getReturnType() getReturnType()}
* returns {@code java.lang.String}</li> * returns {@code java.lang.String}</li>
* <li>{@link javax.management.MBeanOperationInfo#getDescriptor() getDescriptor()} * <li>{@link javax.management.MBeanOperationInfo#getDescriptor() getDescriptor()}
@ -105,7 +105,6 @@ import javax.management.DynamicMBean;
* meta-data for a JMX element. A field is a name and an associated value. * meta-data for a JMX element. A field is a name and an associated value.
* The additional meta-data provided for an operation associated with a * The additional meta-data provided for an operation associated with a
* diagnostic command are described in the table below: * diagnostic command are described in the table below:
* <p>
* *
* <table border="1" cellpadding="5"> * <table border="1" cellpadding="5">
* <tr> * <tr>
@ -161,7 +160,6 @@ import javax.management.DynamicMBean;
* arguments supported by the diagnostic command (see below)</td> * arguments supported by the diagnostic command (see below)</td>
* </tr> * </tr>
* </table> * </table>
* <p>
* *
* <p>The description of parameters (options or arguments) of a diagnostic * <p>The description of parameters (options or arguments) of a diagnostic
* command is provided within a Descriptor instance. In this Descriptor, * command is provided within a Descriptor instance. In this Descriptor,

View File

@ -41,14 +41,14 @@ import sun.management.GarbageCollectionNotifInfoCompositeData;
* when the Java virtual machine completes a garbage collection action * when the Java virtual machine completes a garbage collection action
* The notification emitted will contain the garbage collection notification * The notification emitted will contain the garbage collection notification
* information about the status of the memory: * information about the status of the memory:
* <u1> * <ul>
* <li>The name of the garbage collector used to perform the collection.</li> * <li>The name of the garbage collector used to perform the collection.</li>
* <li>The action performed by the garbage collector.</li> * <li>The action performed by the garbage collector.</li>
* <li>The cause of the garbage collection action.</li> * <li>The cause of the garbage collection action.</li>
* <li>A {@link GcInfo} object containing some statistics about the GC cycle * <li>A {@link GcInfo} object containing some statistics about the GC cycle
(start time, end time) and the memory usage before and after (start time, end time) and the memory usage before and after
the GC cycle.</li> the GC cycle.</li>
* </u1> * </ul>
* *
* <p> * <p>
* A {@link CompositeData CompositeData} representing * A {@link CompositeData CompositeData} representing
@ -81,7 +81,7 @@ import sun.management.GarbageCollectionNotifInfoCompositeData;
* <li>A {@linkplain #GARBAGE_COLLECTION_NOTIFICATION garbage collection notification}. * <li>A {@linkplain #GARBAGE_COLLECTION_NOTIFICATION garbage collection notification}.
* <br>Used by every notification emitted by the garbage collector, the details about * <br>Used by every notification emitted by the garbage collector, the details about
* the notification are provided in the {@linkplain #getGcAction action} String * the notification are provided in the {@linkplain #getGcAction action} String
* <p></li> * </li>
* </ul> * </ul>
**/ **/

View File

@ -52,13 +52,13 @@ import sun.management.GcInfoBuilder;
* </blockquote> * </blockquote>
* *
* <p> * <p>
* <tt>GcInfo</tt> is a {@link CompositeData CompositeData} * {@code GcInfo} is a {@link CompositeData CompositeData}
* The GC-specific attributes can be obtained via the CompositeData * The GC-specific attributes can be obtained via the CompositeData
* interface. This is a historical relic, and other classes should * interface. This is a historical relic, and other classes should
* not copy this pattern. Use {@link CompositeDataView} instead. * not copy this pattern. Use {@link CompositeDataView} instead.
* *
* <h4>MXBean Mapping</h4> * <h4>MXBean Mapping</h4>
* <tt>GcInfo</tt> is mapped to a {@link CompositeData CompositeData} * {@code GcInfo} is mapped to a {@link CompositeData CompositeData}
* with attributes as specified in the {@link #from from} method. * with attributes as specified in the {@link #from from} method.
* *
* @author Mandy Chung * @author Mandy Chung
@ -152,11 +152,11 @@ public class GcInfo implements CompositeData, CompositeDataView {
* Returns the memory usage of all memory pools * Returns the memory usage of all memory pools
* at the beginning of this GC. * at the beginning of this GC.
* This method returns * This method returns
* a <tt>Map</tt> of the name of a memory pool * a {@code Map} of the name of a memory pool
* to the memory usage of the corresponding * to the memory usage of the corresponding
* memory pool before GC starts. * memory pool before GC starts.
* *
* @return a <tt>Map</tt> of memory pool names to the memory * @return a {@code Map} of memory pool names to the memory
* usage of a memory pool before GC starts. * usage of a memory pool before GC starts.
*/ */
public Map<String, MemoryUsage> getMemoryUsageBeforeGc() { public Map<String, MemoryUsage> getMemoryUsageBeforeGc() {
@ -167,11 +167,11 @@ public class GcInfo implements CompositeData, CompositeDataView {
* Returns the memory usage of all memory pools * Returns the memory usage of all memory pools
* at the end of this GC. * at the end of this GC.
* This method returns * This method returns
* a <tt>Map</tt> of the name of a memory pool * a {@code Map} of the name of a memory pool
* to the memory usage of the corresponding * to the memory usage of the corresponding
* memory pool when GC finishes. * memory pool when GC finishes.
* *
* @return a <tt>Map</tt> of memory pool names to the memory * @return a {@code Map} of memory pool names to the memory
* usage of a memory pool when GC finishes. * usage of a memory pool when GC finishes.
*/ */
public Map<String, MemoryUsage> getMemoryUsageAfterGc() { public Map<String, MemoryUsage> getMemoryUsageAfterGc() {
@ -179,12 +179,11 @@ public class GcInfo implements CompositeData, CompositeDataView {
} }
/** /**
* Returns a <tt>GcInfo</tt> object represented by the * Returns a {@code GcInfo} object represented by the
* given <tt>CompositeData</tt>. The given * given {@code CompositeData}. The given
* <tt>CompositeData</tt> must contain * {@code CompositeData} must contain
* all the following attributes: * all the following attributes:
* *
* <p>
* <blockquote> * <blockquote>
* <table border> * <table border>
* <tr> * <tr>
@ -193,33 +192,33 @@ public class GcInfo implements CompositeData, CompositeDataView {
* </tr> * </tr>
* <tr> * <tr>
* <td>index</td> * <td>index</td>
* <td><tt>java.lang.Long</tt></td> * <td>{@code java.lang.Long}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>startTime</td> * <td>startTime</td>
* <td><tt>java.lang.Long</tt></td> * <td>{@code java.lang.Long}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>endTime</td> * <td>endTime</td>
* <td><tt>java.lang.Long</tt></td> * <td>{@code java.lang.Long}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>memoryUsageBeforeGc</td> * <td>memoryUsageBeforeGc</td>
* <td><tt>javax.management.openmbean.TabularData</tt></td> * <td>{@code javax.management.openmbean.TabularData}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>memoryUsageAfterGc</td> * <td>memoryUsageAfterGc</td>
* <td><tt>javax.management.openmbean.TabularData</tt></td> * <td>{@code javax.management.openmbean.TabularData}</td>
* </tr> * </tr>
* </table> * </table>
* </blockquote> * </blockquote>
* *
* @throws IllegalArgumentException if <tt>cd</tt> does not * @throws IllegalArgumentException if {@code cd} does not
* represent a <tt>GcInfo</tt> object with the attributes * represent a {@code GcInfo} object with the attributes
* described above. * described above.
* *
* @return a <tt>GcInfo</tt> object represented by <tt>cd</tt> * @return a {@code GcInfo} object represented by {@code cd}
* if <tt>cd</tt> is not <tt>null</tt>; <tt>null</tt> otherwise. * if {@code cd} is not {@code null}; {@code null} otherwise.
*/ */
public static GcInfo from(CompositeData cd) { public static GcInfo from(CompositeData cd) {
if (cd == null) { if (cd == null) {
@ -272,7 +271,7 @@ public class GcInfo implements CompositeData, CompositeDataView {
} }
/** /**
* <p>Return the {@code CompositeData} representation of this * Return the {@code CompositeData} representation of this
* {@code GcInfo}, including any GC-specific attributes. The * {@code GcInfo}, including any GC-specific attributes. The
* returned value will have at least all the attributes described * returned value will have at least all the attributes described
* in the {@link #from(CompositeData) from} method, plus optionally * in the {@link #from(CompositeData) from} method, plus optionally

View File

@ -42,10 +42,10 @@ import javax.management.openmbean.CompositeData;
* be set dynamically via a management interface after * be set dynamically via a management interface after
* the VM was started. * the VM was started.
* *
* A <tt>VMOption</tt> contains the value of a VM option * A {@code VMOption} contains the value of a VM option
* and the origin of that value at the time this <tt>VMOption</tt> * and the origin of that value at the time this {@code VMOption}
* object was constructed. The value of the VM option * object was constructed. The value of the VM option
* may be changed after the <tt>VMOption</tt> object was constructed, * may be changed after the {@code VMOption} object was constructed,
* *
* @see <a href="{@docRoot}/../../../../technotes/guides/vm/index.html"> * @see <a href="{@docRoot}/../../../../technotes/guides/vm/index.html">
* Java Virtual Machine</a> * Java Virtual Machine</a>
@ -108,15 +108,15 @@ public class VMOption {
} }
/** /**
* Constructs a <tt>VMOption</tt>. * Constructs a {@code VMOption}.
* *
* @param name Name of a VM option. * @param name Name of a VM option.
* @param value Value of a VM option. * @param value Value of a VM option.
* @param writeable <tt>true</tt> if a VM option can be set dynamically, * @param writeable {@code true} if a VM option can be set dynamically,
* or <tt>false</tt> otherwise. * or {@code false} otherwise.
* @param origin where the value of a VM option came from. * @param origin where the value of a VM option came from.
* *
* @throws NullPointerException if the name or value is <tt>null</tt> * @throws NullPointerException if the name or value is {@code null}
*/ */
public VMOption(String name, String value, boolean writeable, Origin origin) { public VMOption(String name, String value, boolean writeable, Origin origin) {
this.name = name; this.name = name;
@ -126,7 +126,7 @@ public class VMOption {
} }
/** /**
* Constructs a <tt>VMOption</tt> object from a * Constructs a {@code VMOption} object from a
* {@link CompositeData CompositeData}. * {@link CompositeData CompositeData}.
*/ */
private VMOption(CompositeData cd) { private VMOption(CompositeData cd) {
@ -150,10 +150,10 @@ public class VMOption {
/** /**
* Returns the value of this VM option at the time when * Returns the value of this VM option at the time when
* this <tt>VMOption</tt> was created. The value could have been changed. * this {@code VMOption} was created. The value could have been changed.
* *
* @return the value of the VM option at the time when * @return the value of the VM option at the time when
* this <tt>VMOption</tt> was created. * this {@code VMOption} was created.
*/ */
public String getValue() { public String getValue() {
return value; return value;
@ -174,7 +174,7 @@ public class VMOption {
* it can be set by the {@link HotSpotDiagnosticMXBean#setVMOption * it can be set by the {@link HotSpotDiagnosticMXBean#setVMOption
* HotSpotDiagnosticMXBean.setVMOption} method. * HotSpotDiagnosticMXBean.setVMOption} method.
* *
* @return <tt>true</tt> if this VM option is writeable; <tt>false</tt> * @return {@code true} if this VM option is writeable; {@code false}
* otherwise. * otherwise.
*/ */
public boolean isWriteable() { public boolean isWriteable() {
@ -189,10 +189,10 @@ public class VMOption {
} }
/** /**
* Returns a <tt>VMOption</tt> object represented by the * Returns a {@code VMOption} object represented by the
* given <tt>CompositeData</tt>. The given <tt>CompositeData</tt> * given {@code CompositeData}. The given {@code CompositeData}
* must contain the following attributes: * must contain the following attributes:
* <p> *
* <blockquote> * <blockquote>
* <table border> * <table border>
* <tr> * <tr>
@ -201,32 +201,32 @@ public class VMOption {
* </tr> * </tr>
* <tr> * <tr>
* <td>name</td> * <td>name</td>
* <td><tt>java.lang.String</tt></td> * <td>{@code java.lang.String}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>value</td> * <td>value</td>
* <td><tt>java.lang.String</tt></td> * <td>{@code java.lang.String}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>origin</td> * <td>origin</td>
* <td><tt>java.lang.String</tt></td> * <td>{@code java.lang.String}</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>writeable</td> * <td>writeable</td>
* <td><tt>java.lang.Boolean</tt></td> * <td>{@code java.lang.Boolean}</td>
* </tr> * </tr>
* </table> * </table>
* </blockquote> * </blockquote>
* *
* @param cd <tt>CompositeData</tt> representing a <tt>VMOption</tt> * @param cd {@code CompositeData} representing a {@code VMOption}
* *
* @throws IllegalArgumentException if <tt>cd</tt> does not * @throws IllegalArgumentException if {@code cd} does not
* represent a <tt>VMOption</tt> with the attributes described * represent a {@code VMOption} with the attributes described
* above. * above.
* *
* @return a <tt>VMOption</tt> object represented by <tt>cd</tt> * @return a {@code VMOption} object represented by {@code cd}
* if <tt>cd</tt> is not <tt>null</tt>; * if {@code cd} is not {@code null};
* <tt>null</tt> otherwise. * {@code null} otherwise.
*/ */
public static VMOption from(CompositeData cd) { public static VMOption from(CompositeData cd) {
if (cd == null) { if (cd == null) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2013, 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -78,10 +78,9 @@ import java.lang.Double;
* under which these calls cannot even enqueue the requested operation for * under which these calls cannot even enqueue the requested operation for
* later processing. Even under these circumstances it is generally better to * later processing. Even under these circumstances it is generally better to
* simply ignore the invocation and return, rather than throwing an * simply ignore the invocation and return, rather than throwing an
* exception. Under these circumstances, however, all subsequent invocations * exception. Under these circumstances, however, subsequently invoking
* of <tt>flush()</tt> and <tt>sync</tt> should return <tt>false</tt>, as * <tt>flush()</tt> or <tt>sync</tt> would not imply that all previous
* returning <tt>true</tt> would imply that all previous operations had * operations had successfully been made permanent.
* successfully been made permanent.
* *
* <p>There is one circumstance under which <tt>putSpi, removeSpi and * <p>There is one circumstance under which <tt>putSpi, removeSpi and
* childSpi</tt> <i>should</i> throw an exception: if the caller lacks * childSpi</tt> <i>should</i> throw an exception: if the caller lacks
@ -122,6 +121,13 @@ import java.lang.Double;
* @since 1.4 * @since 1.4
*/ */
public abstract class AbstractPreferences extends Preferences { public abstract class AbstractPreferences extends Preferences {
/**
* The code point U+0000, assigned to the null control character, is the
* only character encoded in Unicode and ISO/IEC 10646 that is always
* invalid in any XML 1.0 and 1.1 document.
*/
static final int CODE_POINT_U0000 = '\u0000';
/** /**
* Our name relative to parent. * Our name relative to parent.
*/ */
@ -234,6 +240,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
* <tt>MAX_KEY_LENGTH</tt> or if <tt>value.length</tt> exceeds * <tt>MAX_KEY_LENGTH</tt> or if <tt>value.length</tt> exceeds
* <tt>MAX_VALUE_LENGTH</tt>. * <tt>MAX_VALUE_LENGTH</tt>.
* @throws IllegalArgumentException if either key or value contain
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -244,6 +252,10 @@ public abstract class AbstractPreferences extends Preferences {
throw new IllegalArgumentException("Key too long: "+key); throw new IllegalArgumentException("Key too long: "+key);
if (value.length() > MAX_VALUE_LENGTH) if (value.length() > MAX_VALUE_LENGTH)
throw new IllegalArgumentException("Value too long: "+value); throw new IllegalArgumentException("Value too long: "+value);
if (key.indexOf(CODE_POINT_U0000) != -1)
throw new IllegalArgumentException("Key contains code point U+0000");
if (value.indexOf(CODE_POINT_U0000) != -1)
throw new IllegalArgumentException("Value contains code point U+0000");
synchronized(lock) { synchronized(lock) {
if (removed) if (removed)
@ -275,10 +287,14 @@ public abstract class AbstractPreferences extends Preferences {
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if key is <tt>null</tt>. (A * @throws NullPointerException if key is <tt>null</tt>. (A
* <tt>null</tt> default <i>is</i> permitted.) * <tt>null</tt> default <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public String get(String key, String def) { public String get(String key, String def) {
if (key==null) if (key==null)
throw new NullPointerException("Null key"); throw new NullPointerException("Null key");
if (key.indexOf(CODE_POINT_U0000) != -1)
throw new IllegalArgumentException("Key contains code point U+0000");
synchronized(lock) { synchronized(lock) {
if (removed) if (removed)
throw new IllegalStateException("Node has been removed."); throw new IllegalStateException("Node has been removed.");
@ -306,10 +322,14 @@ public abstract class AbstractPreferences extends Preferences {
* @param key key whose mapping is to be removed from the preference node. * @param key key whose mapping is to be removed from the preference node.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @throws NullPointerException {@inheritDoc}. * @throws NullPointerException {@inheritDoc}.
*/ */
public void remove(String key) { public void remove(String key) {
Objects.requireNonNull(key, "Specified key cannot be null"); Objects.requireNonNull(key, "Specified key cannot be null");
if (key.indexOf(CODE_POINT_U0000) != -1)
throw new IllegalArgumentException("Key contains code point U+0000");
synchronized(lock) { synchronized(lock) {
if (removed) if (removed)
throw new IllegalStateException("Node has been removed."); throw new IllegalStateException("Node has been removed.");
@ -353,6 +373,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is <tt>null</tt>.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -381,6 +403,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public int getInt(String key, int def) { public int getInt(String key, int def) {
int result = def; int result = def;
@ -408,6 +432,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is <tt>null</tt>.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -436,6 +462,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public long getLong(String key, long def) { public long getLong(String key, long def) {
long result = def; long result = def;
@ -463,6 +491,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is <tt>null</tt>.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -494,6 +524,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public boolean getBoolean(String key, boolean def) { public boolean getBoolean(String key, boolean def) {
boolean result = def; boolean result = def;
@ -521,6 +553,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is <tt>null</tt>.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -549,6 +583,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public float getFloat(String key, float def) { public float getFloat(String key, float def) {
float result = def; float result = def;
@ -576,6 +612,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key is <tt>null</tt>. * @throws NullPointerException if key is <tt>null</tt>.
* @throws IllegalArgumentException if <tt>key.length()</tt> exceeds * @throws IllegalArgumentException if <tt>key.length()</tt> exceeds
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -604,6 +642,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public double getDouble(String key, double def) { public double getDouble(String key, double def) {
double result = def; double result = def;
@ -627,6 +667,8 @@ public abstract class AbstractPreferences extends Preferences {
* @throws NullPointerException if key or value is <tt>null</tt>. * @throws NullPointerException if key or value is <tt>null</tt>.
* @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH * @throws IllegalArgumentException if key.length() exceeds MAX_KEY_LENGTH
* or if value.length exceeds MAX_VALUE_LENGTH*3/4. * or if value.length exceeds MAX_VALUE_LENGTH*3/4.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
*/ */
@ -650,6 +692,8 @@ public abstract class AbstractPreferences extends Preferences {
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A
* <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.) * <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public byte[] getByteArray(String key, byte[] def) { public byte[] getByteArray(String key, byte[] def) {
byte[] result = def; byte[] result = def;

View File

@ -489,7 +489,7 @@ public abstract class Preferences {
* <tt>MAX_VALUE_LENGTH</tt>. * <tt>MAX_VALUE_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if either the key or the value contain * @throws IllegalArgumentException if either key or value contain
* the null control character, code point U+0000. * the null control character, code point U+0000.
*/ */
public abstract void put(String key, String value); public abstract void put(String key, String value);
@ -514,6 +514,8 @@ public abstract class Preferences {
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A
* <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.) * <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public abstract String get(String key, String def); public abstract String get(String key, String def);
@ -530,6 +532,8 @@ public abstract class Preferences {
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
*/ */
public abstract void remove(String key); public abstract void remove(String key);
@ -566,6 +570,8 @@ public abstract class Preferences {
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @see #getInt(String,int) * @see #getInt(String,int)
*/ */
public abstract void putInt(String key, int value); public abstract void putInt(String key, int value);
@ -597,6 +603,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @see #putInt(String,int) * @see #putInt(String,int)
* @see #get(String,String) * @see #get(String,String)
*/ */
@ -616,6 +624,8 @@ public abstract class Preferences {
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @see #getLong(String,long) * @see #getLong(String,long)
*/ */
public abstract void putLong(String key, long value); public abstract void putLong(String key, long value);
@ -647,6 +657,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @see #putLong(String,long) * @see #putLong(String,long)
* @see #get(String,String) * @see #get(String,String)
*/ */
@ -666,6 +678,8 @@ public abstract class Preferences {
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @see #getBoolean(String,boolean) * @see #getBoolean(String,boolean)
* @see #get(String,String) * @see #get(String,String)
*/ */
@ -702,6 +716,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @see #get(String,String) * @see #get(String,String)
* @see #putBoolean(String,boolean) * @see #putBoolean(String,boolean)
*/ */
@ -721,6 +737,8 @@ public abstract class Preferences {
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @see #getFloat(String,float) * @see #getFloat(String,float)
*/ */
public abstract void putFloat(String key, float value); public abstract void putFloat(String key, float value);
@ -751,6 +769,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @see #putFloat(String,float) * @see #putFloat(String,float)
* @see #get(String,String) * @see #get(String,String)
*/ */
@ -770,6 +790,8 @@ public abstract class Preferences {
* <tt>MAX_KEY_LENGTH</tt>. * <tt>MAX_KEY_LENGTH</tt>.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @see #getDouble(String,double) * @see #getDouble(String,double)
*/ */
public abstract void putDouble(String key, double value); public abstract void putDouble(String key, double value);
@ -800,6 +822,8 @@ public abstract class Preferences {
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>.
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @see #putDouble(String,double) * @see #putDouble(String,double)
* @see #get(String,String) * @see #get(String,String)
*/ */
@ -825,6 +849,8 @@ public abstract class Preferences {
* or if value.length exceeds MAX_VALUE_LENGTH*3/4. * or if value.length exceeds MAX_VALUE_LENGTH*3/4.
* @throws IllegalStateException if this node (or an ancestor) has been * @throws IllegalStateException if this node (or an ancestor) has been
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws IllegalArgumentException if key contains
* the null control character, code point U+0000.
* @see #getByteArray(String,byte[]) * @see #getByteArray(String,byte[])
* @see #get(String,String) * @see #get(String,String)
*/ */
@ -864,6 +890,8 @@ public abstract class Preferences {
* removed with the {@link #removeNode()} method. * removed with the {@link #removeNode()} method.
* @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A * @throws NullPointerException if <tt>key</tt> is <tt>null</tt>. (A
* <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.) * <tt>null</tt> value for <tt>def</tt> <i>is</i> permitted.)
* @throws IllegalArgumentException if key contains the null control
* character, code point U+0000.
* @see #get(String,String) * @see #get(String,String)
* @see #putByteArray(String,byte[]) * @see #putByteArray(String,byte[])
*/ */

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -49,13 +49,6 @@ import sun.util.logging.PlatformLogger;
*/ */
class FileSystemPreferences extends AbstractPreferences { class FileSystemPreferences extends AbstractPreferences {
/**
* The code point U+0000, assigned to the null control character, is the
* only character encoded in Unicode and ISO/IEC 10646 that is always
* invalid in any XML 1.0 and 1.1 document.
*/
private static final String CODE_POINT_U0000 = String.valueOf('\u0000');
static { static {
PrivilegedAction<Void> load = () -> { PrivilegedAction<Void> load = () -> {
System.loadLibrary("prefs"); System.loadLibrary("prefs");
@ -532,11 +525,6 @@ class FileSystemPreferences extends AbstractPreferences {
} }
protected void putSpi(String key, String value) { protected void putSpi(String key, String value) {
if (key.indexOf(CODE_POINT_U0000) != -1) {
throw new IllegalArgumentException("Key contains code point U+0000");
} else if (value.indexOf(CODE_POINT_U0000) != -1) {
throw new IllegalArgumentException("Value contains code point U+0000");
}
initCacheIfNecessary(); initCacheIfNecessary();
changeLog.add(new Put(key, value)); changeLog.add(new Put(key, value));
prefsCache.put(key, value); prefsCache.put(key, value);

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2002, 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,8 +25,6 @@
package java.util.prefs; package java.util.prefs;
import java.util.Map;
import java.util.TreeMap;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.security.AccessController; import java.security.AccessController;
@ -46,7 +44,7 @@ import sun.util.logging.PlatformLogger;
* @since 1.4 * @since 1.4
*/ */
class WindowsPreferences extends AbstractPreferences{ class WindowsPreferences extends AbstractPreferences {
static { static {
PrivilegedAction<Void> load = () -> { PrivilegedAction<Void> load = () -> {
@ -620,22 +618,22 @@ class WindowsPreferences extends AbstractPreferences{
* @see #getSpi(String) * @see #getSpi(String)
*/ */
protected void putSpi(String javaName, String value) { protected void putSpi(String javaName, String value) {
int nativeHandle = openKey(KEY_SET_VALUE); int nativeHandle = openKey(KEY_SET_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) { if (nativeHandle == NULL_NATIVE_HANDLE) {
isBackingStoreAvailable = false; isBackingStoreAvailable = false;
return; return;
}
int result = WindowsRegSetValueEx1(nativeHandle,
toWindowsName(javaName), toWindowsValueString(value));
if (result != ERROR_SUCCESS) {
logger().warning("Could not assign value to key " +
byteArrayToString(toWindowsName(javaName))+ " at Windows registry node "
+ byteArrayToString(windowsAbsolutePath()) + " at root 0x"
+ Integer.toHexString(rootNativeHandle()) +
". Windows RegSetValueEx(...) returned error code " + result + ".");
isBackingStoreAvailable = false;
} }
closeKey(nativeHandle); int result = WindowsRegSetValueEx1(nativeHandle,
toWindowsName(javaName), toWindowsValueString(value));
if (result != ERROR_SUCCESS) {
logger().warning("Could not assign value to key " +
byteArrayToString(toWindowsName(javaName))+ " at Windows registry node "
+ byteArrayToString(windowsAbsolutePath()) + " at root 0x"
+ Integer.toHexString(rootNativeHandle()) +
". Windows RegSetValueEx(...) returned error code " + result + ".");
isBackingStoreAvailable = false;
}
closeKey(nativeHandle);
} }
/** /**
@ -645,18 +643,18 @@ class WindowsPreferences extends AbstractPreferences{
* @see #putSpi(String, String) * @see #putSpi(String, String)
*/ */
protected String getSpi(String javaName) { protected String getSpi(String javaName) {
int nativeHandle = openKey(KEY_QUERY_VALUE); int nativeHandle = openKey(KEY_QUERY_VALUE);
if (nativeHandle == NULL_NATIVE_HANDLE) { if (nativeHandle == NULL_NATIVE_HANDLE) {
return null; return null;
} }
Object resultObject = WindowsRegQueryValueEx(nativeHandle, Object resultObject = WindowsRegQueryValueEx(nativeHandle,
toWindowsName(javaName)); toWindowsName(javaName));
if (resultObject == null) { if (resultObject == null) {
closeKey(nativeHandle);
return null;
}
closeKey(nativeHandle); closeKey(nativeHandle);
return null; return toJavaValueString((byte[]) resultObject);
}
closeKey(nativeHandle);
return toJavaValueString((byte[]) resultObject);
} }
/** /**

View File

@ -46,27 +46,23 @@ The API is defined by classes in the package
<a href="CommandAPDU.html">CommandAPDU</a>, <a href="CommandAPDU.html">CommandAPDU</a>,
<a href="ResponseAPDU.html">ResponseAPDU</a> <a href="ResponseAPDU.html">ResponseAPDU</a>
<p>
<dt>Factory to obtain implementations <dt>Factory to obtain implementations
<dd> <dd>
<a href="TerminalFactory.html">TerminalFactory</a> <a href="TerminalFactory.html">TerminalFactory</a>
<p>
<dt>Main classes for card and terminal functions <dt>Main classes for card and terminal functions
<dd> <dd>
<a href="CardTerminals.html">CardTerminals</a>, <a href="CardTerminals.html">CardTerminals</a>,
<a href="CardTerminal.html">CardTerminal</a>, <a href="CardTerminal.html">CardTerminal</a>,
<a href="Card.html">Card</a>, <a href="Card.html">Card</a>,
<a href="CardChannel.html">CardChannel</a> <a href="CardChannel.html">CardChannel</a>
<p>
<dt>Supporting permission and exception classes <dt>Supporting permission and exception classes
<dd> <dd>
<a href="CardPermission.html">CardPermission</a>, <a href="CardPermission.html">CardPermission</a>,
<a href="CardException.html">CardException</a>, <a href="CardException.html">CardException</a>,
<a href="CardNotPresentException.html">CardNotPresentException</a> <a href="CardNotPresentException.html">CardNotPresentException</a>
<p>
<dt>Service provider interface, not accessed directly by applications <dt>Service provider interface, not accessed directly by applications
<dd> <dd>
<a href="TerminalFactorySpi.html">TerminalFactorySpi</a> <a href="TerminalFactorySpi.html">TerminalFactorySpi</a>
@ -94,7 +90,6 @@ A simple example of using the API is:
card.disconnect(false); card.disconnect(false);
</pre> </pre>
<P>
@since 1.6 @since 1.6
@author Andreas Sterbenz @author Andreas Sterbenz
@author JSR 268 Expert Group @author JSR 268 Expert Group

View File

@ -29,15 +29,15 @@ package com.sun.tools.attach;
* The exception thrown when an agent fails to initialize in the target * The exception thrown when an agent fails to initialize in the target
* Java virtual machine. * Java virtual machine.
* *
* <p> This exception is thrown by {@link * <p> This exception is thrown by
* com.sun.tools.attach.VirtualMachine#loadAgent VirtualMachine.loadAgent}, * {@link com.sun.tools.attach.VirtualMachine#loadAgent VirtualMachine.loadAgent},
* {@link com.sun.tools.attach.VirtualMachine#loadAgentLibrary * {@link com.sun.tools.attach.VirtualMachine#loadAgentLibrary
* VirtualMachine.loadAgentLibrary}, {@link * VirtualMachine.loadAgentLibrary},
* com.sun.tools.attach.VirtualMachine#loadAgentPath VirtualMachine.loadAgentPath} * {@link com.sun.tools.attach.VirtualMachine#loadAgentPath VirtualMachine.loadAgentPath}
* methods if an agent, or agent library, cannot be initialized. * methods if an agent, or agent library, cannot be initialized.
* When thrown by <tt>VirtualMachine.loadAgentLibrary</tt>, or * When thrown by {@code VirtualMachine.loadAgentLibrary}, or
* <tt>VirtualMachine.loadAgentPath</tt> then the exception encapsulates * {@code VirtualMachine.loadAgentPath} then the exception encapsulates
* the error returned by the agent's <code>Agent_OnAttach</code> function. * the error returned by the agent's {@code Agent_OnAttach} function.
* This error code can be obtained by invoking the {@link #returnValue() returnValue} method. * This error code can be obtained by invoking the {@link #returnValue() returnValue} method.
*/ */
@jdk.Exported @jdk.Exported
@ -49,7 +49,7 @@ public class AgentInitializationException extends Exception {
private int returnValue; private int returnValue;
/** /**
* Constructs an <code>AgentInitializationException</code> with * Constructs an {@code AgentInitializationException} with
* no detail message. * no detail message.
*/ */
public AgentInitializationException() { public AgentInitializationException() {
@ -58,7 +58,7 @@ public class AgentInitializationException extends Exception {
} }
/** /**
* Constructs an <code>AgentInitializationException</code> with * Constructs an {@code AgentInitializationException} with
* the specified detail message. * the specified detail message.
* *
* @param s the detail message. * @param s the detail message.
@ -69,9 +69,9 @@ public class AgentInitializationException extends Exception {
} }
/** /**
* Constructs an <code>AgentInitializationException</code> with * Constructs an {@code AgentInitializationException} with
* the specified detail message and the return value from the * the specified detail message and the return value from the
* execution of the agent's <code>Agent_OnAttach</code> function. * execution of the agent's {@code Agent_OnAttach} function.
* *
* @param s the detail message. * @param s the detail message.
* @param returnValue the return value * @param returnValue the return value
@ -83,8 +83,8 @@ public class AgentInitializationException extends Exception {
/** /**
* If the exception was created with the return value from the agent * If the exception was created with the return value from the agent
* <code>Agent_OnAttach</code> function then this returns that value, * {@code Agent_OnAttach} function then this returns that value,
* otherwise returns <code>0</code>. </p> * otherwise returns {@code 0}.
* *
* @return the return value * @return the return value
*/ */

View File

@ -41,7 +41,7 @@ import java.util.ServiceLoader;
* *
* <p> An attach provider is a concrete subclass of this class that has a * <p> An attach provider is a concrete subclass of this class that has a
* zero-argument constructor and implements the abstract methods specified * zero-argument constructor and implements the abstract methods specified
* below. </p> * below.
* *
* <p> An attach provider implementation is typically tied to a Java virtual * <p> An attach provider implementation is typically tied to a Java virtual
* machine implementation, version, or even mode of operation. That is, a specific * machine implementation, version, or even mode of operation. That is, a specific
@ -51,7 +51,7 @@ import java.util.ServiceLoader;
* Sun's <i>HotSpot</i> virtual machine. In general, if an environment * Sun's <i>HotSpot</i> virtual machine. In general, if an environment
* consists of Java virtual machines of different versions and from different * consists of Java virtual machines of different versions and from different
* vendors then there will be an attach provider implementation for each * vendors then there will be an attach provider implementation for each
* <i>family</i> of implementations or versions. </p> * <i>family</i> of implementations or versions.
* *
* <p> An attach provider is identified by its {@link #name <i>name</i>} and * <p> An attach provider is identified by its {@link #name <i>name</i>} and
* {@link #type <i>type</i>}. The <i>name</i> is typically, but not required to * {@link #type <i>type</i>}. The <i>name</i> is typically, but not required to
@ -61,15 +61,15 @@ import java.util.ServiceLoader;
* implementation that uses the Doors inter-process communication mechanism * implementation that uses the Doors inter-process communication mechanism
* might use the type <i>"doors"</i>. The purpose of the name and type is to * might use the type <i>"doors"</i>. The purpose of the name and type is to
* identify providers in environments where there are multiple providers * identify providers in environments where there are multiple providers
* installed. </p> * installed.
* *
* <p> AttachProvider implementations are loaded and instantiated at the first * <p> AttachProvider implementations are loaded and instantiated at the first
* invocation of the {@link #providers() providers} method. This method * invocation of the {@link #providers() providers} method. This method
* attempts to load all provider implementations that are installed on the * attempts to load all provider implementations that are installed on the
* platform. </p> * platform.
* *
* <p> All of the methods in this class are safe for use by multiple * <p> All of the methods in this class are safe for use by multiple
* concurrent threads. </p> * concurrent threads.
* *
* @since 1.6 * @since 1.6
*/ */
@ -81,12 +81,12 @@ public abstract class AttachProvider {
private static List<AttachProvider> providers = null; private static List<AttachProvider> providers = null;
/** /**
* Initializes a new instance of this class. </p> * Initializes a new instance of this class.
* *
* @throws SecurityException * @throws SecurityException
* If a security manager has been installed and it denies * If a security manager has been installed and it denies
* {@link com.sun.tools.attach.AttachPermission AttachPermission} * {@link com.sun.tools.attach.AttachPermission AttachPermission}
* <tt>("createAttachProvider")</tt> * ("{@code createAttachProvider}")
*/ */
protected AttachProvider() { protected AttachProvider() {
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
@ -95,14 +95,14 @@ public abstract class AttachProvider {
} }
/** /**
* Return this provider's name. </p> * Return this provider's name.
* *
* @return The name of this provider * @return The name of this provider
*/ */
public abstract String name(); public abstract String name();
/** /**
* Return this provider's type. </p> * Return this provider's type.
* *
* @return The type of this provider * @return The type of this provider
*/ */
@ -113,18 +113,18 @@ public abstract class AttachProvider {
* *
* <p> A Java virtual machine is identified by an abstract identifier. The * <p> A Java virtual machine is identified by an abstract identifier. The
* nature of this identifier is platform dependent but in many cases it will be the * nature of this identifier is platform dependent but in many cases it will be the
* string representation of the process identifier (or pid). </p> * string representation of the process identifier (or pid).
* *
* <p> This method parses the identifier and maps the identifier to a Java * <p> This method parses the identifier and maps the identifier to a Java
* virtual machine (in an implementation dependent manner). If the identifier * virtual machine (in an implementation dependent manner). If the identifier
* cannot be parsed by the provider then an {@link * cannot be parsed by the provider then an
* com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException} * {@link com.sun.tools.attach.AttachNotSupportedException AttachNotSupportedException}
* is thrown. Once parsed this method attempts to attach to the Java virtual machine. * is thrown. Once parsed this method attempts to attach to the Java virtual machine.
* If the provider detects that the identifier corresponds to a Java virtual machine * If the provider detects that the identifier corresponds to a Java virtual machine
* that does not exist, or it corresponds to a Java virtual machine that does not support * that does not exist, or it corresponds to a Java virtual machine that does not support
* the attach mechanism implemented by this provider, or it detects that the * the attach mechanism implemented by this provider, or it detects that the
* Java virtual machine is a version to which this provider cannot attach, then * Java virtual machine is a version to which this provider cannot attach, then
* an <code>AttachNotSupportedException</code> is thrown. </p> * an {@code AttachNotSupportedException} is thrown.
* *
* @param id * @param id
* The abstract identifier that identifies the Java virtual machine. * The abstract identifier that identifies the Java virtual machine.
@ -134,7 +134,7 @@ public abstract class AttachProvider {
* @throws SecurityException * @throws SecurityException
* If a security manager has been installed and it denies * If a security manager has been installed and it denies
* {@link com.sun.tools.attach.AttachPermission AttachPermission} * {@link com.sun.tools.attach.AttachPermission AttachPermission}
* <tt>("attachVirtualMachine")</tt>, or other permission * ("{@code attachVirtualMachine}"), or other permission
* required by the implementation. * required by the implementation.
* *
* @throws AttachNotSupportedException * @throws AttachNotSupportedException
@ -147,7 +147,7 @@ public abstract class AttachProvider {
* If some other I/O error occurs * If some other I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>id</code> is <code>null</code> * If {@code id} is {@code null}
*/ */
public abstract VirtualMachine attachVirtualMachine(String id) public abstract VirtualMachine attachVirtualMachine(String id)
throws AttachNotSupportedException, IOException; throws AttachNotSupportedException, IOException;
@ -155,10 +155,10 @@ public abstract class AttachProvider {
/** /**
* Attaches to a Java virtual machine. * Attaches to a Java virtual machine.
* *
* <p> A Java virtual machine can be described using a {@link * <p> A Java virtual machine can be described using a
* com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor}. * {@link com.sun.tools.attach.VirtualMachineDescriptor VirtualMachineDescriptor}.
* This method invokes the descriptor's {@link * This method invokes the descriptor's
* com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method * {@link com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method
* to check that it is equal to this provider. It then attempts to attach to the * to check that it is equal to this provider. It then attempts to attach to the
* Java virtual machine. * Java virtual machine.
* *
@ -170,20 +170,20 @@ public abstract class AttachProvider {
* @throws SecurityException * @throws SecurityException
* If a security manager has been installed and it denies * If a security manager has been installed and it denies
* {@link com.sun.tools.attach.AttachPermission AttachPermission} * {@link com.sun.tools.attach.AttachPermission AttachPermission}
* <tt>("attachVirtualMachine")</tt>, or other permission * ("{@code attachVirtualMachine}"), or other permission
* required by the implementation. * required by the implementation.
* *
* @throws AttachNotSupportedException * @throws AttachNotSupportedException
* If the descriptor's {@link * If the descriptor's
* com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()} method * {@link com.sun.tools.attach.VirtualMachineDescriptor#provider() provider()}
* returns a provider that is not this provider, or it does not correspond * method returns a provider that is not this provider, or it does not
* to a Java virtual machine to which this provider can attach. * correspond to a Java virtual machine to which this provider can attach.
* *
* @throws IOException * @throws IOException
* If some other I/O error occurs * If some other I/O error occurs
* *
* @throws NullPointerException * @throws NullPointerException
* If <code>vmd</code> is <code>null</code> * If {@code vmd} is {@code null}
*/ */
public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd) public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd)
throws AttachNotSupportedException, IOException throws AttachNotSupportedException, IOException
@ -197,12 +197,13 @@ public abstract class AttachProvider {
/** /**
* Lists the Java virtual machines known to this provider. * Lists the Java virtual machines known to this provider.
* *
* <p> This method returns a list of {@link * <p> This method returns a list of
* com.sun.tools.attach.VirtualMachineDescriptor} elements. Each * {@link com.sun.tools.attach.VirtualMachineDescriptor} elements. Each
* <code>VirtualMachineDescriptor</code> describes a Java virtual machine * {@code VirtualMachineDescriptor} describes a Java virtual machine
* to which this provider can <i>potentially</i> attach. There isn't any * to which this provider can <i>potentially</i> attach. There isn't any
* guarantee that invoking {@link #attachVirtualMachine(VirtualMachineDescriptor) * guarantee that invoking
* attachVirtualMachine} on each descriptor in the list will succeed. * {@link #attachVirtualMachine(VirtualMachineDescriptor) attachVirtualMachine}
* on each descriptor in the list will succeed.
* *
* @return The list of virtual machine descriptors which describe the * @return The list of virtual machine descriptors which describe the
* Java virtual machines known to this provider (may be empty). * Java virtual machines known to this provider (may be empty).
@ -216,31 +217,31 @@ public abstract class AttachProvider {
* <p> An AttachProvider is installed on the platform if: * <p> An AttachProvider is installed on the platform if:
* *
* <ul> * <ul>
* <li><p>It is installed in a JAR file that is visible to the defining * <li>It is installed in a JAR file that is visible to the defining
* class loader of the AttachProvider type (usually, but not required * class loader of the AttachProvider type (usually, but not required
* to be, the {@link java.lang.ClassLoader#getSystemClassLoader system * to be, the {@link java.lang.ClassLoader#getSystemClassLoader system
* class loader}).</p></li> * class loader}).</li>
* *
* <li><p>The JAR file contains a provider configuration named * <li>The JAR file contains a provider configuration named
* <tt>com.sun.tools.attach.spi.AttachProvider</tt> in the resource directory * {@code com.sun.tools.attach.spi.AttachProvider} in the resource directory
* <tt>META-INF/services</tt>. </p></li> * {@code META-INF/services}.</li>
* *
* <li><p>The provider configuration file lists the full-qualified class * <li>The provider configuration file lists the full-qualified class
* name of the AttachProvider implementation. </p></li> * name of the AttachProvider implementation.</li>
* </ul> * </ul>
* *
* <p> The format of the provider configuration file is one fully-qualified * <p> The format of the provider configuration file is one fully-qualified
* class name per line. Space and tab characters surrounding each class name, * class name per line. Space and tab characters surrounding each class name,
* as well as blank lines are ignored. The comment character is * as well as blank lines are ignored. The comment character is
* <tt>'#'</tt> (<tt>0x23</tt>), and on each line all characters following * {@code '#'} ({@code 0x23}), and on each line all characters following
* the first comment character are ignored. The file must be encoded in * the first comment character are ignored. The file must be encoded in
* UTF-8. </p> * UTF-8.
* *
* <p> AttachProvider implementations are loaded and instantiated * <p> AttachProvider implementations are loaded and instantiated
* (using the zero-arg constructor) at the first invocation of this method. * (using the zero-arg constructor) at the first invocation of this method.
* The list returned by the first invocation of this method is the list * The list returned by the first invocation of this method is the list
* of providers. Subsequent invocations of this method return a list of the same * of providers. Subsequent invocations of this method return a list of the same
* providers. The list is unmodifable.</p> * providers. The list is unmodifable.
* *
* @return A list of the installed attach providers. * @return A list of the installed attach providers.
*/ */

View File

@ -72,7 +72,7 @@ public abstract class Filter {
* exchange handler will not be invoked. * exchange handler will not be invoked.
* @param exchange the HttpExchange * @param exchange the HttpExchange
* @throws IOException let exceptions pass up the stack * @throws IOException let exceptions pass up the stack
* @throws NullPointerException if exchange is <code>null</code> * @throws NullPointerException if exchange is {@code null}
*/ */
public void doFilter (HttpExchange exchange) throws IOException { public void doFilter (HttpExchange exchange) throws IOException {
if (!iter.hasNext()) { if (!iter.hasNext()) {
@ -86,14 +86,14 @@ public abstract class Filter {
/** /**
* Asks this filter to pre/post-process the given exchange. The filter * Asks this filter to pre/post-process the given exchange. The filter
* can :- * can:
* <ul><li>examine or modify the request headers</li> * <ul><li>examine or modify the request headers</li>
* <li>filter the request body or the response body, by creating suitable * <li>filter the request body or the response body, by creating suitable
* filter streams and calling * filter streams and calling
* {@link HttpExchange#setStreams(InputStream,OutputStream)}</li> * {@link HttpExchange#setStreams(InputStream,OutputStream)}</li>
* <li>set attribute Objects in the exchange, which other filters or the * <li>set attribute Objects in the exchange, which other filters or the
* exchange handler can access.</li> * exchange handler can access.</li>
* <li>decide to either :-<ol> * <li>decide to either<ol>
* <li>invoke the next filter in the chain, by calling * <li>invoke the next filter in the chain, by calling
* {@link Filter.Chain#doFilter(HttpExchange)}</li> * {@link Filter.Chain#doFilter(HttpExchange)}</li>
* <li>terminate the chain of invocation, by <b>not</b> calling * <li>terminate the chain of invocation, by <b>not</b> calling
@ -102,12 +102,13 @@ public abstract class Filter {
* filters in the Chain have been called, and the response headers can be * filters in the Chain have been called, and the response headers can be
* examined or modified.</li> * examined or modified.</li>
* <li>if option 2. above taken, then this Filter must use the HttpExchange * <li>if option 2. above taken, then this Filter must use the HttpExchange
* to send back an appropriate response</li></ul><p> * to send back an appropriate response</li></ul>
* @param exchange the <code>HttpExchange</code> to be filtered. *
* @param exchange the {@code HttpExchange} to be filtered.
* @param chain the Chain which allows the next filter to be invoked. * @param chain the Chain which allows the next filter to be invoked.
* @throws IOException may be thrown by any filter module, and if * @throws IOException may be thrown by any filter module, and if
* caught, must be rethrown again. * caught, must be rethrown again.
* @throws NullPointerException if either exchange or chain are <code>null</code> * @throws NullPointerException if either exchange or chain are {@code null}
*/ */
public abstract void doFilter (HttpExchange exchange, Chain chain) public abstract void doFilter (HttpExchange exchange, Chain chain)
throws IOException; throws IOException;

View File

@ -29,18 +29,21 @@ import java.util.*;
/** /**
* HTTP request and response headers are represented by this class which implements * HTTP request and response headers are represented by this class which implements
* the interface {@link java.util.Map}&lt; * the interface
* {@link java.lang.String},{@link java.util.List}&lt;{@link java.lang.String}&gt;&gt;. * {@link java.util.Map}{@literal <}{@link java.lang.String}, {@link java.util.List}
* {@literal <}{@link java.lang.String}{@literal >>}.
* The keys are case-insensitive Strings representing the header names and * The keys are case-insensitive Strings representing the header names and
* the value associated with each key is a {@link List}&lt;{@link String}&gt; with one * the value associated with each key is
* a {@link List}{@literal <}{@link String}{@literal >} with one
* element for each occurrence of the header name in the request or response. * element for each occurrence of the header name in the request or response.
* <p> * <p>
* For example, if a response header instance contains one key "HeaderName" with two values "value1 and value2" * For example, if a response header instance contains
* one key "HeaderName" with two values "value1 and value2"
* then this object is output as two header lines: * then this object is output as two header lines:
* <blockquote><pre> * <blockquote><pre>
* HeaderName: value1 * HeaderName: value1
* HeaderName: value2 * HeaderName: value2
* </blockquote></pre> * </pre></blockquote>
* <p> * <p>
* All the normal {@link java.util.Map} methods are provided, but the following * All the normal {@link java.util.Map} methods are provided, but the following
* additional convenience methods are most likely to be used: * additional convenience methods are most likely to be used:

View File

@ -116,9 +116,9 @@ public abstract class HttpExchange {
public abstract HttpContext getHttpContext (); public abstract HttpContext getHttpContext ();
/** /**
* Ends this exchange by doing the following in sequence:<p><ol> * Ends this exchange by doing the following in sequence:<ol>
* <li>close the request InputStream, if not already closed<p></li> * <li>close the request InputStream, if not already closed;</li>
* <li>close the response OutputStream, if not already closed. </li> * <li>close the response OutputStream, if not already closed.</li>
* </ol> * </ol>
*/ */
public abstract void close () ; public abstract void close () ;
@ -163,9 +163,9 @@ public abstract class HttpExchange {
* and the numeric response code as specified in this method. The response body length is also specified * and the numeric response code as specified in this method. The response body length is also specified
* as follows. If the response length parameter is greater than zero, this specifies an exact * as follows. If the response length parameter is greater than zero, this specifies an exact
* number of bytes to send and the application must send that exact amount of data. * number of bytes to send and the application must send that exact amount of data.
* If the response length parameter is <code>zero</code>, then chunked transfer encoding is * If the response length parameter is {@code zero}, then chunked transfer encoding is
* used and an arbitrary amount of data may be sent. The application terminates the * used and an arbitrary amount of data may be sent. The application terminates the
* response body by closing the OutputStream. If response length has the value <code>-1</code> * response body by closing the OutputStream. If response length has the value {@code -1}
* then no response body is being sent. * then no response body is being sent.
* <p> * <p>
* If the content-length response header has not already been set then * If the content-length response header has not already been set then
@ -192,7 +192,7 @@ public abstract class HttpExchange {
/** /**
* Returns the response code, if it has already been set * Returns the response code, if it has already been set
* @return the response code, if available. <code>-1</code> if not available yet. * @return the response code, if available. {@code -1} if not available yet.
*/ */
public abstract int getResponseCode (); public abstract int getResponseCode ();
@ -219,7 +219,7 @@ public abstract class HttpExchange {
* available. * available.
* @param name the name of the attribute to retrieve * @param name the name of the attribute to retrieve
* @return the attribute object, or null if it does not exist * @return the attribute object, or null if it does not exist
* @throws NullPointerException if name is <code>null</code> * @throws NullPointerException if name is {@code null}
*/ */
public abstract Object getAttribute (String name) ; public abstract Object getAttribute (String name) ;
@ -231,9 +231,9 @@ public abstract class HttpExchange {
* Each Filter class will document the attributes which they make * Each Filter class will document the attributes which they make
* available. * available.
* @param name the name to associate with the attribute value * @param name the name to associate with the attribute value
* @param value the object to store as the attribute value. <code>null</code> * @param value the object to store as the attribute value. {@code null}
* value is permitted. * value is permitted.
* @throws NullPointerException if name is <code>null</code> * @throws NullPointerException if name is {@code null}
*/ */
public abstract void setAttribute (String name, Object value) ; public abstract void setAttribute (String name, Object value) ;
@ -248,9 +248,9 @@ public abstract class HttpExchange {
* required to be) sub-classes of {@link java.io.FilterInputStream} * required to be) sub-classes of {@link java.io.FilterInputStream}
* and {@link java.io.FilterOutputStream}. * and {@link java.io.FilterOutputStream}.
* @param i the filtered input stream to set as this object's inputstream, * @param i the filtered input stream to set as this object's inputstream,
* or <code>null</code> if no change. * or {@code null} if no change.
* @param o the filtered output stream to set as this object's outputstream, * @param o the filtered output stream to set as this object's outputstream,
* or <code>null</code> if no change. * or {@code null} if no change.
*/ */
public abstract void setStreams (InputStream i, OutputStream o); public abstract void setStreams (InputStream i, OutputStream o);
@ -259,7 +259,7 @@ public abstract class HttpExchange {
* If an authenticator is set on the HttpContext that owns this exchange, * If an authenticator is set on the HttpContext that owns this exchange,
* then this method will return the {@link HttpPrincipal} that represents * then this method will return the {@link HttpPrincipal} that represents
* the authenticated user for this HttpExchange. * the authenticated user for this HttpExchange.
* @return the HttpPrincipal, or <code>null</code> if no authenticator is set. * @return the HttpPrincipal, or {@code null} if no authenticator is set.
*/ */
public abstract HttpPrincipal getPrincipal (); public abstract HttpPrincipal getPrincipal ();
} }

View File

@ -58,8 +58,8 @@ import com.sun.net.httpserver.spi.HttpServerProvider;
* whose path is the longest matching prefix of the request URI's path. * whose path is the longest matching prefix of the request URI's path.
* Paths are matched literally, which means that the strings are compared * Paths are matched literally, which means that the strings are compared
* case sensitively, and with no conversion to or from any encoded forms. * case sensitively, and with no conversion to or from any encoded forms.
* For example. Given a HttpServer with the following HttpContexts configured.<p> * For example. Given a HttpServer with the following HttpContexts configured.
* <table > * <table>
* <tr><td><i>Context</i></td><td><i>Context path</i></td></tr> * <tr><td><i>Context</i></td><td><i>Context path</i></td></tr>
* <tr><td>ctx1</td><td>"/"</td></tr> * <tr><td>ctx1</td><td>"/"</td></tr>
* <tr><td>ctx2</td><td>"/apps/"</td></tr> * <tr><td>ctx2</td><td>"/apps/"</td></tr>
@ -67,7 +67,7 @@ import com.sun.net.httpserver.spi.HttpServerProvider;
* </table> * </table>
* <p> * <p>
* the following table shows some request URIs and which, if any context they would * the following table shows some request URIs and which, if any context they would
* match with.<p> * match with.
* <table> * <table>
* <tr><td><i>Request URI</i></td><td><i>Matches context</i></td></tr> * <tr><td><i>Request URI</i></td><td><i>Matches context</i></td></tr>
* <tr><td>"http://foo.com/apps/foo/bar"</td><td>ctx3</td></tr> * <tr><td>"http://foo.com/apps/foo/bar"</td><td>ctx3</td></tr>
@ -181,7 +181,7 @@ public abstract class HttpServer {
* approximately <i>delay</i> seconds have elapsed (whichever happens * approximately <i>delay</i> seconds have elapsed (whichever happens
* sooner). Then, all open TCP connections are closed, the background * sooner). Then, all open TCP connections are closed, the background
* thread created by start() exits, and the method returns. * thread created by start() exits, and the method returns.
* Once stopped, a HttpServer cannot be re-used. <p> * Once stopped, a HttpServer cannot be re-used.
* *
* @param delay the maximum time in seconds to wait until exchanges have finished. * @param delay the maximum time in seconds to wait until exchanges have finished.
* @throws IllegalArgumentException if delay is less than zero. * @throws IllegalArgumentException if delay is less than zero.

View File

@ -42,8 +42,8 @@ import javax.net.ssl.*;
* the default configuration. * the default configuration.
* <p> * <p>
* The following <a name="example">example</a> shows how this may be done: * The following <a name="example">example</a> shows how this may be done:
* <p> *
* <pre><blockquote> * <blockquote><pre>
* SSLContext sslContext = SSLContext.getInstance (....); * SSLContext sslContext = SSLContext.getInstance (....);
* HttpsServer server = HttpsServer.create(); * HttpsServer server = HttpsServer.create();
* *
@ -64,7 +64,7 @@ import javax.net.ssl.*;
* params.setSSLParameters(sslparams); * params.setSSLParameters(sslparams);
* } * }
* }); * });
* </blockquote></pre> * </pre></blockquote>
* @since 1.6 * @since 1.6
*/ */
@jdk.Exported @jdk.Exported
@ -102,7 +102,7 @@ public class HttpsConfigurator {
* <p> * <p>
* The default implementation of this method uses the * The default implementation of this method uses the
* SSLParameters returned from <p> * SSLParameters returned from <p>
* <code>getSSLContext().getDefaultSSLParameters()</code> * {@code getSSLContext().getDefaultSSLParameters()}
* <p> * <p>
* configure() may be overridden in order to modify this behavior. * configure() may be overridden in order to modify this behavior.
* See, the example <a href="#example">above</a>. * See, the example <a href="#example">above</a>.

View File

@ -58,7 +58,7 @@
server.createContext("/applications/myapp", new MyHandler()); server.createContext("/applications/myapp", new MyHandler());
server.setExecutor(null); // creates a default executor server.setExecutor(null); // creates a default executor
server.start(); server.start();
</blockquote></pre> </pre></blockquote>
<p>The example above creates a simple HttpServer which uses the calling <p>The example above creates a simple HttpServer which uses the calling
application thread to invoke the handle() method for incoming http application thread to invoke the handle() method for incoming http
requests directed to port 8000, and to the path /applications/myapp/. requests directed to port 8000, and to the path /applications/myapp/.
@ -92,7 +92,7 @@
SSLContext ssl = SSLContext.getInstance("TLS"); SSLContext ssl = SSLContext.getInstance("TLS");
ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); ssl.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
</blockquote></pre> </pre></blockquote>
<p> <p>
In the example above, a keystore file called "testkeys", created with the keytool utility In the example above, a keystore file called "testkeys", created with the keytool utility
is used as a certificate store for client and server certificates. is used as a certificate store for client and server certificates.
@ -119,8 +119,8 @@
} }
}); });
</blockquote></pre> </pre></blockquote>
<p>
@since 1.6 @since 1.6
*/ */
@jdk.Exported @jdk.Exported

View File

@ -43,13 +43,12 @@ public class Bootstrap extends Object {
* <p> May throw an unspecified error if initialization of the * <p> May throw an unspecified error if initialization of the
* {@link com.sun.jdi.VirtualMachineManager} fails or if * {@link com.sun.jdi.VirtualMachineManager} fails or if
* the virtual machine manager is unable to locate or create * the virtual machine manager is unable to locate or create
* any {@link com.sun.jdi.connect.Connector Connectors}. </p> * any {@link com.sun.jdi.connect.Connector Connectors}.
* <p> *
* @throws java.lang.SecurityException if a security manager has been * @throws java.lang.SecurityException if a security manager has been
* installed and it denies {@link JDIPermission} * installed and it denies {@link JDIPermission}
* <tt>("virtualMachineManager")</tt> or other unspecified * ("{@code virtualMachineManager}") or other unspecified
* permissions required by the implementation. * permissions required by the implementation.
* </p>
*/ */
static public synchronized VirtualMachineManager virtualMachineManager() { static public synchronized VirtualMachineManager virtualMachineManager() {
return com.sun.tools.jdi.VirtualMachineManagerImpl.virtualMachineManager(); return com.sun.tools.jdi.VirtualMachineManagerImpl.virtualMachineManager();

View File

@ -65,22 +65,22 @@ public interface Field extends TypeComponent, Comparable<Field> {
* short s; * short s;
* Date d; * Date d;
* byte[] ba;</PRE> * byte[] ba;</PRE>
* And the JDI client defines these <CODE>Field</CODE> objects: * And the JDI client defines these {@code Field} objects:
* <PRE> * <PRE>
* Field sField = targetClass.fieldByName("s"); * Field sField = targetClass.fieldByName("s");
* Field dField = targetClass.fieldByName("d"); * Field dField = targetClass.fieldByName("d");
* Field baField = targetClass.fieldByName("ba");</PRE> * Field baField = targetClass.fieldByName("ba");</PRE>
* to mirror the corresponding fields, then <CODE>sField.type()</CODE> * to mirror the corresponding fields, then {@code sField.type()}
* is a {@link ShortType}, <CODE>dField.type()</CODE> is the * is a {@link ShortType}, {@code dField.type()} is the
* {@link ReferenceType} for <CODE>java.util.Date</CODE> and * {@link ReferenceType} for {@code java.util.Date} and
* <CODE>((ArrayType)(baField.type())).componentType()</CODE> is a * {@code ((ArrayType)(baField.type())).componentType()} is a
* {@link ByteType}. * {@link ByteType}.
* <P> * <P>
* Note: if the type of this field is a reference type (class, * Note: if the type of this field is a reference type (class,
* interface, or array) and it has not been created or loaded * interface, or array) and it has not been created or loaded
* by the declaring type's class loader - that is, * by the declaring type's class loader - that is,
* {@link TypeComponent#declaringType <CODE>declaringType()</CODE>} * {@link TypeComponent#declaringType declaringType()}
* <CODE>.classLoader()</CODE>, * {@code .classLoader()},
* then ClassNotLoadedException will be thrown. * then ClassNotLoadedException will be thrown.
* Also, a reference type may have been loaded but not yet prepared, * Also, a reference type may have been loaded but not yet prepared,
* in which case the type will be returned * in which case the type will be returned
@ -100,28 +100,28 @@ public interface Field extends TypeComponent, Comparable<Field> {
/** /**
* Determine if this is a transient field. * Determine if this is a transient field.
* *
* @return <code>true</code> if this field is transient; false otherwise. * @return {@code true} if this field is transient; {@code false} otherwise.
*/ */
boolean isTransient(); boolean isTransient();
/** /**
* Determine if this is a volatile field. * Determine if this is a volatile field.
* *
* @return <code>true</code> if this field is volatile; false otherwise. * @return {@code true} if this field is volatile; {@code false} otherwise.
*/ */
boolean isVolatile(); boolean isVolatile();
/** /**
* Determine if this is a field that represents an enum constant. * Determine if this is a field that represents an enum constant.
* @return <code>true</code> if this field represents an enum constant; * @return {@code true} if this field represents an enum constant;
* false otherwise. * {@code false} otherwise.
*/ */
boolean isEnumConstant(); boolean isEnumConstant();
/** /**
* Compares the specified Object with this field for equality. * Compares the specified Object with this field for equality.
* *
* @return true if the Object is a Field and if both * @return {@code true} if the Object is a Field and if both
* mirror the same field (declared in the same class or interface, in * mirror the same field (declared in the same class or interface, in
* the same VM). * the same VM).
*/ */
@ -130,7 +130,7 @@ public interface Field extends TypeComponent, Comparable<Field> {
/** /**
* Returns the hash code value for this Field. * Returns the hash code value for this Field.
* *
* @return the integer hash code * @return the integer hash code.
*/ */
int hashCode(); int hashCode();
} }

View File

@ -26,20 +26,20 @@
package com.sun.jdi; package com.sun.jdi;
/** /**
* The <code>JDIPermission</code> class represents access rights to * The {@code JDIPermission} class represents access rights to
* the <code>VirtualMachineManager</code>. This is the permission * the {@code VirtualMachineManager}. This is the permission
* which the SecurityManager will check when code that is running with * which the SecurityManager will check when code that is running with
* a SecurityManager requests access to the VirtualMachineManager, as * a SecurityManager requests access to the VirtualMachineManager, as
* defined in the Java Debug Interface (JDI) for the Java platform. * defined in the Java Debug Interface (JDI) for the Java platform.
* <P> * <P>
* A <code>JDIPermission</code> object contains a name (also referred * A {@code JDIPermission} object contains a name (also referred
* to as a "target name") but no actions list; you either have the * to as a "target name") but no actions list; you either have the
* named permission or you don't. * named permission or you don't.
* <P> * <P>
* The following table provides a summary description of what the * The following table provides a summary description of what the
* permission allows, and discusses the risks of granting code the * permission allows, and discusses the risks of granting code the
* permission. * permission.
* <P> *
* <table border=1 cellpadding=5 summary="Table shows permission * <table border=1 cellpadding=5 summary="Table shows permission
* target name, what the permission allows, and associated risks"> * target name, what the permission allows, and associated risks">
* <tr> * <tr>
@ -51,10 +51,10 @@ package com.sun.jdi;
* <tr> * <tr>
* <td>virtualMachineManager</td> * <td>virtualMachineManager</td>
* <td>Ability to inspect and modify the JDI objects in the * <td>Ability to inspect and modify the JDI objects in the
* <code>VirtualMachineManager</code> * {@code VirtualMachineManager}
* </td> * </td>
* <td>This allows an attacker to control the * <td>This allows an attacker to control the
* <code>VirtualMachineManager</code> and cause the system to * {@code VirtualMachineManager} and cause the system to
* misbehave. * misbehave.
* </td> * </td>
* </tr> * </tr>
@ -82,8 +82,8 @@ package com.sun.jdi;
public final class JDIPermission extends java.security.BasicPermission { public final class JDIPermission extends java.security.BasicPermission {
private static final long serialVersionUID = -6988461416938786271L; private static final long serialVersionUID = -6988461416938786271L;
/** /**
* The <code>JDIPermission</code> class represents access rights to the * The {@code JDIPermission} class represents access rights to the
* <code>VirtualMachineManager</code> * {@code VirtualMachineManager}
* @param name Permission name. Must be "virtualMachineManager". * @param name Permission name. Must be "virtualMachineManager".
* @throws IllegalArgumentException if the name argument is invalid. * @throws IllegalArgumentException if the name argument is invalid.
*/ */

View File

@ -49,7 +49,7 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* This type name is always available even if * This type name is always available even if
* the type has not yet been created or loaded. * the type has not yet been created or loaded.
* *
* @return a String containing the return type name. * @return a {@code String} containing the return type name.
*/ */
String returnTypeName(); String returnTypeName();
@ -60,8 +60,8 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* Note: if the return type of this method is a reference type (class, * Note: if the return type of this method is a reference type (class,
* interface, or array) and it has not been created or loaded * interface, or array) and it has not been created or loaded
* by the declaring type's class loader - that is, * by the declaring type's class loader - that is,
* {@link TypeComponent#declaringType <CODE>declaringType()</CODE>} * {@link TypeComponent#declaringType declaringType()}
* <CODE>.classLoader()</CODE>, * {@code .classLoader()},
* then ClassNotLoadedException will be thrown. * then ClassNotLoadedException will be thrown.
* Also, a reference type may have been loaded but not yet prepared, * Also, a reference type may have been loaded but not yet prepared,
* in which case the type will be returned * in which case the type will be returned
@ -93,7 +93,6 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* as specified at compile-time. * as specified at compile-time.
* If the formal parameter was declared with an ellipsis, then * If the formal parameter was declared with an ellipsis, then
* it is represented as an array of the type before the ellipsis. * it is represented as an array of the type before the ellipsis.
*
*/ */
List<String> argumentTypeNames(); List<String> argumentTypeNames();
@ -105,8 +104,8 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* is a reference type (class, interface, or array) * is a reference type (class, interface, or array)
* and it has not been created or loaded * and it has not been created or loaded
* by the declaring type's class loader - that is, * by the declaring type's class loader - that is,
* {@link TypeComponent#declaringType <CODE>declaringType()</CODE>} * {@link TypeComponent#declaringType declaringType()}
* <CODE>.classLoader()</CODE>, * {@code .classLoader()},
* then ClassNotLoadedException will be thrown. * then ClassNotLoadedException will be thrown.
* Also, a reference type may have been loaded but not yet prepared, * Also, a reference type may have been loaded but not yet prepared,
* in which case the list will be returned * in which case the list will be returned
@ -132,16 +131,16 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
/** /**
* Determine if this method is abstract. * Determine if this method is abstract.
* *
* @return <code>true</code> if the method is declared abstract; * @return {@code true} if the method is declared abstract;
* false otherwise. * {@code false} otherwise.
*/ */
boolean isAbstract(); boolean isAbstract();
/** /**
* Determine if this method is a default method * Determine if this method is a default method
* *
* @return <code>true</code> if the method is declared default; * @return {@code true} if the method is declared default;
* false otherwise * {@code false} otherwise.
* *
* @since 1.8 * @since 1.8
*/ */
@ -152,24 +151,24 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
/** /**
* Determine if this method is synchronized. * Determine if this method is synchronized.
* *
* @return <code>true</code> if the method is declared synchronized; * @return {@code true} if the method is declared synchronized;
* false otherwise. * {@code false} otherwise.
*/ */
boolean isSynchronized(); boolean isSynchronized();
/** /**
* Determine if this method is native. * Determine if this method is native.
* *
* @return <code>true</code> if the method is declared native; * @return {@code true} if the method is declared native;
* false otherwise. * {@code false} otherwise.
*/ */
boolean isNative(); boolean isNative();
/** /**
* Determine if this method accepts a variable number of arguments. * Determine if this method accepts a variable number of arguments.
* *
* @return <code>true</code> if the method accepts a variable number * @return {@code true} if the method accepts a variable number
* of arguments, false otherwise. * of arguments, {@code false} otherwise.
* *
* @since 1.5 * @since 1.5
*/ */
@ -180,8 +179,8 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* methods are defined in * methods are defined in
* <cite>The Java&trade; Language Specification</cite>. * <cite>The Java&trade; Language Specification</cite>.
* *
* @return <code>true</code> if the method is a bridge method, * @return {@code true} if the method is a bridge method,
* false otherwise. * {@code false} otherwise.
* *
* @since 1.5 * @since 1.5
*/ */
@ -190,23 +189,23 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
/** /**
* Determine if this method is a constructor. * Determine if this method is a constructor.
* *
* @return <code>true</code> if the method is a constructor; * @return {@code true} if the method is a constructor;
* false otherwise. * {@code false} otherwise.
*/ */
boolean isConstructor(); boolean isConstructor();
/** /**
* Determine if this method is a static initializer. * Determine if this method is a static initializer.
* *
* @return <code>true</code> if the method is a static initializer; * @return {@code true} if the method is a static initializer;
* false otherwise. * {@code false} otherwise.
*/ */
boolean isStaticInitializer(); boolean isStaticInitializer();
/** /**
* Determine if this method is obsolete. * Determine if this method is obsolete.
* *
* @return <code>true</code> if this method has been made obsolete by a * @return {@code true} if this method has been made obsolete by a
* {@link VirtualMachine#redefineClasses} operation. * {@link VirtualMachine#redefineClasses} operation.
* *
* @since 1.4 * @since 1.4
@ -218,7 +217,7 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* each executable source line in this method. * each executable source line in this method.
* <P> * <P>
* This method is equivalent to * This method is equivalent to
* <code>allLineLocations(vm.getDefaultStratum(),null)</code> - * {@code allLineLocations(vm.getDefaultStratum(),null)} -
* see {@link #allLineLocations(String,String)} * see {@link #allLineLocations(String,String)}
* for more information. * for more information.
* *
@ -252,16 +251,16 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* (see {@link Location} for a description of strata). * (see {@link Location} for a description of strata).
* *
* @param stratum The stratum to retrieve information from * @param stratum The stratum to retrieve information from
* or <code>null</code> for the {@link ReferenceType#defaultStratum()} * or {@code null} for the {@link ReferenceType#defaultStratum()}
* *
* @param sourceName Return locations only within this * @param sourceName Return locations only within this
* source file or <code>null</code> to return locations. * source file or {@code null} to return locations.
* *
* @return a List of all source line {@link Location} objects. * @return a List of all source line {@link Location} objects.
* *
* @throws AbsentInformationException if there is no line * @throws AbsentInformationException if there is no line
* number information for this (non-native, non-abstract) * number information for this (non-native, non-abstract)
* method. Or if <i>sourceName</i> is non-<code>null</code> * method. Or if <i>sourceName</i> is non-{@code null}
* and source name information is not present. * and source name information is not present.
* *
* @since 1.4 * @since 1.4
@ -274,8 +273,8 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* that map to the given line number. * that map to the given line number.
* <P> * <P>
* This method is equivalent to * This method is equivalent to
* <code>locationsOfLine(vm.getDefaultStratum(), null, * {@code locationsOfLine(vm.getDefaultStratum(), null,
* lineNumber)</code> - * lineNumber)} -
* see {@link * see {@link
* #locationsOfLine(java.lang.String,java.lang.String,int)} * #locationsOfLine(java.lang.String,java.lang.String,int)}
* for more information. * for more information.
@ -320,7 +319,7 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
* *
* @throws AbsentInformationException if there is no line * @throws AbsentInformationException if there is no line
* number information for this method. * number information for this method.
* Or if <i>sourceName</i> is non-<code>null</code> * Or if <i>sourceName</i> is non-{@code null}
* and source name information is not present. * and source name information is not present.
* *
* @since 1.4 * @since 1.4
@ -436,7 +435,7 @@ public interface Method extends TypeComponent, Locatable, Comparable<Method> {
/** /**
* Returns the hash code value for this Method. * Returns the hash code value for this Method.
* *
* @return the integer hash code * @return the integer hash code.
*/ */
int hashCode(); int hashCode();
} }

Some files were not shown because too many files have changed in this diff Show More