diff --git a/.hgtags b/.hgtags
index 25e7a3c7d92..e411eb8ffc5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -213,3 +213,5 @@ e517701a4d0e25ae9c7945bca6e1762a8c5d8aa6 jdk8-b88
4dec41b3c5e3bb616f0c6f15830d940905aa5d16 jdk8-b89
f09ab0c416185e3cba371e81bcb6a16060c90f44 jdk8-b90
80b6c3172dc2cfceb022411292d290a967f9c728 jdk8-b91
+2fd6acba737b01e705e1f7c33588c922a3787f13 jdk8-b92
+b72ae39e1329fefae50d4690db4fde43f3841a95 jdk8-b93
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index dc47bb707b1..bc5928f1afd 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -213,3 +213,5 @@ e1a929afcfc492470d50be0b6b0e8dc77d3760b9 jdk8-b88
892a0196d10c67f3a12f0eefb0bb536e423d8868 jdk8-b89
69b773a221b956a3386933ecdbfeccee0edeac47 jdk8-b90
cb51fb4789ac0b8be4056482077ddfb8f3bd3805 jdk8-b91
+3a36c926a7aafa9d4a892a45ef3678e87ad8359b jdk8-b92
+27c51c6e31c1ef36afa0e6efb031f9b13f26c12b jdk8-b93
diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4
index 305424db718..92c91e1bcfc 100644
--- a/common/autoconf/basics.m4
+++ b/common/autoconf/basics.m4
@@ -72,7 +72,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
fi
- $1="`cd "$path"; $THEPWDCMD`"
+ $1="`cd "$path"; $THEPWDCMD -L`"
fi
])
@@ -169,10 +169,10 @@ AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
COUNTER=0
sym_link_dir=`$DIRNAME [$]$1`
sym_link_file=`$BASENAME [$]$1`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
+ # Use -P flag to resolve symlinks in directories.
+ cd `$THEPWDCMD -P`
+ sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
@@ -183,7 +183,7 @@ AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
+ sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
@@ -264,7 +264,6 @@ BASIC_REQUIRE_PROG(MKDIR, mkdir)
BASIC_REQUIRE_PROG(MKTEMP, mktemp)
BASIC_REQUIRE_PROG(MV, mv)
BASIC_REQUIRE_PROG(PRINTF, printf)
-BASIC_REQUIRE_PROG(THEPWDCMD, pwd)
BASIC_REQUIRE_PROG(RM, rm)
BASIC_REQUIRE_PROG(SH, sh)
BASIC_REQUIRE_PROG(SORT, sort)
@@ -297,6 +296,10 @@ BASIC_CHECK_NONEMPTY(NAWK)
# Always force rm.
RM="$RM -f"
+# pwd behaves differently on various platforms and some don't support the -L flag.
+# Always use the bash builtin pwd to get uniform behavior.
+THEPWDCMD=pwd
+
# These are not required on all platforms
AC_PATH_PROG(CYGPATH, cygpath)
AC_PATH_PROG(READLINK, readlink)
@@ -309,13 +312,12 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
[
# Locate the directory of this script.
SCRIPT="[$]0"
-BASIC_REMOVE_SYMBOLIC_LINKS(SCRIPT)
-AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD`
+AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L`
# Where is the source? It is located two levels above the configure script.
CURDIR="$PWD"
cd "$AUTOCONF_DIR/../.."
-SRC_ROOT="`$THEPWDCMD`"
+SRC_ROOT="`$THEPWDCMD -L`"
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
PATH_SEP=";"
@@ -374,13 +376,9 @@ AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
[ CONF_NAME=${with_conf_name} ])
# Test from where we are running configure, in or outside of src root.
-# To enable comparison of directories, CURDIR needs to be symlink free
-# just like SRC_ROOT already is
-NOSYM_CURDIR="$CURDIR"
-BASIC_REMOVE_SYMBOLIC_LINKS(NOSYM_CURDIR)
-if test "x$NOSYM_CURDIR" = "x$SRC_ROOT" || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common" \
- || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/autoconf" \
- || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
+if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
+ || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
+ || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
@@ -617,6 +615,20 @@ fi
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
BASIC_REQUIRE_PROG(XATTR, xattr)
+ AC_PATH_PROG(CODESIGN, codesign)
+ if test "x$CODESIGN" != "x"; then
+ # Verify that the openjdk_codesign certificate is present
+ AC_MSG_CHECKING([if openjdk_codesign certificate is present])
+ rm -f codesign-testfile
+ touch codesign-testfile
+ codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
+ rm -f codesign-testfile
+ if test "x$CODESIGN" = x; then
+ AC_MSG_RESULT([no])
+ else
+ AC_MSG_RESULT([yes])
+ fi
+ fi
fi
])
diff --git a/common/autoconf/basics_windows.m4 b/common/autoconf/basics_windows.m4
index d0c48ae7c25..9ddb9e8c5c0 100644
--- a/common/autoconf/basics_windows.m4
+++ b/common/autoconf/basics_windows.m4
@@ -300,7 +300,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE_MSYS],
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS],
[
- SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m`
+ SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m`
if test $SRC_ROOT_LENGTH -gt 100; then
AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
fi
diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4
index e7d6364edff..a1abced459d 100644
--- a/common/autoconf/build-performance.m4
+++ b/common/autoconf/build-performance.m4
@@ -145,6 +145,9 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
if test "$JOBS" -gt "16"; then
JOBS=16
fi
+ if test "$JOBS" -eq "0"; then
+ JOBS=1
+ fi
AC_MSG_RESULT([$JOBS])
else
JOBS=$with_jobs
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 87b75cb6cd7..e1c9229a744 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -681,8 +681,8 @@ STATIC_LIBRARY
SHARED_LIBRARY
OBJ_SUFFIX
COMPILER_NAME
-JTREGEXE
JT_HOME
+JTREGEXE
LIPO
ac_ct_OBJDUMP
OBJDUMP
@@ -797,6 +797,7 @@ OS_VERSION_MICRO
OS_VERSION_MINOR
OS_VERSION_MAJOR
PKG_CONFIG
+CODESIGN
XATTR
TIME
STAT
@@ -900,7 +901,6 @@ TAIL
SORT
SH
RM
-THEPWDCMD
PRINTF
MV
MKTEMP
@@ -988,6 +988,7 @@ enable_hotspot_test_in_build
with_cacerts_file
enable_unlimited_crypto
with_milestone
+with_update_version
with_build_number
with_user_release_suffix
with_boot_jdk
@@ -1727,6 +1728,7 @@ Optional Packages:
group
--with-cacerts-file specify alternative cacerts file
--with-milestone Set milestone value for build [internal]
+ --with-update-version Set update version value for build [b00]
--with-build-number Set build number value for build [b00]
--with-user-release-suffix
Add a custom string to the version string if build
@@ -3780,7 +3782,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1369723814
+DATE_WHEN_GENERATED=1370949244
###############################################################################
#
@@ -5169,65 +5171,6 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
- for ac_prog in pwd
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_THEPWDCMD+set}" = set; then :
- $as_echo_n "(cached) " >&6
-else
- case $THEPWDCMD in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_THEPWDCMD="$THEPWDCMD" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_THEPWDCMD="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-THEPWDCMD=$ac_cv_path_THEPWDCMD
-if test -n "$THEPWDCMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THEPWDCMD" >&5
-$as_echo "$THEPWDCMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$THEPWDCMD" && break
-done
-
-
- if test "x$THEPWDCMD" = x; then
- if test "xpwd" = x; then
- PROG_NAME=thepwdcmd
- else
- PROG_NAME=pwd
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
- as_fn_error $? "Cannot continue" "$LINENO" 5
- fi
-
-
-
for ac_prog in rm
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6426,6 +6369,10 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
# Always force rm.
RM="$RM -f"
+# pwd behaves differently on various platforms and some don't support the -L flag.
+# Always use the bash builtin pwd to get uniform behavior.
+THEPWDCMD=pwd
+
# These are not required on all platforms
# Extract the first word of "cygpath", so it can be a program name with args.
set dummy cygpath; ac_word=$2
@@ -7133,65 +7080,17 @@ $as_echo "$COMPILE_TYPE" >&6; }
# Locate the directory of this script.
SCRIPT="$0"
-
- if test "x$OPENJDK_BUILD_OS" != xwindows; then
- # Follow a chain of symbolic links. Use readlink
- # where it exists, else fall back to horribly
- # complicated shell code.
- if test "x$READLINK_TESTED" != yes; then
- # On MacOSX there is a readlink tool with a different
- # purpose than the GNU readlink tool. Check the found readlink.
- ISGNU=`$READLINK --version 2>&1 | $GREP GNU`
- if test "x$ISGNU" = x; then
- # A readlink that we do not know how to use.
- # Are there other non-GNU readlinks out there?
- READLINK_TESTED=yes
- READLINK=
- fi
- fi
-
- if test "x$READLINK" != x; then
- SCRIPT=`$READLINK -f $SCRIPT`
- else
- # Save the current directory for restoring afterwards
- STARTDIR=$PWD
- COUNTER=0
- sym_link_dir=`$DIRNAME $SCRIPT`
- sym_link_file=`$BASENAME $SCRIPT`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
- cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
- # Resolve file symlinks
- while test $COUNTER -lt 20; do
- ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
- if test "x$ISLINK" == x; then
- # This is not a symbolic link! We are done!
- break
- fi
- # Again resolve directory symlinks since the target of the just found
- # link could be in a different directory
- cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
- sym_link_file=`$BASENAME $ISLINK`
- let COUNTER=COUNTER+1
- done
- cd $STARTDIR
- SCRIPT=$sym_link_dir/$sym_link_file
- fi
- fi
-
-AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD`
+AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L`
# Where is the source? It is located two levels above the configure script.
CURDIR="$PWD"
cd "$AUTOCONF_DIR/../.."
-SRC_ROOT="`$THEPWDCMD`"
+SRC_ROOT="`$THEPWDCMD -L`"
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
PATH_SEP=";"
- SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m`
+ SRC_ROOT_LENGTH=`$THEPWDCMD -L|$WC -m`
if test $SRC_ROOT_LENGTH -gt 100; then
as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5
fi
@@ -7407,7 +7306,7 @@ $as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- SRC_ROOT="`cd "$path"; $THEPWDCMD`"
+ SRC_ROOT="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -7529,7 +7428,7 @@ $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid."
as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- CURDIR="`cd "$path"; $THEPWDCMD`"
+ CURDIR="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -7900,60 +7799,9 @@ fi
# Test from where we are running configure, in or outside of src root.
-# To enable comparison of directories, CURDIR needs to be symlink free
-# just like SRC_ROOT already is
-NOSYM_CURDIR="$CURDIR"
-
- if test "x$OPENJDK_BUILD_OS" != xwindows; then
- # Follow a chain of symbolic links. Use readlink
- # where it exists, else fall back to horribly
- # complicated shell code.
- if test "x$READLINK_TESTED" != yes; then
- # On MacOSX there is a readlink tool with a different
- # purpose than the GNU readlink tool. Check the found readlink.
- ISGNU=`$READLINK --version 2>&1 | $GREP GNU`
- if test "x$ISGNU" = x; then
- # A readlink that we do not know how to use.
- # Are there other non-GNU readlinks out there?
- READLINK_TESTED=yes
- READLINK=
- fi
- fi
-
- if test "x$READLINK" != x; then
- NOSYM_CURDIR=`$READLINK -f $NOSYM_CURDIR`
- else
- # Save the current directory for restoring afterwards
- STARTDIR=$PWD
- COUNTER=0
- sym_link_dir=`$DIRNAME $NOSYM_CURDIR`
- sym_link_file=`$BASENAME $NOSYM_CURDIR`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
- cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
- # Resolve file symlinks
- while test $COUNTER -lt 20; do
- ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
- if test "x$ISLINK" == x; then
- # This is not a symbolic link! We are done!
- break
- fi
- # Again resolve directory symlinks since the target of the just found
- # link could be in a different directory
- cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
- sym_link_file=`$BASENAME $ISLINK`
- let COUNTER=COUNTER+1
- done
- cd $STARTDIR
- NOSYM_CURDIR=$sym_link_dir/$sym_link_file
- fi
- fi
-
-if test "x$NOSYM_CURDIR" = "x$SRC_ROOT" || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common" \
- || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/autoconf" \
- || test "x$NOSYM_CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
+if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
+ || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
+ || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
@@ -8128,7 +7976,7 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval
as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- OUTPUT_ROOT="`cd "$path"; $THEPWDCMD`"
+ OUTPUT_ROOT="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -10493,6 +10341,62 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
fi
+ # Extract the first word of "codesign", so it can be a program name with args.
+set dummy codesign; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CODESIGN+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CODESIGN in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CODESIGN="$CODESIGN" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_CODESIGN="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+CODESIGN=$ac_cv_path_CODESIGN
+if test -n "$CODESIGN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CODESIGN" >&5
+$as_echo "$CODESIGN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x$CODESIGN" != "x"; then
+ # Verify that the openjdk_codesign certificate is present
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if openjdk_codesign certificate is present" >&5
+$as_echo_n "checking if openjdk_codesign certificate is present... " >&6; }
+ rm -f codesign-testfile
+ touch codesign-testfile
+ codesign -s openjdk_codesign codesign-testfile 2>&5 >&5 || CODESIGN=
+ rm -f codesign-testfile
+ if test "x$CODESIGN" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ fi
+ fi
fi
@@ -10878,11 +10782,7 @@ fi
if test "x$with_cacerts_file" != x; then
CACERTS_FILE=$with_cacerts_file
else
- if test "x$OPENJDK" = "xtrue"; then
- CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
- else
- CACERTS_FILE=${SRC_ROOT}/jdk/src/closed/share/lib/security/cacerts.internal
- fi
+ CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
fi
@@ -10939,6 +10839,18 @@ if test "x$MILESTONE" = x; then
fi
+# Check whether --with-update-version was given.
+if test "${with_update_version+set}" = set; then :
+ withval=$with_update_version;
+fi
+
+if test "x$with_update_version" = xyes; then
+ as_fn_error $? "Update version must have a value" "$LINENO" 5
+elif test "x$with_update_version" != x; then
+ JDK_UPDATE_VERSION="$with_update_version"
+fi
+
+
# Check whether --with-build-number was given.
if test "${with_build_number+set}" = set; then :
withval=$with_build_number;
@@ -11188,7 +11100,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -11520,7 +11432,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -11666,7 +11578,7 @@ $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\",
as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD`"
+ JAVA_HOME_PROCESSED="`cd "$path"; $THEPWDCMD -L`"
fi
if test ! -d "$JAVA_HOME_PROCESSED"; then
@@ -11838,7 +11750,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -12026,7 +11938,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -12165,10 +12077,10 @@ fi
COUNTER=0
sym_link_dir=`$DIRNAME $BINARY`
sym_link_file=`$BASENAME $BINARY`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
+ # Use -P flag to resolve symlinks in directories.
+ cd `$THEPWDCMD -P`
+ sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
@@ -12179,7 +12091,7 @@ fi
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
+ sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
@@ -12354,7 +12266,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -12569,7 +12481,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -12749,7 +12661,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -12957,7 +12869,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -13137,7 +13049,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -13345,7 +13257,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -13525,7 +13437,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -13733,7 +13645,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -13913,7 +13825,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -14108,7 +14020,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -14286,7 +14198,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -14482,7 +14394,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -14660,7 +14572,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -14855,7 +14767,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -15033,7 +14945,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -15229,7 +15141,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -15407,7 +15319,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -15584,7 +15496,7 @@ $as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid.
as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- BOOT_JDK="`cd "$path"; $THEPWDCMD`"
+ BOOT_JDK="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
@@ -16261,14 +16173,28 @@ AR_OUT_OPTION='rcs$(SPACE)'
# Check whether --with-jtreg was given.
if test "${with_jtreg+set}" = set; then :
withval=$with_jtreg;
+else
+ with_jtreg=no
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTReg Regression Test Harness" >&5
-$as_echo_n "checking for JTReg Regression Test Harness... " >&6; }
+ if test "x$with_jtreg" = xno; then
+ # jtreg disabled
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5
+$as_echo_n "checking for jtreg... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ else
+ if test "x$with_jtreg" != xyes; then
+ # with path specified.
+ JT_HOME="$with_jtreg"
+ fi
- if test "x$with_jtreg" != x; then
- JT_HOME="$with_jtreg"
+ if test "x$JT_HOME" != x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5
+$as_echo_n "checking for jtreg... " >&6; }
+
+ # use JT_HOME enviroment var.
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -16388,20 +16314,82 @@ $as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid."
as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- JT_HOME="`cd "$path"; $THEPWDCMD`"
+ JT_HOME="`cd "$path"; $THEPWDCMD -L`"
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JT_HOME" >&5
-$as_echo "$JT_HOME" >&6; }
- # jtreg win32 script works for everybody
- JTREGEXE="$JT_HOME/win32/bin/jtreg"
- if test ! -f "$JTREGEXE"; then
- as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ # jtreg win32 script works for everybody
+ JTREGEXE="$JT_HOME/win32/bin/jtreg"
+
+ if test ! -f "$JTREGEXE"; then
+ as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5
+$as_echo "$JTREGEXE" >&6; }
+ else
+ # try to find jtreg on path
+
+ for ac_prog in jtreg
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JTREGEXE+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $JTREGEXE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+JTREGEXE=$ac_cv_path_JTREGEXE
+if test -n "$JTREGEXE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5
+$as_echo "$JTREGEXE" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
+fi
+
+
+ test -n "$JTREGEXE" && break
+done
+
+
+ if test "x$JTREGEXE" = x; then
+ if test "xjtreg" = x; then
+ PROG_NAME=jtregexe
+ else
+ PROG_NAME=jtreg
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+ as_fn_error $? "Cannot continue" "$LINENO" 5
+ fi
+
+
+ JT_HOME="`$DIRNAME $JTREGEXE`"
+ fi
fi
@@ -16518,6 +16506,123 @@ $as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio
as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5
fi
+ if test "x$VS100COMNTOOLS" != x; then
+
+ if test "x$VS_ENV_CMD" = x; then
+ VS100BASE="$VS100COMNTOOLS/../.."
+ METHOD="VS100COMNTOOLS variable"
+
+ windows_path="$VS100BASE"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ VS100BASE="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ VS100BASE="$unix_path"
+ fi
+
+ if test -d "$VS100BASE"; then
+ if test -f "$VS100BASE/$VCVARSFILE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+ fi
+ fi
+ fi
+
+ fi
+ if test "x$PROGRAMFILES" != x; then
+
+ if test "x$VS_ENV_CMD" = x; then
+ VS100BASE="$PROGRAMFILES/Microsoft Visual Studio 10.0"
+ METHOD="well-known name"
+
+ windows_path="$VS100BASE"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ VS100BASE="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ VS100BASE="$unix_path"
+ fi
+
+ if test -d "$VS100BASE"; then
+ if test -f "$VS100BASE/$VCVARSFILE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+ fi
+ fi
+ fi
+
+ fi
+
+ if test "x$VS_ENV_CMD" = x; then
+ VS100BASE="C:/Program Files/Microsoft Visual Studio 10.0"
+ METHOD="well-known name"
+
+ windows_path="$VS100BASE"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ VS100BASE="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ VS100BASE="$unix_path"
+ fi
+
+ if test -d "$VS100BASE"; then
+ if test -f "$VS100BASE/$VCVARSFILE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+ fi
+ fi
+ fi
+
+
+ if test "x$VS_ENV_CMD" = x; then
+ VS100BASE="C:/Program Files (x86)/Microsoft Visual Studio 10.0"
+ METHOD="well-known name"
+
+ windows_path="$VS100BASE"
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+ unix_path=`$CYGPATH -u "$windows_path"`
+ VS100BASE="$unix_path"
+ elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+ unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
+ VS100BASE="$unix_path"
+ fi
+
+ if test -d "$VS100BASE"; then
+ if test -f "$VS100BASE/$VCVARSFILE"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
+ fi
+ fi
+ fi
+
+
if test "x$ProgramW6432" != x; then
if test "x$VS_ENV_CMD" = x; then
@@ -16725,123 +16830,6 @@ $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignori
fi
- if test "x$VS100COMNTOOLS" != x; then
-
- if test "x$VS_ENV_CMD" = x; then
- VS100BASE="$VS100COMNTOOLS/../.."
- METHOD="VS100COMNTOOLS variable"
-
- windows_path="$VS100BASE"
- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
- unix_path=`$CYGPATH -u "$windows_path"`
- VS100BASE="$unix_path"
- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
- VS100BASE="$unix_path"
- fi
-
- if test -d "$VS100BASE"; then
- if test -f "$VS100BASE/$VCVARSFILE"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
- fi
- fi
- fi
-
- fi
- if test "x$PROGRAMFILES" != x; then
-
- if test "x$VS_ENV_CMD" = x; then
- VS100BASE="$PROGRAMFILES/Microsoft Visual Studio 10.0"
- METHOD="well-known name"
-
- windows_path="$VS100BASE"
- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
- unix_path=`$CYGPATH -u "$windows_path"`
- VS100BASE="$unix_path"
- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
- VS100BASE="$unix_path"
- fi
-
- if test -d "$VS100BASE"; then
- if test -f "$VS100BASE/$VCVARSFILE"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
- fi
- fi
- fi
-
- fi
-
- if test "x$VS_ENV_CMD" = x; then
- VS100BASE="C:/Program Files/Microsoft Visual Studio 10.0"
- METHOD="well-known name"
-
- windows_path="$VS100BASE"
- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
- unix_path=`$CYGPATH -u "$windows_path"`
- VS100BASE="$unix_path"
- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
- VS100BASE="$unix_path"
- fi
-
- if test -d "$VS100BASE"; then
- if test -f "$VS100BASE/$VCVARSFILE"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
- fi
- fi
- fi
-
-
- if test "x$VS_ENV_CMD" = x; then
- VS100BASE="C:/Program Files (x86)/Microsoft Visual Studio 10.0"
- METHOD="well-known name"
-
- windows_path="$VS100BASE"
- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
- unix_path=`$CYGPATH -u "$windows_path"`
- VS100BASE="$unix_path"
- elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
- unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
- VS100BASE="$unix_path"
- fi
-
- if test -d "$VS100BASE"; then
- if test -f "$VS100BASE/$VCVARSFILE"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
-$as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
-$as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
- fi
- fi
- fi
-
-
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.
@@ -17243,11 +17231,25 @@ $as_echo "$as_me: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&6;}
$as_echo "$as_me: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&6;}
fi
fi
+ # Try some fallback alternatives
if test "x$MSVCR_DLL" = x; then
- if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5
+ # If visual studio express is installed, there is usually one with the debugger
+ if test "x$VS100COMNTOOLS" != x; then
+ if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+ MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&5
+$as_echo "$as_me: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&6;}
+ fi
+ fi
+ fi
+ if test "x$MSVCR_DLL" = x; then
+ if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+ # Fallback for 32bit builds, look in the windows directory.
+ if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5
$as_echo "$as_me: msvcr100.dll found in $SYSTEMROOT/system32" >&6;}
- MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
+ MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
+ fi
fi
fi
fi
@@ -17377,7 +17379,7 @@ $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid
as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- MSVCR_DLL="`cd "$path"; $THEPWDCMD`"
+ MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -17534,7 +17536,7 @@ $as_echo "$as_me: The path of dxsdk_path, which resolves as \"$path\", is invali
as_fn_error $? "The path of dxsdk_path, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- dxsdk_path="`cd "$path"; $THEPWDCMD`"
+ dxsdk_path="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -17672,7 +17674,7 @@ $as_echo "$as_me: The path of DXSDK_LIB_PATH, which resolves as \"$path\", is in
as_fn_error $? "The path of DXSDK_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- DXSDK_LIB_PATH="`cd "$path"; $THEPWDCMD`"
+ DXSDK_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -17808,7 +17810,7 @@ $as_echo "$as_me: The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", i
as_fn_error $? "The path of DXSDK_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- DXSDK_INCLUDE_PATH="`cd "$path"; $THEPWDCMD`"
+ DXSDK_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
fi
@@ -19395,10 +19397,10 @@ $as_echo_n "checking resolved symbolic links for CC... " >&6; }
COUNTER=0
sym_link_dir=`$DIRNAME $TEST_COMPILER`
sym_link_file=`$BASENAME $TEST_COMPILER`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
+ # Use -P flag to resolve symlinks in directories.
+ cd `$THEPWDCMD -P`
+ sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
@@ -19409,7 +19411,7 @@ $as_echo_n "checking resolved symbolic links for CC... " >&6; }
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
+ sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
@@ -19832,10 +19834,10 @@ $as_echo_n "checking for resolved symbolic links for CC... " >&6; }
COUNTER=0
sym_link_dir=`$DIRNAME $PROPER_COMPILER_CC`
sym_link_file=`$BASENAME $PROPER_COMPILER_CC`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
+ # Use -P flag to resolve symlinks in directories.
+ cd `$THEPWDCMD -P`
+ sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
@@ -19846,7 +19848,7 @@ $as_echo_n "checking for resolved symbolic links for CC... " >&6; }
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
+ sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
@@ -20968,10 +20970,10 @@ $as_echo_n "checking resolved symbolic links for CXX... " >&6; }
COUNTER=0
sym_link_dir=`$DIRNAME $TEST_COMPILER`
sym_link_file=`$BASENAME $TEST_COMPILER`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
+ # Use -P flag to resolve symlinks in directories.
+ cd `$THEPWDCMD -P`
+ sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
@@ -20982,7 +20984,7 @@ $as_echo_n "checking resolved symbolic links for CXX... " >&6; }
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
+ sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
@@ -21405,10 +21407,10 @@ $as_echo_n "checking for resolved symbolic links for CXX... " >&6; }
COUNTER=0
sym_link_dir=`$DIRNAME $PROPER_COMPILER_CXX`
sym_link_file=`$BASENAME $PROPER_COMPILER_CXX`
- # Use the system pwd and not the shell builtin to resolve directory symlinks
cd $sym_link_dir
- cd `$THEPWDCMD`
- sym_link_dir=`$THEPWDCMD`
+ # Use -P flag to resolve symlinks in directories.
+ cd `$THEPWDCMD -P`
+ sym_link_dir=`$THEPWDCMD -P`
# Resolve file symlinks
while test $COUNTER -lt 20; do
ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
@@ -21419,7 +21421,7 @@ $as_echo_n "checking for resolved symbolic links for CXX... " >&6; }
# Again resolve directory symlinks since the target of the just found
# link could be in a different directory
cd `$DIRNAME $ISLINK`
- sym_link_dir=`$THEPWDCMD`
+ sym_link_dir=`$THEPWDCMD -P`
sym_link_file=`$BASENAME $ISLINK`
let COUNTER=COUNTER+1
done
@@ -31131,7 +31133,7 @@ $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is inv
as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- with_freetype="`cd "$path"; $THEPWDCMD`"
+ with_freetype="`cd "$path"; $THEPWDCMD -L`"
fi
FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype"
@@ -31433,7 +31435,7 @@ $as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is
as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5
fi
- FREETYPELOCATION="`cd "$path"; $THEPWDCMD`"
+ FREETYPELOCATION="`cd "$path"; $THEPWDCMD -L`"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5
@@ -32933,6 +32935,9 @@ $as_echo_n "checking for appropriate number of jobs to run in parallel... " >&6;
if test "$JOBS" -gt "16"; then
JOBS=16
fi
+ if test "$JOBS" -eq "0"; then
+ JOBS=1
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JOBS" >&5
$as_echo "$JOBS" >&6; }
else
diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4
index 268bd842f10..ba14373e593 100644
--- a/common/autoconf/jdk-options.m4
+++ b/common/autoconf/jdk-options.m4
@@ -351,11 +351,7 @@ AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
if test "x$with_cacerts_file" != x; then
CACERTS_FILE=$with_cacerts_file
else
- if test "x$OPENJDK" = "xtrue"; then
- CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
- else
- CACERTS_FILE=${SRC_ROOT}/jdk/src/closed/share/lib/security/cacerts.internal
- fi
+ CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
fi
AC_SUBST(CACERTS_FILE)
@@ -422,6 +418,14 @@ if test "x$MILESTONE" = x; then
MILESTONE=internal
fi
+AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
+ [Set update version value for build @<:@b00@:>@])])
+if test "x$with_update_version" = xyes; then
+ AC_MSG_ERROR([Update version must have a value])
+elif test "x$with_update_version" != x; then
+ JDK_UPDATE_VERSION="$with_update_version"
+fi
+
AC_ARG_WITH(build-number, [AS_HELP_STRING([--with-build-number],
[Set build number value for build @<:@b00@:>@])])
if test "x$with_build_number" = xyes; then
diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in
index 8705a2a0114..1ebf89d827d 100644
--- a/common/autoconf/spec.gmk.in
+++ b/common/autoconf/spec.gmk.in
@@ -478,6 +478,7 @@ CCACHE:=@CCACHE@
# CD is going away, but remains to cater for legacy makefiles.
CD:=cd
CHMOD:=@CHMOD@
+CODESIGN:=@CODESIGN@
COMM:=@COMM@
CP:=@CP@
CPIO:=@CPIO@
diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4
index 723d96a22e1..eb6c375f397 100644
--- a/common/autoconf/toolchain.m4
+++ b/common/autoconf/toolchain.m4
@@ -36,7 +36,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
$ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
if test $? -ne 0; then
GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
-
+
AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.])
AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"])
AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.])
@@ -69,7 +69,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"])
AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.])
fi
-
+
# First line typically looks something like:
# gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/p"`
@@ -142,7 +142,7 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER)
AC_MSG_RESULT([$TEST_COMPILER])
AC_MSG_CHECKING([if $1 is disguised ccache])
-
+
COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
if test "x$COMPILER_BASENAME" = "xccache"; then
AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler])
@@ -226,11 +226,11 @@ BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
],
[])
-if test "x$SYS_ROOT" != "x/" ; then
+if test "x$SYS_ROOT" != "x/" ; then
CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
- OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
- OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
+ OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
+ OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
fi
@@ -330,7 +330,7 @@ AC_SUBST(HOTSPOT_LD)
COMPILER_NAME=gcc
COMPILER_TYPE=CC
AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [
- # For now, assume that we are always compiling using cl.exe.
+ # For now, assume that we are always compiling using cl.exe.
CC_OUT_OPTION=-Fo
EXE_OUT_OPTION=-out:
LD_OUT_OPTION=-out:
@@ -491,7 +491,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS],
###############################################################################
#
-# How to compile shared libraries.
+# How to compile shared libraries.
#
if test "x$GCC" = xyes; then
@@ -525,7 +525,7 @@ if test "x$GCC" = xyes; then
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
SHARED_LIBRARY_SUFFIX='.dylib'
EXE_SUFFIX=''
- SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
+ SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
SET_SHARED_LIBRARY_MAPFILE=''
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
@@ -676,7 +676,7 @@ case $COMPILER_TYPE in
# Use single precision floating point with 'float'
CC_HIGHEST="$CC_HIGHEST -fsingle"
# Assume memory references via basic pointer types do not alias
- # (Source with excessing pointer casting and data access with mixed
+ # (Source with excessing pointer casting and data access with mixed
# pointer types are not recommended)
CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
# Use intrinsic or inline versions for math/std functions
@@ -892,7 +892,7 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
fi
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
- # Setting these parameters makes it an error to link to macosx APIs that are
+ # Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible even
# if built on a newer version of the OS.
# The expected format is X.Y.Z
@@ -940,12 +940,12 @@ CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
# is identical for client and server? Yes. Which is picked at runtime (client or server)?
# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
-# libraries will link to whatever is in memory. Yuck.
+# libraries will link to whatever is in memory. Yuck.
#
# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
if test "x$COMPILER_NAME" = xcl; then
LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
- if test "x$OPENJDK_TARGET_CPU" = xx86; then
+ if test "x$OPENJDK_TARGET_CPU" = xx86; then
LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
fi
# TODO: make -debug optional "--disable-full-debug-symbols"
@@ -965,7 +965,7 @@ else
if test -n "$HAS_GNU_HASH"; then
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
fi
- if test "x$OPENJDK_TARGET_OS" = xlinux; then
+ if test "x$OPENJDK_TARGET_OS" = xlinux; then
# And since we now know that the linker is gnu, then add -z defs, to forbid
# undefined symbols in object files.
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
@@ -1006,7 +1006,7 @@ fi
# Adjust flags according to debug level.
case $DEBUG_LEVEL in
- fastdebug )
+ fastdebug )
CFLAGS="$CFLAGS $D_FLAG"
JAVAC_FLAGS="$JAVAC_FLAGS -g"
;;
@@ -1018,9 +1018,9 @@ case $DEBUG_LEVEL in
CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
JAVAC_FLAGS="$JAVAC_FLAGS -g"
;;
-esac
+esac
+
-
AC_SUBST(CFLAGS_JDKLIB)
AC_SUBST(CFLAGS_JDKEXE)
@@ -1092,28 +1092,45 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC],
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
])
-# Setup the JTREG paths
-AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
-[
- AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
- [Regression Test Harness @<:@probed@:>@])])
-
- AC_MSG_CHECKING([for JTReg Regression Test Harness])
-
- if test "x$with_jtreg" != x; then
- JT_HOME="$with_jtreg"
- BASIC_FIXUP_PATH([JT_HOME])
- AC_MSG_RESULT($JT_HOME)
-
- # jtreg win32 script works for everybody
- JTREGEXE="$JT_HOME/win32/bin/jtreg"
- if test ! -f "$JTREGEXE"; then
- AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
- fi
- else
+# Setup the JTREG paths
+AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
+[
+ AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
+ [Regression Test Harness @<:@probed@:>@])],
+ [],
+ [with_jtreg=no])
+
+ if test "x$with_jtreg" = xno; then
+ # jtreg disabled
+ AC_MSG_CHECKING([for jtreg])
AC_MSG_RESULT(no)
- fi
-
- AC_SUBST(JT_HOME)
- AC_SUBST(JTREGEXE)
+ else
+ if test "x$with_jtreg" != xyes; then
+ # with path specified.
+ JT_HOME="$with_jtreg"
+ fi
+
+ if test "x$JT_HOME" != x; then
+ AC_MSG_CHECKING([for jtreg])
+
+ # use JT_HOME enviroment var.
+ BASIC_FIXUP_PATH([JT_HOME])
+
+ # jtreg win32 script works for everybody
+ JTREGEXE="$JT_HOME/win32/bin/jtreg"
+
+ if test ! -f "$JTREGEXE"; then
+ AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
+ fi
+
+ AC_MSG_RESULT($JTREGEXE)
+ else
+ # try to find jtreg on path
+ BASIC_REQUIRE_PROG(JTREGEXE, jtreg)
+ JT_HOME="`$DIRNAME $JTREGEXE`"
+ fi
+ fi
+
+ AC_SUBST(JT_HOME)
+ AC_SUBST(JTREGEXE)
])
diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4
index 700339a9e17..966c0133995 100644
--- a/common/autoconf/toolchain_windows.m4
+++ b/common/autoconf/toolchain_windows.m4
@@ -91,6 +91,15 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
AC_MSG_ERROR([Cannot locate a valid Visual Studio installation])
fi
+ if test "x$VS100COMNTOOLS" != x; then
+ TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable])
+ fi
+ if test "x$PROGRAMFILES" != x; then
+ TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name])
+ fi
+ TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name])
+ TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name])
+
if test "x$ProgramW6432" != x; then
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([$ProgramW6432/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
fi
@@ -102,15 +111,6 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
fi
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
TOOLCHAIN_CHECK_POSSIBLE_WIN_SDK_ROOT([C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Bin], [well-known name])
-
- if test "x$VS100COMNTOOLS" != x; then
- TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$VS100COMNTOOLS/../..], [VS100COMNTOOLS variable])
- fi
- if test "x$PROGRAMFILES" != x; then
- TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([$PROGRAMFILES/Microsoft Visual Studio 10.0], [well-known name])
- fi
- TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files/Microsoft Visual Studio 10.0], [well-known name])
- TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT([C:/Program Files (x86)/Microsoft Visual Studio 10.0], [well-known name])
])
# Check if the VS env variables were setup prior to running configure.
@@ -248,10 +248,23 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR])
fi
fi
+ # Try some fallback alternatives
if test "x$MSVCR_DLL" = x; then
- if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
- AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32])
- MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
+ # If visual studio express is installed, there is usually one with the debugger
+ if test "x$VS100COMNTOOLS" != x; then
+ if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
+ MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1`
+ AC_MSG_NOTICE([msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS..])
+ fi
+ fi
+ fi
+ if test "x$MSVCR_DLL" = x; then
+ if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
+ # Fallback for 32bit builds, look in the windows directory.
+ if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
+ AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32])
+ MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
+ fi
fi
fi
fi
diff --git a/common/makefiles/Jprt.gmk b/common/makefiles/Jprt.gmk
index c38dedce1f5..4b19dc45e38 100644
--- a/common/makefiles/Jprt.gmk
+++ b/common/makefiles/Jprt.gmk
@@ -127,9 +127,21 @@ else
ifdef ALT_JAVAFX_ZIP_DIR
@$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> $@.tmp
endif
+ ifdef ALT_JMC_ZIP_DIR
+ @$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> $@.tmp
+ endif
ifdef ALT_WIXDIR
@$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> $@.tmp
endif
+ ifdef ALT_INSTALL_LZMA_PATH
+ @$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> $@.tmp
+ endif
+ ifdef ALT_INSTALL_UPX_PATH
+ @$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> $@.tmp
+ endif
+ ifdef ALT_INSTALL_UPX_FILENAME
+ @$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> $@.tmp
+ endif
ifdef ALT_CCSS_SIGNING_DIR
@$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> $@.tmp
endif
diff --git a/common/makefiles/Main.gmk b/common/makefiles/Main.gmk
index d07f3e2b386..0120c1f33f3 100644
--- a/common/makefiles/Main.gmk
+++ b/common/makefiles/Main.gmk
@@ -183,7 +183,7 @@ bootcycle-images-only: start-make
test: images test-only
test-only: start-make
@$(call TargetEnter)
- @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
+ @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k JT_HOME=$(JT_HOME) MAKEFLAGS= PRODUCT_HOME=$(JDK_IMAGE_DIR) JPRT_JAVA_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
@$(call TargetExit)
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
diff --git a/common/makefiles/MakeBase.gmk b/common/makefiles/MakeBase.gmk
index 3cbdf79bae9..98a56f86cd1 100644
--- a/common/makefiles/MakeBase.gmk
+++ b/common/makefiles/MakeBase.gmk
@@ -361,8 +361,8 @@ $(eval $(call SetupLogging))
# This is to be called by all SetupFoo macros
define LogSetupMacroEntry
- $(if $(26),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
- $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25,$(if $($i),$(NEWLINE) $(strip [$i] $($i))))))
+ $(if $(27),$(error Internal makefile error: Too many arguments to LogSetupMacroEntry, please update MakeBase.gmk))
+ $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i))))))
endef
# Make directory without forking mkdir if not needed
diff --git a/common/makefiles/NativeCompilation.gmk b/common/makefiles/NativeCompilation.gmk
index c3b276609c3..227832c4c43 100644
--- a/common/makefiles/NativeCompilation.gmk
+++ b/common/makefiles/NativeCompilation.gmk
@@ -147,9 +147,9 @@ define SetupNativeCompilation
# CC the compiler to use, default is $(CC)
# LDEXE the linker to use for linking executables, default is $(LDEXE)
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
- $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
- $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25))
- $(if $(26),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
+ $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
+ $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
+ $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
ifneq (,$$($1_BIN))
$$(error BIN has been replaced with OBJECT_DIR)
@@ -567,6 +567,12 @@ define SetupNativeCompilation
ifneq (,$$($1_GEN_MANIFEST))
$(MT) -nologo -manifest $$($1_GEN_MANIFEST) -outputresource:$$@;#1
endif
-
+ # This only works if the openjdk_codesign identity is present on the system. Let
+ # silently fail otherwise.
+ ifneq (,$(CODESIGN))
+ ifneq (,$$($1_CODESIGN))
+ $(CODESIGN) -s openjdk_codesign $$@
+ endif
+ endif
endif
endef
diff --git a/corba/.hgtags b/corba/.hgtags
index af3629045ae..031e7ca843a 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -213,3 +213,5 @@ f1709874d55a06bc3d5dfa02dbcdfbc59f4cba34 jdk8-b87
fe4150590ee597f4e125fea950aa3b352622cc2d jdk8-b89
c8286839d0df04aba819ec4bef12b86babccf30e jdk8-b90
8f7ffb296385f85a4a6d53f9f2d4a7b13a8fa1ff jdk8-b91
+717aa26f8e0a1c0e768aebb3a763aca56db0c83e jdk8-b92
+8dc9d7ccbb2d77fd89bc321bb02e67c152aca257 jdk8-b93
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index f2fb4715f13..2f2c612f5d4 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -345,3 +345,7 @@ c4af77d2045476c56fbf3f914b336bb1b7cd18af hs25-b30
b19517cecc2e91636d7c16ba2f35e3d3dc628099 hs25-b33
7cbdf0e3725c0c56a2ff7540fc70b6d4b5890d04 jdk8-b91
38da9f4f67096745f851318d792d6468aa1f6cf8 hs25-b34
+092018493d3bbeb1c24278fd8c40ff3d76e1fed7 jdk8-b92
+573d86d412cd9d3df7912194c1a540be50e9544e jdk8-b93
+b786c04b7be15194febe88dc1f0c9443e737a84b hs25-b35
+3c78a14da19d26d6937af5f98b97e2a21c653b04 hs25-b36
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java
index be40fd44c51..301410408d2 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java
@@ -96,9 +96,10 @@ public class DictionaryEntry extends sun.jvm.hotspot.utilities.HashtableEntry {
public boolean containsProtectionDomain(Oop protectionDomain) {
InstanceKlass ik = (InstanceKlass) klass();
- if (protectionDomain.equals(ik.getProtectionDomain())) {
- return true; // Succeeds trivially
- }
+ // Currently unimplemented and not used.
+ // if (protectionDomain.equals(ik.getJavaMirror().getProtectionDomain())) {
+ // return true; // Succeeds trivially
+ // }
for (ProtectionDomainEntry current = pdSet(); current != null;
current = current.next()) {
if (protectionDomain.equals(current.protectionDomain())) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
index cfa26eacdbd..80d5b795b3f 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java
@@ -75,8 +75,6 @@ public class InstanceKlass extends Klass {
javaFieldsCount = new CIntField(type.getCIntegerField("_java_fields_count"), 0);
constants = new MetadataField(type.getAddressField("_constants"), 0);
classLoaderData = type.getAddressField("_class_loader_data");
- protectionDomain = new OopField(type.getOopField("_protection_domain"), 0);
- signers = new OopField(type.getOopField("_signers"), 0);
sourceFileName = type.getAddressField("_source_file_name");
sourceDebugExtension = type.getAddressField("_source_debug_extension");
innerClasses = type.getAddressField("_inner_classes");
@@ -136,8 +134,6 @@ public class InstanceKlass extends Klass {
private static CIntField javaFieldsCount;
private static MetadataField constants;
private static AddressField classLoaderData;
- private static OopField protectionDomain;
- private static OopField signers;
private static AddressField sourceFileName;
private static AddressField sourceDebugExtension;
private static AddressField innerClasses;
@@ -350,8 +346,6 @@ public class InstanceKlass extends Klass {
public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); }
public ClassLoaderData getClassLoaderData() { return ClassLoaderData.instantiateWrapperFor(classLoaderData.getValue(getAddress())); }
public Oop getClassLoader() { return getClassLoaderData().getClassLoader(); }
- public Oop getProtectionDomain() { return protectionDomain.getValue(this); }
- public ObjArray getSigners() { return (ObjArray) signers.getValue(this); }
public Symbol getSourceFileName() { return getSymbol(sourceFileName); }
public String getSourceDebugExtension(){ return CStringUtilities.getString(sourceDebugExtension.getValue(getAddress())); }
public long getNonstaticFieldSize() { return nonstaticFieldSize.getValue(this); }
@@ -541,8 +535,6 @@ public class InstanceKlass extends Klass {
// visitor.doOop(methods, true);
// visitor.doOop(localInterfaces, true);
// visitor.doOop(transitiveInterfaces, true);
- visitor.doOop(protectionDomain, true);
- visitor.doOop(signers, true);
visitor.doCInt(nonstaticFieldSize, true);
visitor.doCInt(staticFieldSize, true);
visitor.doCInt(staticOopFieldCount, true);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java
index f5058386662..47494e826b3 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java
@@ -204,13 +204,13 @@ public class HeapGXLWriter extends AbstractHeapGraphWriter {
Oop loader = ik.getClassLoader();
writeEdge(instance, loader, "loaded-by");
- // write signers
- Oop signers = ik.getSigners();
- writeEdge(instance, signers, "signed-by");
+ // write signers NYI
+ // Oop signers = ik.getJavaMirror().getSigners();
+ writeEdge(instance, null, "signed-by");
- // write protection domain
- Oop protectionDomain = ik.getProtectionDomain();
- writeEdge(instance, protectionDomain, "protection-domain");
+ // write protection domain NYI
+ // Oop protectionDomain = ik.getJavaMirror().getProtectionDomain();
+ writeEdge(instance, null, "protection-domain");
// write edges for static reference fields from this class
for (Iterator itr = refFields.iterator(); itr.hasNext();) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
index 58fd75ee8b8..65299721f17 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java
@@ -477,8 +477,8 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
if (k instanceof InstanceKlass) {
InstanceKlass ik = (InstanceKlass) k;
writeObjectID(ik.getClassLoader());
- writeObjectID(ik.getSigners());
- writeObjectID(ik.getProtectionDomain());
+ writeObjectID(null); // ik.getJavaMirror().getSigners());
+ writeObjectID(null); // ik.getJavaMirror().getProtectionDomain());
// two reserved id fields
writeObjectID(null);
writeObjectID(null);
@@ -516,8 +516,8 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter {
if (bottomKlass instanceof InstanceKlass) {
InstanceKlass ik = (InstanceKlass) bottomKlass;
writeObjectID(ik.getClassLoader());
- writeObjectID(ik.getSigners());
- writeObjectID(ik.getProtectionDomain());
+ writeObjectID(null); // ik.getJavaMirror().getSigners());
+ writeObjectID(null); // ik.getJavaMirror().getProtectionDomain());
} else {
writeObjectID(null);
writeObjectID(null);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java
index 7198e5cec14..a76e5ddbf31 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java
@@ -47,8 +47,6 @@ public class JSJavaInstanceKlass extends JSJavaKlass {
private static final int FIELD_IS_SYNTHETIC = 13;
private static final int FIELD_IS_INTERFACE = 14;
private static final int FIELD_CLASS_LOADER = 15;
- private static final int FIELD_PROTECTION_DOMAIN = 16;
- private static final int FIELD_SIGNERS = 17;
private static final int FIELD_STATICS = 18;
private static final int FIELD_UNDEFINED = -1;
@@ -100,10 +98,6 @@ public class JSJavaInstanceKlass extends JSJavaKlass {
return Boolean.valueOf(ik.isInterface());
case FIELD_CLASS_LOADER:
return factory.newJSJavaObject(ik.getClassLoader());
- case FIELD_PROTECTION_DOMAIN:
- return factory.newJSJavaObject(ik.getProtectionDomain());
- case FIELD_SIGNERS:
- return factory.newJSJavaObject(ik.getSigners());
case FIELD_STATICS:
return getStatics();
case FIELD_UNDEFINED:
@@ -246,8 +240,6 @@ public class JSJavaInstanceKlass extends JSJavaKlass {
addField("isSynthetic", FIELD_IS_SYNTHETIC);
addField("isInterface", FIELD_IS_INTERFACE);
addField("classLoader", FIELD_CLASS_LOADER);
- addField("protectionDomain", FIELD_PROTECTION_DOMAIN);
- addField("signers", FIELD_SIGNERS);
addField("statics", FIELD_STATICS);
}
diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make
index ceaa893ec8d..826d256b9eb 100644
--- a/hotspot/make/bsd/makefiles/adlc.make
+++ b/hotspot/make/bsd/makefiles/adlc.make
@@ -69,7 +69,7 @@ CXXFLAGS += -DASSERT
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
# Compiler warnings are treated as errors
ifneq ($(COMPILER_WARNINGS_FATAL),false)
- CFLAGS_WARN = -Werror
+ CFLAGS_WARN = $(WARNINGS_ARE_ERRORS)
endif
CFLAGS += $(CFLAGS_WARN)
diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make
index 858173bf203..64fa53441b8 100644
--- a/hotspot/make/bsd/makefiles/gcc.make
+++ b/hotspot/make/bsd/makefiles/gcc.make
@@ -71,6 +71,11 @@ ifeq ($(SPEC),)
CC = $(CC32)
endif
+ ifeq ($(USE_CLANG), true)
+ CXX = clang++
+ CC = clang
+ endif
+
HOSTCXX = $(CXX)
HOSTCC = $(CC)
endif
@@ -79,21 +84,79 @@ ifeq ($(SPEC),)
endif
-# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
-# prints the numbers (e.g. "2.95", "3.2.1")
-CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
-CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
-
-# check for precompiled headers support
-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
-# Allow the user to turn off precompiled headers from the command line.
-ifneq ($(USE_PRECOMPILED_HEADER),0)
-PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
-endif
+ifeq ($(USE_CLANG), true)
+ CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1)
+ CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2)
+else
+ # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
+ # prints the numbers (e.g. "2.95", "3.2.1")
+ CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
+ CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
endif
+ifeq ($(USE_CLANG), true)
+ # clang has precompiled headers support by default, but the user can switch
+ # it off by using 'USE_PRECOMPILED_HEADER=0'.
+ ifdef LP64
+ ifeq ($(USE_PRECOMPILED_HEADER),)
+ USE_PRECOMPILED_HEADER=1
+ endif
+ else
+ # We don't support precompiled headers on 32-bit builds because there some files are
+ # compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make)
+ # Clang produces an error if the PCH file was compiled with other options than the actual compilation unit.
+ USE_PRECOMPILED_HEADER=0
+ endif
+
+ ifeq ($(USE_PRECOMPILED_HEADER),1)
+
+ ifndef LP64
+ $(error " Precompiled Headers only supported on 64-bit platforms!")
+ endif
+
+ PRECOMPILED_HEADER_DIR=.
+ PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
+ PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.pch
+
+ PCH_FLAG = -include precompiled.hpp
+ PCH_FLAG/DEFAULT = $(PCH_FLAG)
+ PCH_FLAG/NO_PCH = -DNO_PCH
+ PCH_FLAG/BY_FILE = $(PCH_FLAG/$@)$(PCH_FLAG/DEFAULT$(PCH_FLAG/$@))
+
+ VM_PCH_FLAG/LIBJVM = $(PCH_FLAG/BY_FILE)
+ VM_PCH_FLAG/AOUT =
+ VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO))
+
+ # We only use precompiled headers for the JVM build
+ CFLAGS += $(VM_PCH_FLAG)
+
+ # There are some files which don't like precompiled headers
+ # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build.
+ # But Clang doesn't support a precompiled header which was compiled with -O3
+ # to be used in a compilation unit which uses '-O0'. We could also prepare an
+ # extra '-O0' PCH file for the opt build and use it here, but it's probably
+ # not worth the effort as long as only two files need this special handling.
+ PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH)
+ PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH)
+ PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH)
+
+ endif
+else # ($(USE_CLANG), true)
+ # check for precompiled headers support
+ ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+ # Allow the user to turn off precompiled headers from the command line.
+ ifneq ($(USE_PRECOMPILED_HEADER),0)
+ PRECOMPILED_HEADER_DIR=.
+ PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
+ PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+ endif
+ endif
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifeq ($(USE_PRECOMPILED_HEADER),0)
+ CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+endif
#------------------------------------------------------------------------
# Compiler flags
@@ -115,17 +178,31 @@ endif
CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions
-CFLAGS += -pthread
-CFLAGS += -fcheck-new
-# version 4 and above support fvisibility=hidden (matches jni_x86.h file)
-# except 4.1.2 gives pointless warnings that can't be disabled (afaik)
-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
-CFLAGS += -fvisibility=hidden
+ifeq ($(USE_CLANG),)
+ CFLAGS += -pthread
+ CFLAGS += -fcheck-new
+ # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
+ # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
+ ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ CFLAGS += -fvisibility=hidden
+ endif
+else
+ CFLAGS += -fvisibility=hidden
+endif
+
+ifeq ($(USE_CLANG), true)
+ # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
+ # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
+ ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
+ STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
+ else
+ STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
+ endif
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32 -march=i586
-ARCHFLAG/amd64 = -m64
+ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT)
ARCHFLAG/ia64 =
ARCHFLAG/sparc = -m32 -mcpu=v9
ARCHFLAG/sparcv9 = -m64 -mcpu=v9
@@ -163,14 +240,25 @@ ifneq ($(COMPILER_WARNINGS_FATAL),false)
WARNINGS_ARE_ERRORS = -Werror
endif
-# Except for a few acceptable ones
-# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
-# conversions which might affect the values. To avoid that, we need to turn
-# it off explicitly.
-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ifeq ($(USE_CLANG), true)
+ # However we need to clean the code up before we can unrestrictedly enable this option with Clang
+ WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
+ WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
+# Not yet supported by clang in Xcode 4.6.2
+# WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
+ WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
+ WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
+endif
+
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
-else
-WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
+
+ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+ # conversions which might affect the values. Only enable it in earlier versions.
+ WARNING_FLAGS = -Wunused-function
+ ifeq ($(USE_CLANG),)
+ WARNINGS_FLAGS += -Wconversion
+ endif
endif
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
@@ -214,14 +302,24 @@ endif
OPT_CFLAGS/NOOPT=-O0
-# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
-ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \))" "0"
-OPT_CFLAGS/mulnode.o += -O0
+# Work around some compiler bugs.
+ifeq ($(USE_CLANG), true)
+ ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
+ OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
+ endif
+else
+ # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
+ ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
+ OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
+ endif
endif
# Flags for generating make dependency flags.
-ifneq ("${CC_VER_MAJOR}", "2")
-DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+ifeq ($(USE_CLANG),)
+ ifneq ($(CC_VER_MAJOR), 2)
+ DEPFLAGS += -fpch-deps
+ endif
endif
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
@@ -249,13 +347,15 @@ endif
# statically link libstdc++.so, work with gcc but ignored by g++
STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
-ifneq ("${CC_VER_MAJOR}", "2")
-STATIC_LIBGCC += -static-libgcc
-endif
+ifeq ($(USE_CLANG),)
+ # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
+ ifneq ("${CC_VER_MAJOR}", "2")
+ STATIC_LIBGCC += -static-libgcc
+ endif
-ifeq ($(BUILDARCH), ia64)
-LFLAGS += -Wl,-relax
+ ifeq ($(BUILDARCH), ia64)
+ LFLAGS += -Wl,-relax
+ endif
endif
# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
@@ -296,25 +396,31 @@ endif
#------------------------------------------------------------------------
# Debug flags
-# Use the stabs format for debugging information (this is the default
-# on gcc-2.91). It's good enough, has all the information about line
-# numbers and local variables, and libjvm.so is only about 16M.
-# Change this back to "-g" if you want the most expressive format.
-# (warning: that could easily inflate libjvm.so to 150M!)
-# Note: The Itanium gcc compiler crashes when using -gstabs.
-DEBUG_CFLAGS/ia64 = -g
-DEBUG_CFLAGS/amd64 = -g
-DEBUG_CFLAGS/arm = -g
-DEBUG_CFLAGS/ppc = -g
-DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
-ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
-DEBUG_CFLAGS += -gstabs
+ifeq ($(USE_CLANG), true)
+ # Restrict the debug information created by Clang to avoid
+ # too big object files and speed the build up a little bit
+ # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
+ CFLAGS += -flimit-debug-info
endif
-# DEBUG_BINARIES overrides everything, use full -g debug information
+# DEBUG_BINARIES uses full -g debug information for all configs
ifeq ($(DEBUG_BINARIES), true)
- DEBUG_CFLAGS = -g
- CFLAGS += $(DEBUG_CFLAGS)
+ CFLAGS += -g
+else
+ # Use the stabs format for debugging information (this is the default
+ # on gcc-2.91). It's good enough, has all the information about line
+ # numbers and local variables, and libjvm.so is only about 16M.
+ # Change this back to "-g" if you want the most expressive format.
+ # (warning: that could easily inflate libjvm.so to 150M!)
+ # Note: The Itanium gcc compiler crashes when using -gstabs.
+ DEBUG_CFLAGS/ia64 = -g
+ DEBUG_CFLAGS/amd64 = -g
+ DEBUG_CFLAGS/arm = -g
+ DEBUG_CFLAGS/ppc = -g
+ DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
+ ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
+ DEBUG_CFLAGS += -gstabs
+ endif
endif
# If we are building HEADLESS, pass on to VM
diff --git a/hotspot/make/bsd/makefiles/vm.make b/hotspot/make/bsd/makefiles/vm.make
index f668b4e5334..7342ca3a1a7 100644
--- a/hotspot/make/bsd/makefiles/vm.make
+++ b/hotspot/make/bsd/makefiles/vm.make
@@ -126,7 +126,11 @@ ifneq ($(OS_VENDOR), Darwin)
LFLAGS += -Xlinker -z -Xlinker noexecstack
endif
-LIBS += -lm -pthread
+LIBS += -lm
+
+ifeq ($(USE_CLANG),)
+ LIBS += -pthread
+endif
# By default, link the *.o into the library, not the executable.
LINK_INTO$(LINK_INTO) = LIBJVM
diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make
index 93f68ee41c0..2ce60e0a656 100644
--- a/hotspot/make/excludeSrc.make
+++ b/hotspot/make/excludeSrc.make
@@ -25,7 +25,7 @@ ifeq ($(INCLUDE_JVMTI), false)
CXXFLAGS += -DINCLUDE_JVMTI=0
CFLAGS += -DINCLUDE_JVMTI=0
- Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
+ Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
@@ -87,7 +87,7 @@ ifeq ($(INCLUDE_ALL_GCS), false)
g1BlockOffsetTable.cpp g1CardCounts.cpp g1CollectedHeap.cpp g1CollectorPolicy.cpp \
g1ErgoVerbose.cpp g1GCPhaseTimes.cpp g1HRPrinter.cpp g1HotCardCache.cpp g1Log.cpp \
g1MMUTracker.cpp g1MarkSweep.cpp g1MemoryPool.cpp g1MonitoringSupport.cpp \
- g1RemSet.cpp g1SATBCardTableModRefBS.cpp g1_globals.cpp heapRegion.cpp \
+ g1RemSet.cpp g1RemSetSummary.cpp g1SATBCardTableModRefBS.cpp g1_globals.cpp heapRegion.cpp \
heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp \
ptrQueue.cpp satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp \
adjoiningGenerations.cpp adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp \
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index db74b20d81b..c88d7286682 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=34
+HS_BUILD_NUMBER=36
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make
index f1892d7d5cc..25ace2f5f76 100644
--- a/hotspot/make/linux/makefiles/adlc.make
+++ b/hotspot/make/linux/makefiles/adlc.make
@@ -68,7 +68,7 @@ CXXFLAGS += -DASSERT
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
# Compiler warnings are treated as errors
-CFLAGS_WARN = -Werror
+CFLAGS_WARN = $(WARNINGS_ARE_ERRORS)
CFLAGS += $(CFLAGS_WARN)
OBJECTNAMES = \
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index acbfc058835..6ef416dfbec 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -36,8 +36,14 @@ ifeq ($(SPEC),)
HOSTCC = gcc
STRIP = $(ALT_COMPILER_PATH)/strip
else
- CXX = g++
- CC = gcc
+ ifeq ($(USE_CLANG), true)
+ CXX = clang++
+ CC = clang
+ else
+ CXX = g++
+ CC = gcc
+ endif
+
HOSTCXX = $(CXX)
HOSTCC = $(CC)
STRIP = strip
@@ -46,19 +52,79 @@ ifeq ($(SPEC),)
endif
-# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
-# prints the numbers (e.g. "2.95", "3.2.1")
-CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
-CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
-
-# check for precompiled headers support
-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
-# Allow the user to turn off precompiled headers from the command line.
-ifneq ($(USE_PRECOMPILED_HEADER),0)
-PRECOMPILED_HEADER_DIR=.
-PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
-PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+ifeq ($(USE_CLANG), true)
+ CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1)
+ CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2)
+else
+ # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
+ # prints the numbers (e.g. "2.95", "3.2.1")
+ CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
+ CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
endif
+
+
+ifeq ($(USE_CLANG), true)
+ # Clang has precompiled headers support by default, but the user can switch
+ # it off by using 'USE_PRECOMPILED_HEADER=0'.
+ ifdef LP64
+ ifeq ($(USE_PRECOMPILED_HEADER),)
+ USE_PRECOMPILED_HEADER=1
+ endif
+ else
+ # We don't support precompiled headers on 32-bit builds because there some files are
+ # compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make)
+ # Clang produces an error if the PCH file was compiled with other options than the actual compilation unit.
+ USE_PRECOMPILED_HEADER=0
+ endif
+
+ ifeq ($(USE_PRECOMPILED_HEADER),1)
+
+ ifndef LP64
+ $(error " Precompiled Headers only supported on 64-bit platforms!")
+ endif
+
+ PRECOMPILED_HEADER_DIR=.
+ PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
+ PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.pch
+
+ PCH_FLAG = -include precompiled.hpp
+ PCH_FLAG/DEFAULT = $(PCH_FLAG)
+ PCH_FLAG/NO_PCH = -DNO_PCH
+ PCH_FLAG/BY_FILE = $(PCH_FLAG/$@)$(PCH_FLAG/DEFAULT$(PCH_FLAG/$@))
+
+ VM_PCH_FLAG/LIBJVM = $(PCH_FLAG/BY_FILE)
+ VM_PCH_FLAG/AOUT =
+ VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO))
+
+ # We only use precompiled headers for the JVM build
+ CFLAGS += $(VM_PCH_FLAG)
+
+ # There are some files which don't like precompiled headers
+ # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build.
+ # But Clang doesn't support a precompiled header which was compiled with -O3
+ # to be used in a compilation unit which uses '-O0'. We could also prepare an
+ # extra '-O0' PCH file for the opt build and use it here, but it's probably
+ # not worth the effoert as long as only two files need this special handling.
+ PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH)
+ PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH)
+ PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH)
+
+ endif
+else # ($(USE_CLANG), true)
+ # check for precompiled headers support
+ ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+ # Allow the user to turn off precompiled headers from the command line.
+ ifneq ($(USE_PRECOMPILED_HEADER),0)
+ PRECOMPILED_HEADER_DIR=.
+ PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
+ PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
+ endif
+ endif
+endif
+
+# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
+ifeq ($(USE_PRECOMPILED_HEADER),0)
+ CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
endif
@@ -83,16 +149,30 @@ CFLAGS += $(VM_PICFLAG)
CFLAGS += -fno-rtti
CFLAGS += -fno-exceptions
CFLAGS += -D_REENTRANT
-CFLAGS += -fcheck-new
-# version 4 and above support fvisibility=hidden (matches jni_x86.h file)
-# except 4.1.2 gives pointless warnings that can't be disabled (afaik)
-ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
-CFLAGS += -fvisibility=hidden
+ifeq ($(USE_CLANG),)
+ CFLAGS += -fcheck-new
+ # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
+ # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
+ ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ CFLAGS += -fvisibility=hidden
+ endif
+else
+ CFLAGS += -fvisibility=hidden
+endif
+
+ifeq ($(USE_CLANG), true)
+ # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
+ # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
+ ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
+ STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
+ else
+ STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
+ endif
endif
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
ARCHFLAG/i486 = -m32 -march=i586
-ARCHFLAG/amd64 = -m64
+ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT)
ARCHFLAG/ia64 =
ARCHFLAG/sparc = -m32 -mcpu=v9
ARCHFLAG/sparcv9 = -m64 -mcpu=v9
@@ -126,12 +206,22 @@ endif
# Compiler warnings are treated as errors
WARNINGS_ARE_ERRORS = -Werror
+ifeq ($(USE_CLANG), true)
+ # However we need to clean the code up before we can unrestrictedly enable this option with Clang
+ WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
+ WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare
+ WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
+ WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
+endif
+
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function
-# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
-# conversions which might affect the values. Only enable it in earlier versions.
-ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
-WARNING_FLAGS += -Wconversion
+ifeq ($(USE_CLANG),)
+ # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+ # conversions which might affect the values. Only enable it in earlier versions.
+ ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ WARNING_FLAGS += -Wconversion
+ endif
endif
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
@@ -165,19 +255,24 @@ endif
OPT_CFLAGS/NOOPT=-O0
-# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
-ifneq "$(shell expr \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) = 3 \) \))" "0"
-OPT_CFLAGS/mulnode.o += -O0
+# Work around some compiler bugs.
+ifeq ($(USE_CLANG), true)
+ ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
+ OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
+ endif
+else
+ # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
+ ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
+ OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
+ endif
endif
# Flags for generating make dependency flags.
-ifneq ("${CC_VER_MAJOR}", "2")
-DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
-endif
-
-# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
-ifeq ($(USE_PRECOMPILED_HEADER),0)
-CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
+DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
+ifeq ($(USE_CLANG),)
+ ifneq ("${CC_VER_MAJOR}", "2")
+ DEPFLAGS += -fpch-deps
+ endif
endif
#------------------------------------------------------------------------
@@ -186,24 +281,33 @@ endif
# statically link libstdc++.so, work with gcc but ignored by g++
STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
-ifneq ("${CC_VER_MAJOR}", "2")
-STATIC_LIBGCC += -static-libgcc
-endif
+ifeq ($(USE_CLANG),)
+ # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
+ ifneq ("${CC_VER_MAJOR}", "2")
+ STATIC_LIBGCC += -static-libgcc
+ endif
-ifeq ($(BUILDARCH), ia64)
-LFLAGS += -Wl,-relax
+ ifeq ($(BUILDARCH), ia64)
+ LFLAGS += -Wl,-relax
+ endif
endif
# Enable linker optimization
LFLAGS += -Xlinker -O1
-# If this is a --hash-style=gnu system, use --hash-style=both
-# The gnu .hash section won't work on some Linux systems like SuSE 10.
-_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu')
-ifneq ($(_HAS_HASH_STYLE_GNU),)
+ifeq ($(USE_CLANG),)
+ # If this is a --hash-style=gnu system, use --hash-style=both
+ # The gnu .hash section won't work on some Linux systems like SuSE 10.
+ _HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu')
+ ifneq ($(_HAS_HASH_STYLE_GNU),)
+ LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
+ endif
+else
+ # Don't know how to find out the 'hash style' of a system as '-dumpspecs'
+ # doesn't work for Clang. So for now we'll alwys use --hash-style=both
LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
endif
+
LFLAGS += $(LDFLAGS_HASH_STYLE)
# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
@@ -221,6 +325,13 @@ AOUT_FLAGS += -Xlinker -export-dynamic
#------------------------------------------------------------------------
# Debug flags
+ifeq ($(USE_CLANG), true)
+ # Restrict the debug information created by Clang to avoid
+ # too big object files and speed the build up a little bit
+ # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
+ CFLAGS += -flimit-debug-info
+endif
+
# DEBUG_BINARIES uses full -g debug information for all configs
ifeq ($(DEBUG_BINARIES), true)
CFLAGS += -g
@@ -237,7 +348,12 @@ else
DEBUG_CFLAGS/ppc = -g
DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
- DEBUG_CFLAGS += -gstabs
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't understand -gstabs
+ OPT_CFLAGS += -g
+ else
+ OPT_CFLAGS += -gstabs
+ endif
endif
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
@@ -247,7 +363,12 @@ else
FASTDEBUG_CFLAGS/ppc = -g
FASTDEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),)
- FASTDEBUG_CFLAGS += -gstabs
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't understand -gstabs
+ OPT_CFLAGS += -g
+ else
+ OPT_CFLAGS += -gstabs
+ endif
endif
OPT_CFLAGS/ia64 = -g
@@ -256,7 +377,12 @@ else
OPT_CFLAGS/ppc = -g
OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH))
ifeq ($(OPT_CFLAGS/$(BUILDARCH)),)
- OPT_CFLAGS += -gstabs
+ ifeq ($(USE_CLANG), true)
+ # Clang doesn't understand -gstabs
+ OPT_CFLAGS += -g
+ else
+ OPT_CFLAGS += -gstabs
+ endif
endif
endif
endif
diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
index 8a71d0923ab..5750e5f587f 100644
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
@@ -1065,7 +1065,7 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
const int slop_factor = 2*wordSize;
const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor?
- //6815692//Method::extra_stack_words() + // extra push slots for MH adapters
+ Method::extra_stack_entries() + // extra stack for jsr 292
frame::memory_parameter_word_sp_offset + // register save area + param window
(native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class
@@ -1221,9 +1221,7 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
// Full size expression stack
__ ld_ptr(constMethod, O3);
__ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3);
- guarantee(!EnableInvokeDynamic, "no support yet for java.lang.invoke.MethodHandle"); //6815692
- //6815692//if (EnableInvokeDynamic)
- //6815692// __ inc(O3, Method::extra_stack_entries());
+ __ inc(O3, Method::extra_stack_entries());
__ sll(O3, LogBytesPerWord, O3);
__ sub(O2, O3, O3);
// __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds
@@ -2084,9 +2082,7 @@ static int size_activation_helper(int callee_extra_locals, int max_stack, int mo
const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object
frame::memory_parameter_word_sp_offset; // register save area + param window
- const int extra_stack = 0; //6815692//Method::extra_stack_entries();
return (round_to(max_stack +
- extra_stack +
slop_factor +
fixed_size +
monitor_size +
@@ -2173,8 +2169,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill,
// Need +1 here because stack_base points to the word just above the first expr stack entry
// and stack_limit is supposed to point to the word just below the last expr stack entry.
// See generate_compute_interpreter_state.
- int extra_stack = 0; //6815692//Method::extra_stack_entries();
- to_fill->_stack_limit = stack_base - (method->max_stack() + 1 + extra_stack);
+ to_fill->_stack_limit = stack_base - (method->max_stack() + 1);
to_fill->_monitor_base = (BasicObjectLock*) monitor_base;
// sparc specific
diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
index d4f8b9b2341..9775d2f871a 100644
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
@@ -521,7 +521,7 @@ void InterpreterMacroAssembler::empty_expression_stack() {
// Compute max expression stack+register save area
ld_ptr(Lmethod, in_bytes(Method::const_offset()), Gframe_size);
lduh(Gframe_size, in_bytes(ConstMethod::max_stack_offset()), Gframe_size); // Load max stack.
- add( Gframe_size, frame::memory_parameter_word_sp_offset, Gframe_size );
+ add(Gframe_size, frame::memory_parameter_word_sp_offset+Method::extra_stack_entries(), Gframe_size );
//
// now set up a stack frame with the size computed above
diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
index d8281cadaec..135760ec0b4 100644
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -507,7 +507,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
const int extra_space =
rounded_vm_local_words + // frame local scratch space
- //6815692//Method::extra_stack_words() + // extra push slots for MH adapters
+ Method::extra_stack_entries() + // extra stack for jsr 292
frame::memory_parameter_word_sp_offset + // register save area
(native_call ? frame::interpreter_frame_extra_outgoing_argument_words : 0);
@@ -1558,7 +1558,6 @@ static int size_activation_helper(int callee_extra_locals, int max_stack, int mo
round_to(callee_extra_locals * Interpreter::stackElementWords, WordsPerLong);
const int max_stack_words = max_stack * Interpreter::stackElementWords;
return (round_to((max_stack_words
- //6815692//+ Method::extra_stack_words()
+ rounded_vm_local_words
+ frame::memory_parameter_word_sp_offset), WordsPerLong)
// already rounded
diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
index 08db8e074d0..1eef095b9a5 100644
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp
@@ -539,12 +539,11 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
// compute full expression stack limit
- const int extra_stack = 0; //6815692//Method::extra_stack_words();
__ movptr(rdx, Address(rbx, Method::const_offset()));
__ load_unsigned_short(rdx, Address(rdx, ConstMethod::max_stack_offset())); // get size of expression stack in words
__ negptr(rdx); // so we can subtract in next step
// Allocate expression stack
- __ lea(rsp, Address(rsp, rdx, Address::times_ptr, -extra_stack));
+ __ lea(rsp, Address(rsp, rdx, Address::times_ptr, -Method::extra_stack_words()));
__ movptr(STATE(_stack_limit), rsp);
}
@@ -692,10 +691,9 @@ void InterpreterGenerator::generate_stack_overflow_check(void) {
// Always give one monitor to allow us to start interp if sync method.
// Any additional monitors need a check when moving the expression stack
const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
- const int extra_stack = 0; //6815692//Method::extra_stack_entries();
__ movptr(rax, Address(rbx, Method::const_offset()));
__ load_unsigned_short(rax, Address(rax, ConstMethod::max_stack_offset())); // get size of expression stack in words
- __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), extra_stack + one_monitor));
+ __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor+Method::extra_stack_words()));
__ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size));
#ifdef ASSERT
@@ -2265,8 +2263,7 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
const int overhead_size = sizeof(BytecodeInterpreter)/wordSize +
( frame::sender_sp_offset - frame::link_offset) + 2;
- const int extra_stack = 0; //6815692//Method::extra_stack_entries();
- const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
+ const int method_stack = (method->max_locals() + method->max_stack()) *
Interpreter::stackElementWords;
return overhead_size + method_stack + stub_code;
}
@@ -2331,8 +2328,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill,
// Need +1 here because stack_base points to the word just above the first expr stack entry
// and stack_limit is supposed to point to the word just below the last expr stack entry.
// See generate_compute_interpreter_state.
- int extra_stack = 0; //6815692//Method::extra_stack_entries();
- to_fill->_stack_limit = stack_base - (method->max_stack() + extra_stack + 1);
+ to_fill->_stack_limit = stack_base - (method->max_stack() + 1);
to_fill->_monitor_base = (BasicObjectLock*) monitor_base;
to_fill->_self_link = to_fill;
@@ -2380,8 +2376,7 @@ int AbstractInterpreter::layout_activation(Method* method,
monitor_size);
// Now with full size expression stack
- int extra_stack = 0; //6815692//Method::extra_stack_entries();
- int full_frame_size = short_frame_size + (method->max_stack() + extra_stack) * BytesPerWord;
+ int full_frame_size = short_frame_size + method->max_stack() * BytesPerWord;
// and now with only live portion of the expression stack
short_frame_size = short_frame_size + tempcount * BytesPerWord;
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
index ca3ab92f2d0..3908a8c09da 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp
@@ -1565,8 +1565,7 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
// be sure to change this if you add/subtract anything to/from the overhead area
const int overhead_size = -frame::interpreter_frame_initial_sp_offset;
- const int extra_stack = Method::extra_stack_entries();
- const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
+ const int method_stack = (method->max_locals() + method->max_stack()) *
Interpreter::stackElementWords;
return overhead_size + method_stack + stub_code;
}
diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
index 4ad577ca4c9..50bb8a968f6 100644
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp
@@ -1574,8 +1574,7 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) {
-(frame::interpreter_frame_initial_sp_offset) + entry_size;
const int stub_code = frame::entry_frame_after_call_words;
- const int extra_stack = Method::extra_stack_entries();
- const int method_stack = (method->max_locals() + method->max_stack() + extra_stack) *
+ const int method_stack = (method->max_locals() + method->max_stack()) *
Interpreter::stackElementWords;
return (overhead_size + method_stack + stub_code);
}
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index f0b32196f5d..0eea30991a4 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -626,8 +626,6 @@ void os::Bsd::hotspot_sigmask(Thread* thread) {
//////////////////////////////////////////////////////////////////////////////
// create new thread
-static address highest_vm_reserved_address();
-
// check if it's safe to start a new thread
static bool _thread_safety_check(Thread* thread) {
return true;
@@ -935,10 +933,10 @@ jlong os::elapsed_frequency() {
return (1000 * 1000);
}
-// XXX: For now, code this as if BSD does not support vtime.
-bool os::supports_vtime() { return false; }
+bool os::supports_vtime() { return true; }
bool os::enable_vtime() { return false; }
bool os::vtime_enabled() { return false; }
+
double os::elapsedVTime() {
// better than nothing, but not much
return elapsedTime();
@@ -2112,10 +2110,6 @@ bool os::pd_release_memory(char* addr, size_t size) {
return anon_munmap(addr, size);
}
-static address highest_vm_reserved_address() {
- return _highest_vm_reserved_address;
-}
-
static bool bsd_mprotect(char* addr, size_t size, int prot) {
// Bsd wants the mprotect address argument to be page aligned.
char* bottom = (char*)align_size_down((intptr_t)addr, os::Bsd::page_size());
@@ -2159,43 +2153,6 @@ bool os::Bsd::hugetlbfs_sanity_check(bool warn, size_t page_size) {
return false;
}
-/*
-* Set the coredump_filter bits to include largepages in core dump (bit 6)
-*
-* From the coredump_filter documentation:
-*
-* - (bit 0) anonymous private memory
-* - (bit 1) anonymous shared memory
-* - (bit 2) file-backed private memory
-* - (bit 3) file-backed shared memory
-* - (bit 4) ELF header pages in file-backed private memory areas (it is
-* effective only if the bit 2 is cleared)
-* - (bit 5) hugetlb private memory
-* - (bit 6) hugetlb shared memory
-*/
-static void set_coredump_filter(void) {
- FILE *f;
- long cdm;
-
- if ((f = fopen("/proc/self/coredump_filter", "r+")) == NULL) {
- return;
- }
-
- if (fscanf(f, "%lx", &cdm) != 1) {
- fclose(f);
- return;
- }
-
- rewind(f);
-
- if ((cdm & LARGEPAGES_BIT) == 0) {
- cdm |= LARGEPAGES_BIT;
- fprintf(f, "%#lx", cdm);
- }
-
- fclose(f);
-}
-
// Large page support
static size_t _large_page_size = 0;
@@ -3030,6 +2987,19 @@ void os::Bsd::set_signal_handler(int sig, bool set_installed) {
sigAct.sa_sigaction = signalHandler;
sigAct.sa_flags = SA_SIGINFO|SA_RESTART;
}
+#if __APPLE__
+ // Needed for main thread as XNU (Mac OS X kernel) will only deliver SIGSEGV
+ // (which starts as SIGBUS) on main thread with faulting address inside "stack+guard pages"
+ // if the signal handler declares it will handle it on alternate stack.
+ // Notice we only declare we will handle it on alt stack, but we are not
+ // actually going to use real alt stack - this is just a workaround.
+ // Please see ux_exception.c, method catch_mach_exception_raise for details
+ // link http://www.opensource.apple.com/source/xnu/xnu-2050.18.24/bsd/uxkern/ux_exception.c
+ if (sig == SIGSEGV) {
+ sigAct.sa_flags |= SA_ONSTACK;
+ }
+#endif
+
// Save flags, which are set by ours
assert(sig > 0 && sig < MAXSIGNUM, "vm signal out of expected range");
sigflags[sig] = sigAct.sa_flags;
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index 4ca47019569..dbf30c48178 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -101,6 +101,12 @@
# include
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- *
- */
-final class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /** cache the contents of the xerces.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXercesProperties = null;
-
- /***
- * Cache the time stamp of the xerces.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- * This code is designed to implement the JAXP 1.1 spec pluggability
- * feature and is designed to run on JDK version 1.1 and
- * later, and to compile on JDK 1.2 and onward.
- * The code also runs both as part of an unbundled jar file and
- * when bundled as part of the JDK.
- *
- *
- */
-final class ObjectFactory {
-
- //
- // Constants
- //
-
- // name of default properties file to look for in JDK's jre/lib directory
- private static final String DEFAULT_PROPERTIES_FILENAME = "xerces.properties";
-
- /** Set to true for debugging */
- private static final boolean DEBUG = false;
-
- /**
- * Default columns per line.
- */
- private static final int DEFAULT_LINE_LENGTH = 80;
-
- /** cache the contents of the xerces.properties file.
- * Until an attempt has been made to read this file, this will
- * be null; if the file does not exist or we encounter some other error
- * during the read, this will be empty.
- */
- private static Properties fXercesProperties = null;
-
- /***
- * Cache the time stamp of the xerces.properties file so
- * that we know if it's been modified and can invalidate
- * the cache when necessary.
- */
- private static long fLastModified = -1;
-
- //
- // static methods
- //
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xerces.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- if (DEBUG) debugPrintln("debug is on");
-
- SecuritySupport ss = SecuritySupport.getInstance();
- ClassLoader cl = findClassLoader();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return newInstance(systemProp, cl, true);
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // JAXP specific change
- // always use fallback class to avoid the expense of constantly
- // "stat"ing a non-existent "xerces.properties" and jar SPI entry
- // see CR 6400863: Expensive creating of SAX parser in Mustang
- if (true) {
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- }
-
- // Try to read from propertiesFilename, or $java.home/lib/xerces.properties
- String factoryClassName = null;
- // no properties file name specified; use $JAVA_HOME/lib/xerces.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXercesProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXercesProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xerces.properties before (or it's outdeated)
- fXercesProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXercesProperties.load(fis);
- }
- } catch (Exception x) {
- fXercesProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXercesProperties != null) {
- factoryClassName = fXercesProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
- return newInstance(factoryClassName, cl, true);
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- } // createObject(String,String,String):Object
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xerces
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the package
- //restrict the access to package as speicified in java.security policy
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static final class ConfigurationError
- extends Error {
-
- /** Serialization version. */
- static final long serialVersionUID = 5061904944269807898L;
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId, String fallbackClassName)
- throws ConfigurationError {
- return createObject(factoryId, null, fallbackClassName);
- } // createObject(String,String):Object
-
- /**
- * Finds the implementation Class object in the specified order. The
- * specified order is the following:
- * System.getProperty
- * META-INF/services/factoryId
file
- *
- *
- *
- * @return Class object of factory, never null
- *
- * @param factoryId Name of the factory to find, same as
- * a property name
- * @param propertiesFilename The filename in the $java.home/lib directory
- * of the properties file. If none specified,
- * ${java.home}/lib/xerces.properties will be used.
- * @param fallbackClassName Implementation class name, if nothing else
- * is found. Use null to mean no fallback.
- *
- * @exception ObjectFactory.ConfigurationError
- */
- static Object createObject(String factoryId,
- String propertiesFilename,
- String fallbackClassName)
- throws ConfigurationError
- {
- if (DEBUG) debugPrintln("debug is on");
-
- SecuritySupport ss = SecuritySupport.getInstance();
- ClassLoader cl = findClassLoader();
-
- // Use the system property first
- try {
- String systemProp = ss.getSystemProperty(factoryId);
- if (systemProp != null) {
- if (DEBUG) debugPrintln("found system property, value=" + systemProp);
- return newInstance(systemProp, cl, true);
- }
- } catch (SecurityException se) {
- // Ignore and continue w/ next location
- }
-
- // JAXP specific change
- // always use fallback class to avoid the expense of constantly
- // "stat"ing a non-existent "xerces.properties" and jar SPI entry
- // see CR 6400863: Expensive creating of SAX parser in Mustang
- if (true) {
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- }
-
- // Try to read from propertiesFilename, or $java.home/lib/xerces.properties
- String factoryClassName = null;
- // no properties file name specified; use $JAVA_HOME/lib/xerces.properties:
- if (propertiesFilename == null) {
- File propertiesFile = null;
- boolean propertiesFileExists = false;
- try {
- String javah = ss.getSystemProperty("java.home");
- propertiesFilename = javah + File.separator +
- "lib" + File.separator + DEFAULT_PROPERTIES_FILENAME;
- propertiesFile = new File(propertiesFilename);
- propertiesFileExists = ss.getFileExists(propertiesFile);
- } catch (SecurityException e) {
- // try again...
- fLastModified = -1;
- fXercesProperties = null;
- }
-
- synchronized (ObjectFactory.class) {
- boolean loadProperties = false;
- FileInputStream fis = null;
- try {
- // file existed last time
- if(fLastModified >= 0) {
- if(propertiesFileExists &&
- (fLastModified < (fLastModified = ss.getLastModified(propertiesFile)))) {
- loadProperties = true;
- } else {
- // file has stopped existing...
- if(!propertiesFileExists) {
- fLastModified = -1;
- fXercesProperties = null;
- } // else, file wasn't modified!
- }
- } else {
- // file has started to exist:
- if(propertiesFileExists) {
- loadProperties = true;
- fLastModified = ss.getLastModified(propertiesFile);
- } // else, nothing's changed
- }
- if(loadProperties) {
- // must never have attempted to read xerces.properties before (or it's outdeated)
- fXercesProperties = new Properties();
- fis = ss.getFileInputStream(propertiesFile);
- fXercesProperties.load(fis);
- }
- } catch (Exception x) {
- fXercesProperties = null;
- fLastModified = -1;
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if(fXercesProperties != null) {
- factoryClassName = fXercesProperties.getProperty(factoryId);
- }
- } else {
- FileInputStream fis = null;
- try {
- fis = ss.getFileInputStream(new File(propertiesFilename));
- Properties props = new Properties();
- props.load(fis);
- factoryClassName = props.getProperty(factoryId);
- } catch (Exception x) {
- // assert(x instanceof FileNotFoundException
- // || x instanceof SecurityException)
- // In both cases, ignore and continue w/ next location
- }
- finally {
- // try to close the input stream if one was opened.
- if (fis != null) {
- try {
- fis.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
- }
- }
- if (factoryClassName != null) {
- if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
- return newInstance(factoryClassName, cl, true);
- }
-
- // Try Jar Service Provider Mechanism
- Object provider = findJarServiceProvider(factoryId);
- if (provider != null) {
- return provider;
- }
-
- if (fallbackClassName == null) {
- throw new ConfigurationError(
- "Provider for " + factoryId + " cannot be found", null);
- }
-
- if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
- return newInstance(fallbackClassName, cl, true);
- } // createObject(String,String,String):Object
-
- //
- // Private static methods
- //
-
- /** Prints a message to standard error if debugging is enabled. */
- private static void debugPrintln(String msg) {
- if (DEBUG) {
- System.err.println("JAXP: " + msg);
- }
- } // debugPrintln(String)
-
- /**
- * Figure out which ClassLoader to use. For JDK 1.2 and later use
- * the context ClassLoader.
- */
- static ClassLoader findClassLoader()
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
-
- // Figure out which ClassLoader to use for loading the provider
- // class. If there is a Context ClassLoader then use it.
- ClassLoader context = ss.getContextClassLoader();
- ClassLoader system = ss.getSystemClassLoader();
-
- ClassLoader chain = system;
- while (true) {
- if (context == chain) {
- // Assert: we are on JDK 1.1 or we have no Context ClassLoader
- // or any Context ClassLoader in chain of system classloader
- // (including extension ClassLoader) so extend to widest
- // ClassLoader (always look in system ClassLoader if Xerces
- // is in boot/extension/system classpath and in current
- // ClassLoader otherwise); normal classloaders delegate
- // back to system ClassLoader first so this widening doesn't
- // change the fact that context ClassLoader will be consulted
- ClassLoader current = ObjectFactory.class.getClassLoader();
-
- chain = system;
- while (true) {
- if (current == chain) {
- // Assert: Current ClassLoader in chain of
- // boot/extension/system ClassLoaders
- return system;
- }
- if (chain == null) {
- break;
- }
- chain = ss.getParentClassLoader(chain);
- }
-
- // Assert: Current ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return current;
- }
-
- if (chain == null) {
- // boot ClassLoader reached
- break;
- }
-
- // Check for any extension ClassLoaders in chain up to
- // boot ClassLoader
- chain = ss.getParentClassLoader(chain);
- };
-
- // Assert: Context ClassLoader not in chain of
- // boot/extension/system ClassLoaders
- return context;
- } // findClassLoader():ClassLoader
-
- /**
- * Create an instance of a class using the specified ClassLoader
- */
- static Object newInstance(String className, ClassLoader cl,
- boolean doFallback)
- throws ConfigurationError
- {
- // assert(className != null);
- try{
- Class providerClass = findProviderClass(className, cl, doFallback);
- Object instance = providerClass.newInstance();
- if (DEBUG) debugPrintln("created new instance of " + providerClass +
- " using ClassLoader: " + cl);
- return instance;
- } catch (ClassNotFoundException x) {
- throw new ConfigurationError(
- "Provider " + className + " not found", x);
- } catch (Exception x) {
- throw new ConfigurationError(
- "Provider " + className + " could not be instantiated: " + x,
- x);
- }
- }
-
- /**
- * Find a Class using the specified ClassLoader
- */
- static Class findProviderClass(String className, ClassLoader cl,
- boolean doFallback)
- throws ClassNotFoundException, ConfigurationError
- {
- //throw security exception if the calling thread is not allowed to access the package
- //restrict the access to package as speicified in java.security policy
- SecurityManager security = System.getSecurityManager();
- if (security != null) {
- final int lastDot = className.lastIndexOf(".");
- String packageName = className;
- if (lastDot != -1) packageName = className.substring(0, lastDot);
- security.checkPackageAccess(packageName);
- }
- Class providerClass;
- if (cl == null) {
- // XXX Use the bootstrap ClassLoader. There is no way to
- // load a class using the bootstrap ClassLoader that works
- // in both JDK 1.1 and Java 2. However, this should still
- // work b/c the following should be true:
- //
- // (cl == null) iff current ClassLoader == null
- //
- // Thus Class.forName(String) will use the current
- // ClassLoader which will be the bootstrap ClassLoader.
- providerClass = Class.forName(className);
- } else {
- try {
- providerClass = cl.loadClass(className);
- } catch (ClassNotFoundException x) {
- if (doFallback) {
- // Fall back to current classloader
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (current == null) {
- providerClass = Class.forName(className);
- } else if (cl != current) {
- cl = current;
- providerClass = cl.loadClass(className);
- } else {
- throw x;
- }
- } else {
- throw x;
- }
- }
- }
-
- return providerClass;
- }
-
- /*
- * Try to find provider using Jar Service Provider Mechanism
- *
- * @return instance of provider class if found or null
- */
- private static Object findJarServiceProvider(String factoryId)
- throws ConfigurationError
- {
- SecuritySupport ss = SecuritySupport.getInstance();
- String serviceId = "META-INF/services/" + factoryId;
- InputStream is = null;
-
- // First try the Context ClassLoader
- ClassLoader cl = findClassLoader();
-
- is = ss.getResourceAsStream(cl, serviceId);
-
- // If no provider found then try the current ClassLoader
- if (is == null) {
- ClassLoader current = ObjectFactory.class.getClassLoader();
- if (cl != current) {
- cl = current;
- is = ss.getResourceAsStream(cl, serviceId);
- }
- }
-
- if (is == null) {
- // No provider found
- return null;
- }
-
- if (DEBUG) debugPrintln("found jar resource=" + serviceId +
- " using ClassLoader: " + cl);
-
- // Read the service provider name in UTF-8 as specified in
- // the jar spec. Unfortunately this fails in Microsoft
- // VJ++, which does not implement the UTF-8
- // encoding. Theoretically, we should simply let it fail in
- // that case, since the JVM is obviously broken if it
- // doesn't support such a basic standard. But since there
- // are still some users attempting to use VJ++ for
- // development, we have dropped in a fallback which makes a
- // second attempt using the platform's default encoding. In
- // VJ++ this is apparently ASCII, which is a subset of
- // UTF-8... and since the strings we'll be reading here are
- // also primarily limited to the 7-bit ASCII range (at
- // least, in English versions), this should work well
- // enough to keep us on the air until we're ready to
- // officially decommit from VJ++. [Edited comment from
- // jkesselm]
- BufferedReader rd;
- try {
- rd = new BufferedReader(new InputStreamReader(is, "UTF-8"), DEFAULT_LINE_LENGTH);
- } catch (java.io.UnsupportedEncodingException e) {
- rd = new BufferedReader(new InputStreamReader(is), DEFAULT_LINE_LENGTH);
- }
-
- String factoryClassName = null;
- try {
- // XXX Does not handle all possible input as specified by the
- // Jar Service Provider specification
- factoryClassName = rd.readLine();
- } catch (IOException x) {
- // No provider found
- return null;
- }
- finally {
- try {
- // try to close the reader.
- rd.close();
- }
- // Ignore the exception.
- catch (IOException exc) {}
- }
-
- if (factoryClassName != null &&
- ! "".equals(factoryClassName)) {
- if (DEBUG) debugPrintln("found in resource, value="
- + factoryClassName);
-
- // Note: here we do not want to fall back to the current
- // ClassLoader because we want to avoid the case where the
- // resource file was found using one ClassLoader and the
- // provider class was instantiated using a different one.
- return newInstance(factoryClassName, cl, false);
- }
-
- // No provider found
- return null;
- }
-
- //
- // Classes
- //
-
- /**
- * A configuration error.
- */
- static final class ConfigurationError
- extends Error {
-
- /** Serialization version. */
- static final long serialVersionUID = 937647395548533254L;
-
- //
- // Data
- //
-
- /** Exception. */
- private Exception exception;
-
- //
- // Constructors
- //
-
- /**
- * Construct a new instance with the specified detail string and
- * exception.
- */
- ConfigurationError(String msg, Exception x) {
- super(msg);
- this.exception = x;
- } // System.getProperty
- * $java.home/lib/propertiesFilename
file
- * META-INF/services/factoryId
file
- *
setImplicitDownCycleTraversal
method.
*
- * By default, methods of this class with return a Component only if it is
+ * By default, methods of this class will return a Component only if it is
* visible, displayable, enabled, and focusable. Subclasses can modify this
* behavior by overriding the accept
method.
*
diff --git a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
index 68e1f52a221..f4199881989 100644
--- a/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
+++ b/jdk/src/share/classes/java/awt/DefaultKeyboardFocusManager.java
@@ -559,6 +559,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
} else {
restoreFocus(fe, newFocusedWindow);
}
+ setMostRecentFocusOwner(newFocusedWindow, null); // see: 8013773
}
break;
}
diff --git a/jdk/src/share/classes/java/awt/EventQueue.java b/jdk/src/share/classes/java/awt/EventQueue.java
index b9f96f995be..499b7c26272 100644
--- a/jdk/src/share/classes/java/awt/EventQueue.java
+++ b/jdk/src/share/classes/java/awt/EventQueue.java
@@ -37,16 +37,10 @@ import java.security.PrivilegedAction;
import java.util.EmptyStackException;
+import sun.awt.*;
import sun.awt.dnd.SunDropTargetEvent;
import sun.util.logging.PlatformLogger;
-import sun.awt.AppContext;
-import sun.awt.AWTAutoShutdown;
-import sun.awt.PeerEvent;
-import sun.awt.SunToolkit;
-import sun.awt.EventQueueItem;
-import sun.awt.AWTAccessor;
-
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.atomic.AtomicInteger;
@@ -186,6 +180,8 @@ public class EventQueue {
private final String name = "AWT-EventQueue-" + threadInitNumber.getAndIncrement();
+ private FwDispatcher fwDispatcher;
+
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
static {
@@ -214,6 +210,10 @@ public class EventQueue {
{
EventQueue.invokeAndWait(source, r);
}
+ public void setFwDispatcher(EventQueue eventQueue,
+ FwDispatcher dispatcher) {
+ eventQueue.setFwDispatcher(dispatcher);
+ }
});
}
@@ -690,7 +690,16 @@ public class EventQueue {
final Object src = event.getSource();
final PrivilegedAction This method is equivalent to the expression:
- * flush
, writes the closing
@@ -597,7 +614,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable {
"methodName") + " should not be null");
}
- if (target instanceof Field && methodName.equals("get")) {
+ if (isArgument && target instanceof Field && methodName.equals("get")) {
Field f = (Field)target;
writeln("");
diff --git a/jdk/src/share/classes/java/io/BufferedInputStream.java b/jdk/src/share/classes/java/io/BufferedInputStream.java
index fcc7e702db6..a161a988109 100644
--- a/jdk/src/share/classes/java/io/BufferedInputStream.java
+++ b/jdk/src/share/classes/java/io/BufferedInputStream.java
@@ -185,7 +185,7 @@ class BufferedInputStream extends FilterInputStream {
*
* @param in the underlying input stream.
* @param size the buffer size.
- * @exception IllegalArgumentException if size <= 0.
+ * @exception IllegalArgumentException if {@code size <= 0}.
*/
public BufferedInputStream(InputStream in, int size) {
super(in);
diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java
index d742233a0fd..ebf398078bf 100644
--- a/jdk/src/share/classes/java/io/BufferedReader.java
+++ b/jdk/src/share/classes/java/io/BufferedReader.java
@@ -95,7 +95,7 @@ public class BufferedReader extends Reader {
* @param in A Reader
* @param sz Input-buffer size
*
- * @exception IllegalArgumentException If sz is <= 0
+ * @exception IllegalArgumentException If {@code sz <= 0}
*/
public BufferedReader(Reader in, int sz) {
super(in);
@@ -484,7 +484,7 @@ public class BufferedReader extends Reader {
* whose size is no smaller than limit.
* Therefore large values should be used with care.
*
- * @exception IllegalArgumentException If readAheadLimit is < 0
+ * @exception IllegalArgumentException If {@code readAheadLimit < 0}
* @exception IOException If an I/O error occurs
*/
public void mark(int readAheadLimit) throws IOException {
diff --git a/jdk/src/share/classes/java/io/BufferedWriter.java b/jdk/src/share/classes/java/io/BufferedWriter.java
index 83a467e7266..01dfb175e82 100644
--- a/jdk/src/share/classes/java/io/BufferedWriter.java
+++ b/jdk/src/share/classes/java/io/BufferedWriter.java
@@ -95,7 +95,7 @@ public class BufferedWriter extends Writer {
* @param out A Writer
* @param sz Output-buffer size, a positive integer
*
- * @exception IllegalArgumentException If sz is <= 0
+ * @exception IllegalArgumentException If {@code sz <= 0}
*/
public BufferedWriter(Writer out, int sz) {
super(out);
diff --git a/jdk/src/share/classes/java/io/Console.java b/jdk/src/share/classes/java/io/Console.java
index c4987dc0934..c100f8a0ccd 100644
--- a/jdk/src/share/classes/java/io/Console.java
+++ b/jdk/src/share/classes/java/io/Console.java
@@ -75,7 +75,7 @@ import sun.nio.cs.StreamEncoder;
* manually zero the returned character array after processing to minimize the
* lifetime of sensitive data in memory.
*
- *
*
* @author Xueming Shen
* @since 1.6
diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java
index 1f1d044b1ab..4bc75fe5099 100644
--- a/jdk/src/share/classes/java/io/File.java
+++ b/jdk/src/share/classes/java/io/File.java
@@ -1899,14 +1899,20 @@ public class File
// file name generation
private static final SecureRandom random = new SecureRandom();
- static File generateFile(String prefix, String suffix, File dir) {
+ static File generateFile(String prefix, String suffix, File dir)
+ throws IOException
+ {
long n = random.nextLong();
if (n == Long.MIN_VALUE) {
n = 0; // corner case
} else {
n = Math.abs(n);
}
- return new File(dir, prefix + Long.toString(n) + suffix);
+ String name = prefix + Long.toString(n) + suffix;
+ File f = new File(dir, name);
+ if (!name.equals(f.getName()))
+ throw new IOException("Unable to create temporary file");
+ return f;
}
}
@@ -1988,25 +1994,21 @@ public class File
if (suffix == null)
suffix = ".tmp";
- File tmpdir = (directory != null) ? directory : TempDirectory.location();
- SecurityManager sm = System.getSecurityManager();
+ File tmpdir = (directory != null) ? directory
+ : TempDirectory.location();
File f;
- do {
- f = TempDirectory.generateFile(prefix, suffix, tmpdir);
- if (sm != null) {
- try {
- sm.checkWrite(f.getPath());
- } catch (SecurityException se) {
- // don't reveal temporary directory location
- if (directory == null)
- throw new SecurityException("Unable to create temporary file");
- throw se;
- }
- }
- if (f.isInvalid()) {
+ try {
+ do {
+ f = TempDirectory.generateFile(prefix, suffix, tmpdir);
+ } while (f.exists());
+ if (!f.createNewFile())
throw new IOException("Unable to create temporary file");
- }
- } while (!fs.createFileExclusively(f.getPath()));
+ } catch (SecurityException se) {
+ // don't reveal temporary directory location
+ if (directory == null)
+ throw new SecurityException("Unable to create temporary file");
+ throw se;
+ }
return f;
}
diff --git a/jdk/src/share/classes/java/io/PipedInputStream.java b/jdk/src/share/classes/java/io/PipedInputStream.java
index ca2115430d7..4ad8fbd81d8 100644
--- a/jdk/src/share/classes/java/io/PipedInputStream.java
+++ b/jdk/src/share/classes/java/io/PipedInputStream.java
@@ -117,7 +117,7 @@ public class PipedInputStream extends InputStream {
* @param src the stream to connect to.
* @param pipeSize the size of the pipe's buffer.
* @exception IOException if an I/O error occurs.
- * @exception IllegalArgumentException if
+ *
+ * }{@code
* Console cons;
* char[] passwd;
* if ((cons = System.console()) != null &&
@@ -83,7 +83,7 @@ import sun.nio.cs.StreamEncoder;
* ...
* java.util.Arrays.fill(passwd, ' ');
* }
- *
pipeSize <= 0
.
+ * @exception IllegalArgumentException if {@code pipeSize <= 0}.
* @since 1.6
*/
public PipedInputStream(PipedOutputStream src, int pipeSize)
@@ -147,7 +147,7 @@ public class PipedInputStream extends InputStream {
* connected} to a PipedOutputStream
before being used.
*
* @param pipeSize the size of the pipe's buffer.
- * @exception IllegalArgumentException if pipeSize <= 0
.
+ * @exception IllegalArgumentException if {@code pipeSize <= 0}.
* @since 1.6
*/
public PipedInputStream(int pipeSize) {
diff --git a/jdk/src/share/classes/java/io/PipedReader.java b/jdk/src/share/classes/java/io/PipedReader.java
index 95cfe1d7bd0..bb86022af6f 100644
--- a/jdk/src/share/classes/java/io/PipedReader.java
+++ b/jdk/src/share/classes/java/io/PipedReader.java
@@ -91,7 +91,7 @@ public class PipedReader extends Reader {
* @param src the stream to connect to.
* @param pipeSize the size of the pipe's buffer.
* @exception IOException if an I/O error occurs.
- * @exception IllegalArgumentException if pipeSize <= 0
.
+ * @exception IllegalArgumentException if {@code pipeSize <= 0}.
* @since 1.6
*/
public PipedReader(PipedWriter src, int pipeSize) throws IOException {
@@ -120,7 +120,7 @@ public class PipedReader extends Reader {
* before being used.
*
* @param pipeSize the size of the pipe's buffer.
- * @exception IllegalArgumentException if pipeSize <= 0
.
+ * @exception IllegalArgumentException if {@code pipeSize <= 0}.
* @since 1.6
*/
public PipedReader(int pipeSize) {
diff --git a/jdk/src/share/classes/java/io/PrintStream.java b/jdk/src/share/classes/java/io/PrintStream.java
index c4cd01f470f..b803c6a657f 100644
--- a/jdk/src/share/classes/java/io/PrintStream.java
+++ b/jdk/src/share/classes/java/io/PrintStream.java
@@ -851,7 +851,7 @@ public class PrintStream extends FilterOutputStream
* null argument depends on the conversion.
*
- * @throws IllegalFormatException
+ * @throws java.util.IllegalFormatException
* If a format string contains an illegal syntax, a format
* specifier that is incompatible with the given arguments,
* insufficient arguments given the format string, or other
@@ -901,7 +901,7 @@ public class PrintStream extends FilterOutputStream
* null argument depends on the conversion.
*
- * @throws IllegalFormatException
+ * @throws java.util.IllegalFormatException
* If a format string contains an illegal syntax, a format
* specifier that is incompatible with the given arguments,
* insufficient arguments given the format string, or other
@@ -944,7 +944,7 @@ public class PrintStream extends FilterOutputStream
* null argument depends on the conversion.
*
- * @throws IllegalFormatException
+ * @throws java.util.IllegalFormatException
* If a format string contains an illegal syntax, a format
* specifier that is incompatible with the given arguments,
* insufficient arguments given the format string, or other
@@ -1001,7 +1001,7 @@ public class PrintStream extends FilterOutputStream
* null argument depends on the conversion.
*
- * @throws IllegalFormatException
+ * @throws java.util.IllegalFormatException
* If a format string contains an illegal syntax, a format
* specifier that is incompatible with the given arguments,
* insufficient arguments given the format string, or other
diff --git a/jdk/src/share/classes/java/io/PushbackInputStream.java b/jdk/src/share/classes/java/io/PushbackInputStream.java
index af0b525a6f2..b81bec424bc 100644
--- a/jdk/src/share/classes/java/io/PushbackInputStream.java
+++ b/jdk/src/share/classes/java/io/PushbackInputStream.java
@@ -85,7 +85,7 @@ class PushbackInputStream extends FilterInputStream {
*
* @param in the input stream from which bytes will be read.
* @param size the size of the pushback buffer.
- * @exception IllegalArgumentException if size is <= 0
+ * @exception IllegalArgumentException if {@code size <= 0}
* @since JDK1.1
*/
public PushbackInputStream(InputStream in, int size) {
diff --git a/jdk/src/share/classes/java/io/PushbackReader.java b/jdk/src/share/classes/java/io/PushbackReader.java
index 2f5b18cfefc..98ebd5dab9c 100644
--- a/jdk/src/share/classes/java/io/PushbackReader.java
+++ b/jdk/src/share/classes/java/io/PushbackReader.java
@@ -47,7 +47,7 @@ public class PushbackReader extends FilterReader {
*
* @param in The reader from which characters will be read
* @param size The size of the pushback buffer
- * @exception IllegalArgumentException if size is <= 0
+ * @exception IllegalArgumentException if {@code size <= 0}
*/
public PushbackReader(Reader in, int size) {
super(in);
diff --git a/jdk/src/share/classes/java/io/StringReader.java b/jdk/src/share/classes/java/io/StringReader.java
index 3778408e5f4..0cdf8fd2197 100644
--- a/jdk/src/share/classes/java/io/StringReader.java
+++ b/jdk/src/share/classes/java/io/StringReader.java
@@ -163,7 +163,7 @@ public class StringReader extends Reader {
* is no actual limit, so this argument must not
* be negative, but is otherwise ignored.
*
- * @exception IllegalArgumentException If readAheadLimit is < 0
+ * @exception IllegalArgumentException If {@code readAheadLimit < 0}
* @exception IOException If an I/O error occurs
*/
public void mark(int readAheadLimit) throws IOException {
diff --git a/jdk/src/share/classes/java/lang/Character.java b/jdk/src/share/classes/java/lang/Character.java
index 531263d3894..e512e582612 100644
--- a/jdk/src/share/classes/java/lang/Character.java
+++ b/jdk/src/share/classes/java/lang/Character.java
@@ -4782,9 +4782,9 @@ class Character implements java.io.Serializable, Comparable
*
* @param high the high-surrogate code value to be tested
* @param low the low-surrogate code value to be tested
diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java
index 8d0205f54f1..f26eafd980a 100644
--- a/jdk/src/share/classes/java/lang/ClassLoader.java
+++ b/jdk/src/share/classes/java/lang/ClassLoader.java
@@ -702,7 +702,7 @@ public abstract class ClassLoader {
* bootstrap class loader. If name is not null, it
* must be equal to the binary name of the class
* specified by the byte array "b", otherwise a {@link
- * NoClassDefFoundError} will be thrown.
+ *
+ * }{@code
* isHighSurrogate(high) && isLowSurrogate(low)
- *
*
* For example, if one adds two keys a and b such that
- * (!a.equals(b) && a.compareTo(b) == 0) to a sorted
+ * {@code (!a.equals(b) && a.compareTo(b) == 0)} to a sorted
* set that does not use an explicit comparator, the second add
* operation returns false (and the size of the sorted set does not increase)
* because a and b are equivalent from the sorted set's
diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java
index a32d04cf75f..3f0e2cddd0f 100644
--- a/jdk/src/share/classes/java/lang/Double.java
+++ b/jdk/src/share/classes/java/lang/Double.java
@@ -917,13 +917,13 @@ public final class Double extends Number implements Comparable In all other cases, let s, e, and m be three
* values that can be computed from the argument:
*
- * In all other cases, let s, e, and m be three
* values that can be computed from the argument:
*
- *
- * The general contract of {@code hash32} is:
- *
- * If there is a security manager installed, the
- * If this thread is different from the current thread (that is, the current
- * thread is trying to stop a thread other than itself) or
- *
- * If the argument
- * The thread represented by this thread is forced to stop
- * whatever it is doing abnormally and to throw the
- *
- * It is permitted to stop a thread that has not yet been started.
- * If the thread is eventually started, it immediately terminates.
- *
- * @param obj the Throwable object to be thrown.
- * @exception SecurityException if the current thread cannot modify
- * this thread.
- * @throws NullPointerException if obj is null.
- * @see #interrupt()
- * @see #checkAccess()
- * @see #run()
- * @see #start()
- * @see #stop()
- * @see SecurityManager#checkAccess(Thread)
- * @see SecurityManager#checkPermission
- * @deprecated This method is inherently unsafe. See {@link #stop()}
- * for details. An additional danger of this
- * method is that it may be used to generate exceptions that the
- * target thread is unprepared to handle (including checked
- * exceptions that the thread could not possibly throw, were it
- * not for this method).
- * For more information, see
- * Why
- * are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
- */
- @Deprecated
- public final synchronized void stop(Throwable obj) {
- if (obj == null)
- throw new NullPointerException();
-
SecurityManager security = System.getSecurityManager();
if (security != null) {
checkAccess();
- if ((this != Thread.currentThread()) ||
- (!(obj instanceof ThreadDeath))) {
+ if (this != Thread.currentThread()) {
security.checkPermission(SecurityConstants.STOP_THREAD_PERMISSION);
}
}
@@ -884,7 +826,26 @@ class Thread implements Runnable {
}
// The VM can handle all thread states
- stop0(obj);
+ stop0(new ThreadDeath());
+ }
+
+ /**
+ * Throws {@code UnsupportedOperationException}.
+ *
+ * @param obj ignored
+ *
+ * @deprecated This method was originally designed to force a thread to stop
+ * and throw a given {@code Throwable} as an exception. It was
+ * inherently unsafe (see {@link #stop()} for details), and furthermore
+ * could be used to generate exceptions that the target thread was
+ * not prepared to handle.
+ * For more information, see
+ * Why
+ * are Thread.stop, Thread.suspend and Thread.resume Deprecated?.
+ */
+ @Deprecated
+ public final synchronized void stop(Throwable obj) {
+ throw new UnsupportedOperationException();
}
/**
diff --git a/jdk/src/share/classes/java/lang/instrument/Instrumentation.java b/jdk/src/share/classes/java/lang/instrument/Instrumentation.java
index 3d2083d6c61..1844837fd3b 100644
--- a/jdk/src/share/classes/java/lang/instrument/Instrumentation.java
+++ b/jdk/src/share/classes/java/lang/instrument/Instrumentation.java
@@ -593,24 +593,28 @@ public interface Instrumentation {
* and the normal automatic resolution. For
*
* Here are some simple examples of array-spreading method handles:
- *
* Here are some examples of array-collecting method handles:
- *
* Here is an example, of a list-making variable arity method handle:
- *
* Discussion:
* These rules are designed as a dynamically-typed variation
@@ -1134,7 +1134,7 @@ assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
* a previous argument to {@code asVarargsCollector}.
*
* Here is an example, of a list-making variable arity method handle:
- *
* MBeanServer access: The HTTP cookie management in java.net package looks like:
* See RFC 2965 sec. 3.3 & 7 for more detail.
+ * See RFC 2965 sec. 3.3 and 7 for more detail.
*
* @author Edward Wang
* @since 1.6
diff --git a/jdk/src/share/classes/java/net/DatagramSocket.java b/jdk/src/share/classes/java/net/DatagramSocket.java
index ad0af4850d5..d6ffca23755 100644
--- a/jdk/src/share/classes/java/net/DatagramSocket.java
+++ b/jdk/src/share/classes/java/net/DatagramSocket.java
@@ -334,12 +334,12 @@ class DatagramSocket implements java.io.Closeable {
}
/**
- * Binds this DatagramSocket to a specific address & port.
+ * Binds this DatagramSocket to a specific address and port.
*
* If the address is
- * @param addr The address & port to bind to.
+ * @param addr The address and port to bind to.
* @throws SocketException if any error happens during the bind, or if the
* socket is already bound.
* @throws SecurityException if a security manager exists and its
@@ -844,7 +844,7 @@ class DatagramSocket implements java.io.Closeable {
* a java.net.SocketTimeoutException is raised, though the
* DatagramSocket is still valid. The option must be enabled
* prior to entering the blocking operation to have effect. The
- * timeout must be > 0.
+ * timeout must be {@code > 0}.
* A timeout of zero is interpreted as an infinite timeout.
*
* @param timeout the specified timeout in milliseconds.
@@ -1101,8 +1101,8 @@ class DatagramSocket implements java.io.Closeable {
* As the underlying network implementation may ignore this
* value applications should consider it a hint.
*
- * The tc must be in the range The tc must be in the range {@code 0 <= tc <=
+ * 255} or an IllegalArgumentException will be thrown.
* Notes:
* For Internet Protocol v4 the value consists of an
* The ttl is an unsigned 8-bit quantity, and so must be
- * in the range
- * @param endpoint The IP address & port number to bind to.
+ * @param endpoint The IP address and port number to bind to.
* @throws IOException if the bind operation fails, or if the socket
* is already bound.
* @throws SecurityException if a The tc must be in the range The tc must be in the range {@code 0 <= tc <=
+ * 255} or an IllegalArgumentException will be thrown.
* Notes:
* For Internet Protocol v4 the value consists of an
* The value of this socket option is an {@code Integer} in the range
- * 0 <= value <= 255. It is used to control
- * the scope of multicast datagrams sent by the datagram-oriented socket.
+ * {@code 0 <= value <= 255}. It is used to control the scope of multicast
+ * datagrams sent by the datagram-oriented socket.
* In the case of an {@link StandardProtocolFamily#INET IPv4} socket
* the option is the time-to-live (TTL) on multicast datagrams sent by the
* socket. Datagrams with a TTL of zero are not transmitted on the network
diff --git a/jdk/src/share/classes/java/net/URI.java b/jdk/src/share/classes/java/net/URI.java
index b4b22ded16b..ed90f090c29 100644
--- a/jdk/src/share/classes/java/net/URI.java
+++ b/jdk/src/share/classes/java/net/URI.java
@@ -258,7 +258,7 @@ import java.lang.NullPointerException; // for javadoc
*
*
* Then the floating-point result equals the value of the mathematical
* expression s·m·2e-1075.
diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java
index 5b077111fe0..e46dff02a3b 100644
--- a/jdk/src/share/classes/java/lang/Float.java
+++ b/jdk/src/share/classes/java/lang/Float.java
@@ -821,13 +821,13 @@ public final class Float extends Number implements Comparable
- * int s = ((bits >> 63) == 0) ? 1 : -1;
- * int e = (int)((bits >> 52) & 0x7ffL);
+ *
+ * }{@code
+ * int s = ((bits >> 63) == 0) ? 1 : -1;
+ * int e = (int)((bits >> 52) & 0x7ffL);
* long m = (e == 0) ?
- * (bits & 0xfffffffffffffL) << 1 :
+ * (bits & 0xfffffffffffffL) << 1 :
* (bits & 0xfffffffffffffL) | 0x10000000000000L;
- *
*
* Then the floating-point result equals the value of the mathematical
* expression s·m·2e-150.
diff --git a/jdk/src/share/classes/java/lang/StackTraceElement.java b/jdk/src/share/classes/java/lang/StackTraceElement.java
index b973d0f4293..4543749bb00 100644
--- a/jdk/src/share/classes/java/lang/StackTraceElement.java
+++ b/jdk/src/share/classes/java/lang/StackTraceElement.java
@@ -181,12 +181,12 @@ public final class StackTraceElement implements java.io.Serializable {
* {@code StackTraceElement} instance representing the same execution
* point as this instance. Two stack trace elements {@code a} and
* {@code b} are equal if and only if:
- *
- * int s = ((bits >> 31) == 0) ? 1 : -1;
- * int e = ((bits >> 23) & 0xff);
+ *
+ * }{@code
+ * int s = ((bits >> 31) == 0) ? 1 : -1;
+ * int e = ((bits >> 23) & 0xff);
* int m = (e == 0) ?
- * (bits & 0x7fffff) << 1 :
+ * (bits & 0x7fffff) << 1 :
* (bits & 0x7fffff) | 0x800000;
- *
+ *
* where {@code equals} has the semantics of {@link
* java.util.Objects#equals(Object, Object) Objects.equals}.
*
diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java
index 748c8a4bbef..651a85017ed 100644
--- a/jdk/src/share/classes/java/lang/String.java
+++ b/jdk/src/share/classes/java/lang/String.java
@@ -3156,101 +3156,4 @@ public final class String
* guaranteed to be from a pool of unique strings.
*/
public native String intern();
-
- /**
- * Seed value used for each alternative hash calculated.
- */
- private static final int HASHING_SEED;
-
- static {
- long nanos = System.nanoTime();
- long now = System.currentTimeMillis();
- int SEED_MATERIAL[] = {
- System.identityHashCode(String.class),
- System.identityHashCode(System.class),
- (int) (nanos >>> 32),
- (int) nanos,
- (int) (now >>> 32),
- (int) now,
- (int) (System.nanoTime() >>> 2)
- };
-
- // Use murmur3 to scramble the seeding material.
- // Inline implementation to avoid loading classes
- int h1 = 0;
-
- // body
- for(int k1 : SEED_MATERIAL) {
- k1 *= 0xcc9e2d51;
- k1 = (k1 << 15) | (k1 >>> 17);
- k1 *= 0x1b873593;
-
- h1 ^= k1;
- h1 = (h1 << 13) | (h1 >>> 19);
- h1 = h1 * 5 + 0xe6546b64;
- }
-
- // tail (always empty, as body is always 32-bit chunks)
-
- // finalization
-
- h1 ^= SEED_MATERIAL.length * 4;
-
- // finalization mix force all bits of a hash block to avalanche
- h1 ^= h1 >>> 16;
- h1 *= 0x85ebca6b;
- h1 ^= h1 >>> 13;
- h1 *= 0xc2b2ae35;
- h1 ^= h1 >>> 16;
-
- HASHING_SEED = h1;
- }
-
- /**
- * Cached value of the hashing algorithm result
- */
- private transient int hash32 = 0;
-
- /**
- * Return a 32-bit hash code value for this object.
- * {@code
* equals(a.getFileName(), b.getFileName()) &&
* a.getLineNumber() == b.getLineNumber()) &&
* equals(a.getClassName(), b.getClassName()) &&
* equals(a.getMethodName(), b.getMethodName())
- *
+ * }
- *
- *
- * The hash value will never be zero.
- *
- * @return a hash code value for this object.
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public int hash32() {
- int h = hash32;
- if (0 == h) {
- // harmless data race on hash32 here.
- h = sun.misc.Hashing.murmur3_32(HASHING_SEED, value, 0, value.length);
-
- // ensure result is not zero to avoid recalcing
- h = (0 != h) ? h : 1;
-
- hash32 = h;
- }
-
- return h;
- }
-
}
diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java
index 81bebc58b21..bb175ff89ad 100644
--- a/jdk/src/share/classes/java/lang/Thread.java
+++ b/jdk/src/share/classes/java/lang/Thread.java
@@ -812,68 +812,10 @@ class Thread implements Runnable {
*/
@Deprecated
public final void stop() {
- stop(new ThreadDeath());
- }
-
- /**
- * Forces the thread to stop executing.
- * checkAccess
- * method of this thread is called, which may result in a
- * SecurityException
being raised (in the current thread).
- * obj
is not an instance of ThreadDeath
, the
- * security manager's checkPermission
method (with the
- * RuntimePermission("stopThread")
argument) is called in
- * addition.
- * Again, this may result in throwing a
- * SecurityException
(in the current thread).
- * obj
is null, a
- * NullPointerException
is thrown (in the current thread).
- * Throwable
object obj
as an exception. This
- * is an unusual action to take; normally, the stop
method
- * that takes no arguments should be used.
- * RegisterNatives
, the JVM will attempt this
* association:
- *
- * method(foo) -> nativeImplementation(foo)
+ * {@code
+ * method(foo) -> nativeImplementation(foo)
+ * }
*
* When this fails, the resolution will be retried with
* the specified prefix prepended to the method name,
* yielding the correct resolution:
- *
- * method(wrapped_foo) -> nativeImplementation(foo)
+ * {@code
+ * method(wrapped_foo) -> nativeImplementation(foo)
+ * }
*
* For automatic resolution, the JVM will attempt:
- *
- * method(wrapped_foo) -> nativeImplementation(wrapped_foo)
+ * {@code
+ * method(wrapped_foo) -> nativeImplementation(wrapped_foo)
+ * }
*
* When this fails, the resolution will be retried with
* the specified prefix deleted from the implementation name,
* yielding the correct resolution:
- *
- * method(wrapped_foo) -> nativeImplementation(foo)
+ * {@code
+ * method(wrapped_foo) -> nativeImplementation(foo)
+ * }
*
* Note that since the prefix is only used when standard
* resolution fails, native methods can be wrapped selectively.
diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java
index 774faff5afb..06084056fb4 100644
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java
@@ -251,7 +251,7 @@ import java.util.logging.Logger;
*
* Usage examples
* Here are some examples of usage:
- *
* Each of the above calls to {@code invokeExact} or plain {@code invoke}
* generates a single invokevirtual instruction with
* the symbolic type descriptor indicated in the following comment.
@@ -754,7 +754,7 @@ public abstract class MethodHandle {
* (The array may also be null when zero elements are required.)
*
+ *
+ * }{@code
Object x, y; String s; int i;
MethodType mt; MethodHandle mh;
MethodHandles.Lookup lookup = MethodHandles.lookup();
@@ -287,7 +287,7 @@ mt = MethodType.methodType(void.class, String.class);
mh = lookup.findVirtual(java.io.PrintStream.class, "println", mt);
mh.invokeExact(System.out, "Hello, world.");
// invokeExact(Ljava/io/PrintStream;Ljava/lang/String;)V
- *
* @param arrayType usually {@code Object[]}, the type of the array argument from which to extract the spread arguments
* @param arrayLength the number of arguments to spread from an incoming array argument
* @return a new method handle which spreads its final array argument,
@@ -878,7 +878,7 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
* number of collected arguments, use {@link #asVarargsCollector asVarargsCollector} instead.
*
+ *
+ * }{@code
MethodHandle equals = publicLookup()
.findVirtual(String.class, "equals", methodType(boolean.class, Object.class));
assert( (boolean) equals.invokeExact("me", (Object)"me"));
@@ -790,7 +790,7 @@ MethodHandle caString3 = caToString.asCollector(char[].class, 3);
assertEquals("[A, B, C]", (String) caString3.invokeExact('A', 'B', 'C'));
MethodHandle caToString2 = caString3.asSpreader(char[].class, 2);
assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray()));
- *
* @param arrayType often {@code Object[]}, the type of the array argument which will collect the arguments
* @param arrayLength the number of arguments to collect into a new array argument
* @return a new method handle which collects some trailing argument
@@ -1041,7 +1041,7 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
* It may (or may not) return the original variable arity method handle.
*
+ *
+ * }{@code
MethodHandle deepToString = publicLookup()
.findStatic(Arrays.class, "deepToString", methodType(String.class, Object[].class));
assertEquals("[won]", (String) deepToString.invokeExact(new Object[]{"won"}));
@@ -904,7 +904,7 @@ MethodHandle longsToString = publicLookup()
.findStatic(Arrays.class, "toString", methodType(String.class, long[].class))
.asCollector(long[].class, 1);
assertEquals("[123]", (String) longsToString.invokeExact((long)123));
- *
*
+ *
+ * }{@code
MethodHandle deepToString = publicLookup()
.findStatic(Arrays.class, "deepToString", methodType(String.class, Object[].class));
MethodHandle ts1 = deepToString.asVarargsCollector(Object[].class);
@@ -1063,7 +1063,7 @@ assertEquals("[three, thee, tee]", asList.invoke((Object[])argv).toString());
List ls = (List) asList.invoke((Object)argv);
assertEquals(1, ls.size());
assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0)));
- *
*
* @return a new method handle which accepts only a fixed number of arguments
* @see #asVarargsCollector
diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java
index 91a4d016a37..d37c8e947d8 100644
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java
@@ -1574,7 +1574,7 @@ publicLookup().findVirtual(MethodHandle.class, "invoke", type)
* As in the case of {@link #dropArguments(MethodHandle,int,List) dropArguments},
* incoming arguments which are not mentioned in the reordering array
* are may be any type, as determined only by {@code newType}.
- *
+ *
+ * }{@code
MethodHandle asListVar = publicLookup()
.findStatic(Arrays.class, "asList", methodType(List.class, Object[].class))
.asVarargsCollector(Object[].class);
@@ -1153,7 +1153,7 @@ assertEquals("[three, thee, tee]", asListVar.invoke(argv).toString());
assertEquals("[three, thee, tee]", asListFix.invoke(argv).toString());
assertEquals(1, ((List) asListVar.invoke((Object)argv)).size());
assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
- *
* @param target the method handle to invoke after arguments are reordered
* @param newType the expected type of the new method handle
* @param reorder an index array which controls the reordering
diff --git a/jdk/src/share/classes/java/lang/management/MemoryUsage.java b/jdk/src/share/classes/java/lang/management/MemoryUsage.java
index c223c710728..4dc23c0fe46 100644
--- a/jdk/src/share/classes/java/lang/management/MemoryUsage.java
+++ b/jdk/src/share/classes/java/lang/management/MemoryUsage.java
@@ -72,8 +72,8 @@ import sun.management.MemoryUsageCompositeData;
* The amount of used and committed memory will always be less than
* or equal to max if max is defined.
* A memory allocation may fail if it attempts to increase the
- * used memory such that used > committed even
- * if used <= max would still be true (for example,
+ * used memory such that used > committed even
+ * if used <= max would still be true (for example,
* when the system is low on virtual memory).
*
*
diff --git a/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java b/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java
index 62463af44e4..e4142d3e439 100644
--- a/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java
+++ b/jdk/src/share/classes/java/lang/management/RuntimeMXBean.java
@@ -308,7 +308,7 @@ public interface RuntimeMXBean extends PlatformManagedObject {
*
*
+ *
+ * }{@code
import static java.lang.invoke.MethodHandles.*;
import static java.lang.invoke.MethodType.*;
...
@@ -1590,7 +1590,7 @@ assert(add.type().equals(intfn2));
MethodHandle twice = permuteArguments(add, intfn1, 0, 0);
assert(twice.type().equals(intfn1));
assert((int)twice.invokeExact(21) == 42);
- *
- * The mapped type of Map
diff --git a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java
index f804af1942f..30251d51f60 100644
--- a/jdk/src/share/classes/java/lang/management/ThreadMXBean.java
+++ b/jdk/src/share/classes/java/lang/management/ThreadMXBean.java
@@ -198,7 +198,7 @@ public interface ThreadMXBean extends PlatformManagedObject {
* null if the thread of the given ID is not alive or
* it does not exist.
*
- * @throws IllegalArgumentException if id <= 0.
+ * @throws IllegalArgumentException if {@code id <= 0}.
* @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
@@ -236,7 +236,7 @@ public interface ThreadMXBean extends PlatformManagedObject {
* with no stack trace, no locked monitor and no synchronizer info.
*
* @throws IllegalArgumentException if any element in the input array
- * ids is <= 0.
+ * ids is {@code <= 0}.
* @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
@@ -282,7 +282,7 @@ public interface ThreadMXBean extends PlatformManagedObject {
* null if the thread of the given ID is not alive or
* it does not exist.
*
- * @throws IllegalArgumentException if id <= 0.
+ * @throws IllegalArgumentException if {@code id <= 0}.
* @throws IllegalArgumentException if maxDepth is negative.
* @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
@@ -336,7 +336,7 @@ public interface ThreadMXBean extends PlatformManagedObject {
*
* @throws IllegalArgumentException if maxDepth is negative.
* @throws IllegalArgumentException if any element in the input array
- * ids is <= 0.
+ * ids is {@code <= 0}.
* @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
@@ -466,7 +466,7 @@ public interface ThreadMXBean extends PlatformManagedObject {
* and CPU time measurement is enabled;
* -1 otherwise.
*
- * @throws IllegalArgumentException if id <= 0 .
+ * @throws IllegalArgumentException if {@code id <= 0}.
* @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* other threads.
@@ -501,7 +501,7 @@ public interface ThreadMXBean extends PlatformManagedObject {
* and CPU time measurement is enabled;
* -1 otherwise.
*
- * @throws IllegalArgumentException if id <= 0 .
+ * @throws IllegalArgumentException if {@code id <= 0}.
* @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* other threads.
diff --git a/jdk/src/share/classes/java/net/CookieManager.java b/jdk/src/share/classes/java/net/CookieManager.java
index 90c7262b478..1ad4b6ee93a 100644
--- a/jdk/src/share/classes/java/net/CookieManager.java
+++ b/jdk/src/share/classes/java/net/CookieManager.java
@@ -41,7 +41,7 @@ import sun.util.logging.PlatformLogger;
*
*
- *
+ *
* {@code
* use
* CookieHandler <------- HttpURLConnection
* ^
@@ -58,7 +58,7 @@ import sun.util.logging.PlatformLogger;
* | impl
* |
* Internal in-memory implementation
- *
+ * }
*
null
, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
* 0 <= tc <=
- * 255
or an IllegalArgumentException will be thrown.
+ * integer
, the least significant 8 bits of which
diff --git a/jdk/src/share/classes/java/net/HttpURLConnection.java b/jdk/src/share/classes/java/net/HttpURLConnection.java
index 193b9cef1c1..b93f1e731bd 100644
--- a/jdk/src/share/classes/java/net/HttpURLConnection.java
+++ b/jdk/src/share/classes/java/net/HttpURLConnection.java
@@ -109,7 +109,7 @@ abstract public class HttpURLConnection extends URLConnection {
* server. In this case, {@link #getHeaderField(int) getHeaderField(0)} returns the status
* line, but getHeaderFieldKey(0)
returns null.
*
- * @param n an index, where n >=0.
+ * @param n an index, where {@code n >=0}.
* @return the key for the n
th header field,
* or null
if the key does not exist.
*/
@@ -260,7 +260,7 @@ abstract public class HttpURLConnection extends URLConnection {
* {@link #getHeaderFieldKey getHeaderFieldKey} method to iterate through all
* the headers in the message.
*
- * @param n an index, where n>=0.
+ * @param n an index, where {@code n>=0}.
* @return the value of the n
th header field,
* or null
if the value does not exist.
* @see java.net.HttpURLConnection#getHeaderFieldKey(int)
diff --git a/jdk/src/share/classes/java/net/InetSocketAddress.java b/jdk/src/share/classes/java/net/InetSocketAddress.java
index 4ad95043470..44604c664aa 100644
--- a/jdk/src/share/classes/java/net/InetSocketAddress.java
+++ b/jdk/src/share/classes/java/net/InetSocketAddress.java
@@ -389,7 +389,7 @@ public class InetSocketAddress
* Two instances of InetSocketAddress
represent the same
* address if both the InetAddresses (or hostnames if it is unresolved) and port
* numbers are equal.
- * If both addresses are unresolved, then the hostname & the port number
+ * If both addresses are unresolved, then the hostname and the port number
* are compared.
*
* Note: Hostnames are case insensitive. e.g. "FooBar" and "foobar" are
diff --git a/jdk/src/share/classes/java/net/MulticastSocket.java b/jdk/src/share/classes/java/net/MulticastSocket.java
index ad4c7566aa1..0a4d7c1023d 100644
--- a/jdk/src/share/classes/java/net/MulticastSocket.java
+++ b/jdk/src/share/classes/java/net/MulticastSocket.java
@@ -201,7 +201,7 @@ class MulticastSocket extends DatagramSocket {
* scope of the multicasts.
*
* 0 <= ttl <= 0xFF
.
+ * in the range {@code 0 <= ttl <= 0xFF }.
*
* @param ttl the time-to-live
* @exception IOException if an I/O exception occurs
diff --git a/jdk/src/share/classes/java/net/ServerSocket.java b/jdk/src/share/classes/java/net/ServerSocket.java
index 1d042afc221..0b69ad6a266 100644
--- a/jdk/src/share/classes/java/net/ServerSocket.java
+++ b/jdk/src/share/classes/java/net/ServerSocket.java
@@ -316,7 +316,7 @@ class ServerSocket implements java.io.Closeable {
* If the address is null
, then the system will pick up
* an ephemeral port and a valid local address to bind the socket.
* SecurityManager
is present and
@@ -343,7 +343,7 @@ class ServerSocket implements java.io.Closeable {
* or may choose to ignore the parameter altogther. The value provided
* should be greater than 0
. If it is less than or equal to
* 0
, then an implementation specific default will be used.
- * @param endpoint The IP address & port number to bind to.
+ * @param endpoint The IP address and port number to bind to.
* @param backlog requested maximum length of the queue of
* incoming connections.
* @throws IOException if the bind operation fails, or if the socket
@@ -638,7 +638,7 @@ class ServerSocket implements java.io.Closeable {
* a java.net.SocketTimeoutException is raised, though the
* ServerSocket is still valid. The option must be enabled
* prior to entering the blocking operation to have effect. The
- * timeout must be > 0.
+ * timeout must be {@code > 0}.
* A timeout of zero is interpreted as an infinite timeout.
* @param timeout the specified timeout, in milliseconds
* @exception SocketException if there is an error in
diff --git a/jdk/src/share/classes/java/net/Socket.java b/jdk/src/share/classes/java/net/Socket.java
index 17e0ace117f..8ab5e866ee2 100644
--- a/jdk/src/share/classes/java/net/Socket.java
+++ b/jdk/src/share/classes/java/net/Socket.java
@@ -1108,7 +1108,7 @@ class Socket implements java.io.Closeable {
* expires, a java.net.SocketTimeoutException is raised, though the
* Socket is still valid. The option must be enabled
* prior to entering the blocking operation to have effect. The
- * timeout must be > 0.
+ * timeout must be {@code > 0}.
* A timeout of zero is interpreted as an infinite timeout.
*
* @param timeout the specified timeout, in milliseconds.
@@ -1317,8 +1317,8 @@ class Socket implements java.io.Closeable {
* As the underlying network implementation may ignore this
* value applications should consider it a hint.
*
- * 0 <= tc <=
- * 255
or an IllegalArgumentException will be thrown.
+ * integer
, the least significant 8 bits of which
diff --git a/jdk/src/share/classes/java/net/StandardSocketOptions.java b/jdk/src/share/classes/java/net/StandardSocketOptions.java
index 9aeed2b5a28..84fedd804f1 100644
--- a/jdk/src/share/classes/java/net/StandardSocketOptions.java
+++ b/jdk/src/share/classes/java/net/StandardSocketOptions.java
@@ -277,8 +277,8 @@ public final class StandardSocketOptions {
* The time-to-live for Internet Protocol (IP) multicast datagrams.
*
* All alphanum characters together with those in the string
* "_-!.~'()*"
*
+ * punct
- * The characters in the string ",;:$&+=" The characters in the string ",;:$&+="
*
diff --git a/jdk/src/share/classes/java/net/URLConnection.java b/jdk/src/share/classes/java/net/URLConnection.java
index f1c51880734..b69c00f94a3 100644
--- a/jdk/src/share/classes/java/net/URLConnection.java
+++ b/jdk/src/share/classes/java/net/URLConnection.java
@@ -662,7 +662,7 @@ public abstract class URLConnection {
* Returns the key for the reserved
* All punct characters together with those in the string
* "?/[]@" n
th header field.
* It returns null
if there are fewer than n+1
fields.
*
- * @param n an index, where n>=0
+ * @param n an index, where {@code n>=0}
* @return the key for the n
th header field,
* or null
if there are fewer than n+1
* fields.
@@ -680,7 +680,7 @@ public abstract class URLConnection {
* {@link #getHeaderFieldKey(int) getHeaderFieldKey} method to iterate through all
* the headers in the message.
*
- * @param n an index, where n>=0
+ * @param n an index, where {@code n>=0}
* @return the value of the n
th header field
* or null
if there are fewer than n+1
fields
* @see java.net.URLConnection#getHeaderFieldKey(int)
diff --git a/jdk/src/share/classes/java/nio/Buffer.java b/jdk/src/share/classes/java/nio/Buffer.java
index 24d3cf8c56a..068444a9758 100644
--- a/jdk/src/share/classes/java/nio/Buffer.java
+++ b/jdk/src/share/classes/java/nio/Buffer.java
@@ -209,7 +209,7 @@ public abstract class Buffer {
}
/**
- * Returns this buffer's capacity.
+ ** * except that it first checks that there are sufficient $type$s in - * this buffer and it is potentially much more efficient. + * this buffer and it is potentially much more efficient. * * @param dst * The array into which $type$s are to be written @@ -738,7 +739,7 @@ public abstract class $Type$Buffer * dst.put(src.get()); * * except that it first checks that there is sufficient space in this - * buffer and it is potentially much more efficient. + * buffer and it is potentially much more efficient. * * @param src * The source buffer from which $type$s are to be read; @@ -788,12 +789,13 @@ public abstract class $Type$Buffer * dst.put(src, off, len) has exactly the same effect as * the loop * - *{@code * for (int i = off; i < off + len; i++) - * dst[i] = src.get();+ * dst[i] = src.get(): + * }
+ ** * except that it first checks that there is sufficient space in this - * buffer and it is potentially much more efficient. + * buffer and it is potentially much more efficient. * * @param src * The array from which $type$s are to be read @@ -874,12 +876,13 @@ public abstract class $Type$Buffer * dst.put(src, start, end) has exactly the same effect * as the loop * - *{@code * for (int i = off; i < off + len; i++) - * dst.put(a[i]);+ * dst.put(a[i]); + * }
+ ** * except that it first checks that there is sufficient space in this - * buffer and it is potentially much more efficient. + * buffer and it is potentially much more efficient. * * @param src * The string from which $type$s are to be read @@ -1038,12 +1041,13 @@ public abstract class $Type$Buffer * write was incomplete. The following loop, for example, copies bytes * from one channel to another via the buffer buf: * - *{@code * for (int i = start; i < end; i++) - * dst.put(src.charAt(i));+ * dst.put(src.charAt(i)); + * }
* * @param src * a- * buf.clear(); // Prepare buffer for use - * while (in.read(buf) >= 0 || buf.position != 0) { - * buf.flip(); - * out.write(buf); - * buf.compact(); // In case of partial write + ** @return a Set (or an empty Set if none are marked critical) of * the extension OID strings for extensions that are marked critical. * If there are no extensions present at all, then this method returns diff --git a/jdk/src/share/classes/java/security/spec/EllipticCurve.java b/jdk/src/share/classes/java/security/spec/EllipticCurve.java index a270ee72494..d9eef25caf8 100644 --- a/jdk/src/share/classes/java/security/spec/EllipticCurve.java +++ b/jdk/src/share/classes/java/security/spec/EllipticCurve.java @@ -184,9 +184,9 @@ public class EllipticCurve { * Returns a hash code value for this elliptic curve. * @return a hash code value computed from the hash codes of the field, A, * and B, as follows: - ** #end[byte] @@ -1056,7 +1060,7 @@ public abstract class $Type$Buffer public abstract $Type$Buffer compact(); /** - * Tells whether or not this $type$ buffer is direct. + * Tells whether or not this $type$ buffer is direct. * * @return true if, and only if, this buffer is direct */ @@ -1065,7 +1069,7 @@ public abstract class $Type$Buffer #if[!char] /** - * Returns a string summarizing the state of this buffer. + * Returns a string summarizing the state of this buffer. * * @return A summary string */ @@ -1250,7 +1254,7 @@ public abstract class $Type$Buffer /** * Reads the character at the given index relative to the current - * position. + * position. * * @param index * The index of the character to be read, relative to the position; @@ -1448,7 +1452,7 @@ public abstract class $Type$Buffer } /** - * Modifies this buffer's byte order. + * Modifies this buffer's byte order. * * @param bo * The new byte order, diff --git a/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java b/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java index 59e398223f3..477855572b5 100644 --- a/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java +++ b/jdk/src/share/classes/java/nio/channels/AsynchronousServerSocketChannel.java @@ -253,7 +253,7 @@ public abstract class AsynchronousServerSocketChannel *{@code + * buf.clear(); // Prepare buffer for use + * while (in.read(buf) >= 0 || buf.position != 0) { + * buf.flip(); + * out.write(buf); + * buf.compact(); // In case of partial write + * } * }To allow for concurrent handling of new connections, the completion * handler is not invoked directly by the initiating thread when a new * connection is accepted immediately (see Threading). + * href="AsynchronousChannelGroup.html#threading">Threading). * *
If a security manager has been installed then it verifies that the * address and port number of the connection's remote endpoint are permitted diff --git a/jdk/src/share/classes/java/nio/channels/Channel.java b/jdk/src/share/classes/java/nio/channels/Channel.java index a20de123dfa..88d15ace67f 100644 --- a/jdk/src/share/classes/java/nio/channels/Channel.java +++ b/jdk/src/share/classes/java/nio/channels/Channel.java @@ -56,7 +56,7 @@ import java.io.Closeable; public interface Channel extends Closeable { /** - * Tells whether or not this channel is open.
+ * Tells whether or not this channel is open. * * @return true if, and only if, this channel is open */ diff --git a/jdk/src/share/classes/java/nio/channels/FileChannel.java b/jdk/src/share/classes/java/nio/channels/FileChannel.java index b9fe83db08b..02d9082d230 100644 --- a/jdk/src/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/share/classes/java/nio/channels/FileChannel.java @@ -418,7 +418,7 @@ public abstract class FileChannel // -- Other operations -- /** - * Returns this channel's file position. + * Returns this channel's file position. * * @return This channel's file position, * a non-negative integer counting the number of bytes @@ -461,7 +461,7 @@ public abstract class FileChannel public abstract FileChannel position(long newPosition) throws IOException; /** - * Returns the current size of this channel's file. + * Returns the current size of this channel's file. * * @return The current size of this channel's file, * measured in bytes diff --git a/jdk/src/share/classes/java/nio/channels/FileLock.java b/jdk/src/share/classes/java/nio/channels/FileLock.java index 019b90222fb..e978af43179 100644 --- a/jdk/src/share/classes/java/nio/channels/FileLock.java +++ b/jdk/src/share/classes/java/nio/channels/FileLock.java @@ -124,7 +124,7 @@ public abstract class FileLock implements AutoCloseable { private final boolean shared; /** - * Initializes a new instance of this class. + * Initializes a new instance of this class. * * @param channel * The file channel upon whose file this lock is held @@ -249,7 +249,7 @@ public abstract class FileLock implements AutoCloseable { } /** - * Tells whether this lock is shared. + * Tells whether this lock is shared. * * @return true if lock is shared, * false if it is exclusive @@ -259,7 +259,7 @@ public abstract class FileLock implements AutoCloseable { } /** - * Tells whether or not this lock overlaps the given lock range. + * Tells whether or not this lock overlaps the given lock range. * * @return true if, and only if, this lock and the given lock * range overlap by at least one byte diff --git a/jdk/src/share/classes/java/nio/channels/Pipe.java b/jdk/src/share/classes/java/nio/channels/Pipe.java index c4d7bce7452..af0722e99ab 100644 --- a/jdk/src/share/classes/java/nio/channels/Pipe.java +++ b/jdk/src/share/classes/java/nio/channels/Pipe.java @@ -53,7 +53,7 @@ import java.nio.channels.spi.*; public abstract class Pipe { /** - * A channel representing the readable end of a {@link Pipe}. + * A channel representing the readable end of a {@link Pipe}. * * @since 1.4 */ @@ -84,7 +84,7 @@ public abstract class Pipe { } /** - * A channel representing the writable end of a {@link Pipe}. + * A channel representing the writable end of a {@link Pipe}. * * @since 1.4 */ @@ -120,14 +120,14 @@ public abstract class Pipe { protected Pipe() { } /** - * Returns this pipe's source channel. + * Returns this pipe's source channel. * * @return This pipe's source channel */ public abstract SourceChannel source(); /** - * Returns this pipe's sink channel. + * Returns this pipe's sink channel. * * @return This pipe's sink channel */ diff --git a/jdk/src/share/classes/java/nio/channels/SelectableChannel.java b/jdk/src/share/classes/java/nio/channels/SelectableChannel.java index 8b7c7125786..7041c34e188 100644 --- a/jdk/src/share/classes/java/nio/channels/SelectableChannel.java +++ b/jdk/src/share/classes/java/nio/channels/SelectableChannel.java @@ -111,7 +111,7 @@ public abstract class SelectableChannel * identifying this channel's supported operations. The bits that are set * in this integer value denote exactly the operations that are valid for * this channel. This method always returns the same value for a given - * concrete channel class. + * concrete channel class. * * @return The valid-operation set */ @@ -140,7 +140,7 @@ public abstract class SelectableChannel /** * Retrieves the key representing the channel's registration with the given - * selector. + * selector. * * @return The key returned when this channel was last registered with the * given selector, or null if this channel is not @@ -208,7 +208,7 @@ public abstract class SelectableChannel * @throws IllegalArgumentException * If a bit in the ops set does not correspond to an * operation that is supported by this channel, that is, if - * set & ~validOps() != 0 + * {@code set & ~validOps() != 0} * * @return A key representing the registration of this channel with * the given selector @@ -265,8 +265,8 @@ public abstract class SelectableChannel * * @throws IllegalArgumentException * If a bit in ops does not correspond to an operation - * that is supported by this channel, that is, if set & - * ~validOps() != 0 + * that is supported by this channel, that is, if {@code set & + * ~validOps() != 0} * * @return A key representing the registration of this channel with * the given selector @@ -333,7 +333,6 @@ public abstract class SelectableChannel * configureBlocking} and {@link #register register} methods synchronize. * This is often useful in the implementation of adaptors that require a * specific blocking mode to be maintained for a short period of time. - * * * @return The blocking-mode lock object */ diff --git a/jdk/src/share/classes/java/nio/channels/SelectionKey.java b/jdk/src/share/classes/java/nio/channels/SelectionKey.java index ee339db09e9..7a0ab88ac3e 100644 --- a/jdk/src/share/classes/java/nio/channels/SelectionKey.java +++ b/jdk/src/share/classes/java/nio/channels/SelectionKey.java @@ -119,7 +119,7 @@ public abstract class SelectionKey { /** * Returns the channel for which this key was created. This method will - * continue to return the channel even after the key is cancelled. + * continue to return the channel even after the key is cancelled. * * @return This key's channel */ @@ -127,7 +127,7 @@ public abstract class SelectionKey { /** * Returns the selector for which this key was created. This method will - * continue to return the selector even after the key is cancelled. + * continue to return the selector even after the key is cancelled. * * @return This key's selector */ @@ -191,7 +191,7 @@ public abstract class SelectionKey { * @throws IllegalArgumentException * If a bit in the set does not correspond to an operation that * is supported by this key's channel, that is, if - * (ops & ~channel().validOps()) != 0 + * {@code (ops & ~channel().validOps()) != 0} * * @throws CancelledKeyException * If this key has been cancelled @@ -228,7 +228,7 @@ public abstract class SelectionKey { public static final int OP_READ = 1 << 0; /** - * Operation-set bit for write operations. + * Operation-set bit for write operations. * *Suppose that a selection key's interest set contains * OP_WRITE at the start of a + * Operation-set bit for socket-connect operations. * *
+ * Returns the provider that created this channel. * * @return The provider that created this channel */ diff --git a/jdk/src/share/classes/java/nio/channels/SocketChannel.java b/jdk/src/share/classes/java/nio/channels/SocketChannel.java index 185862cadb6..62033264904 100644 --- a/jdk/src/share/classes/java/nio/channels/SocketChannel.java +++ b/jdk/src/share/classes/java/nio/channels/SocketChannel.java @@ -302,7 +302,7 @@ public abstract class SocketChannel /** * Tells whether or not a connection operation is in progress on this - * channel. + * channel. * * @return true if, and only if, a connection operation has been * initiated on this channel but not yet completed by invoking the diff --git a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java index 70a0693f962..bf5a4d7c2bf 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelectionKey.java @@ -43,7 +43,7 @@ public abstract class AbstractSelectionKey { /** - * Initializes a new instance of this class. + * Initializes a new instance of this class. */ protected AbstractSelectionKey() { } diff --git a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java index daa10ad201d..fea4b0972e9 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java +++ b/jdk/src/share/classes/java/nio/channels/spi/AbstractSelector.java @@ -76,7 +76,7 @@ public abstract class AbstractSelector private final SelectorProvider provider; /** - * Initializes a new instance of this class. + * Initializes a new instance of this class. */ protected AbstractSelector(SelectorProvider provider) { this.provider = provider; diff --git a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java index 460e39ecbdc..62d4bf6ffc0 100644 --- a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java +++ b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java @@ -72,7 +72,7 @@ public abstract class SelectorProvider { private static SelectorProvider provider = null; /** - * Initializes a new instance of this class. + * Initializes a new instance of this class. * * @throws SecurityException * If a security manager has been installed and it denies @@ -180,7 +180,7 @@ public abstract class SelectorProvider { } /** - * Opens a datagram channel. + * Opens a datagram channel. * * @return The new channel */ @@ -206,7 +206,7 @@ public abstract class SelectorProvider { throws IOException; /** - * Opens a pipe. + * Opens a pipe. * * @return The new pipe */ @@ -214,7 +214,7 @@ public abstract class SelectorProvider { throws IOException; /** - * Opens a selector. + * Opens a selector. * * @return The new selector */ @@ -222,7 +222,7 @@ public abstract class SelectorProvider { throws IOException; /** - * Opens a server-socket channel. + * Opens a server-socket channel. * * @return The new channel */ @@ -230,7 +230,7 @@ public abstract class SelectorProvider { throws IOException; /** - * Opens a socket channel. + * Opens a socket channel. * * @return The new channel */ diff --git a/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template b/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template index 2449d56cf44..34be4eb8375 100644 --- a/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template +++ b/jdk/src/share/classes/java/nio/charset/Charset-X-Coder.java.template @@ -161,7 +161,7 @@ public abstract class Charset$Coder$ { /** * Initializes a new $coder$. The new $coder$ will have the given - * $otypes-per-itype$ and replacement values. + * $otypes-per-itype$ and replacement values. * * @param average$ItypesPerOtype$ * A positive float value indicating the expected number of @@ -207,7 +207,7 @@ public abstract class Charset$Coder$ { /** * Initializes a new $coder$. The new $coder$ will have the given * $otypes-per-itype$ values and its replacement will be the - * $replTypeName$ $defaultReplName$. + * $replTypeName$ $defaultReplName$. * * @param average$ItypesPerOtype$ * A positive float value indicating the expected number of @@ -230,7 +230,7 @@ public abstract class Charset$Coder$ { } /** - * Returns the charset that created this $coder$. + * Returns the charset that created this $coder$. * * @return This $coder$'s charset */ @@ -239,7 +239,7 @@ public abstract class Charset$Coder$ { } /** - * Returns this $coder$'s replacement value. + * Returns this $coder$'s replacement value. * * @return This $coder$'s current replacement, * which is never null and is never empty @@ -260,7 +260,7 @@ public abstract class Charset$Coder$ { * method, passing the new replacement, after checking that the new * replacement is acceptable. * - * @param newReplacement + * @param newReplacement The replacement value * #if[decoder] * The new replacement; must not be null @@ -305,7 +305,7 @@ public abstract class Charset$Coder$ { * should be overridden by $coder$s that require notification of changes to * the replacement. * - * @param newReplacement + * @param newReplacement The replacement value */ protected void implReplaceWith($replType$ newReplacement) { } @@ -351,7 +351,7 @@ public abstract class Charset$Coder$ { #end[encoder] /** - * Returns this $coder$'s current action for malformed-input errors. + * Returns this $coder$'s current action for malformed-input errors. * * @return The current malformed-input action, which is never null */ @@ -360,7 +360,7 @@ public abstract class Charset$Coder$ { } /** - * Changes this $coder$'s action for malformed-input errors. + * Changes this $coder$'s action for malformed-input errors. * *Suppose that a selection key's interest set contains * OP_CONNECT at the start of a + * Operation-set bit for socket-accept operations. * * + * Retrieves the current attachment. * * @return The object currently attached to this key, * or null if there is no attachment diff --git a/jdk/src/share/classes/java/nio/channels/Selector.java b/jdk/src/share/classes/java/nio/channels/Selector.java index f51b9ed9d2c..d4c200e6942 100644 --- a/jdk/src/share/classes/java/nio/channels/Selector.java +++ b/jdk/src/share/classes/java/nio/channels/Selector.java @@ -228,14 +228,14 @@ public abstract class Selector implements Closeable { } /** - * Tells whether or not this selector is open.
+ * Tells whether or not this selector is open. * * @return true if, and only if, this selector is open */ public abstract boolean isOpen(); /** - * Returns the provider that created this channel.This method invokes the {@link #implOnMalformedInput * implOnMalformedInput} method, passing the new action.
@@ -391,7 +391,6 @@ public abstract class Charset$Coder$ { /** * Returns this $coder$'s current action for unmappable-character errors. - * * * @return The current unmappable-character action, which is never * null @@ -435,7 +434,7 @@ public abstract class Charset$Coder$ { /** * Returns the average number of $otype$s that will be produced for each * $itype$ of input. This heuristic value may be used to estimate the size - * of the output buffer required for a given input sequence. + * of the output buffer required for a given input sequence. * * @return The average number of $otype$s produced * per $itype$ of input @@ -447,7 +446,7 @@ public abstract class Charset$Coder$ { /** * Returns the maximum number of $otype$s that will be produced for each * $itype$ of input. This value may be used to compute the worst-case size - * of the output buffer required for a given input sequence. + * of the output buffer required for a given input sequence. * * @return The maximum number of $otype$s that will be produced per * $itype$ of input diff --git a/jdk/src/share/classes/java/nio/charset/Charset.java b/jdk/src/share/classes/java/nio/charset/Charset.java index 9451c537a36..69c3ab0e19f 100644 --- a/jdk/src/share/classes/java/nio/charset/Charset.java +++ b/jdk/src/share/classes/java/nio/charset/Charset.java @@ -490,7 +490,7 @@ public abstract class Charset } /** - * Tells whether the named charset is supported. + * Tells whether the named charset is supported. * * @param charsetName * The name of the requested charset; may be either @@ -510,7 +510,7 @@ public abstract class Charset } /** - * Returns a charset object for the named charset. + * Returns a charset object for the named charset. * * @param charsetName * The name of the requested charset; may be either @@ -629,7 +629,7 @@ public abstract class Charset /** * Initializes a new charset with the given canonical name and alias - * set. + * set. * * @param canonicalName * The canonical name of this charset @@ -650,7 +650,7 @@ public abstract class Charset } /** - * Returns this charset's canonical name. + * Returns this charset's canonical name. * * @return The canonical name of this charset */ @@ -659,7 +659,7 @@ public abstract class Charset } /** - * Returns a set containing this charset's aliases. + * Returns a set containing this charset's aliases. * * @return An immutable set of this charset's aliases */ @@ -690,7 +690,7 @@ public abstract class Charset /** * Tells whether or not this charset is registered in the IANA Charset - * Registry. + * Registry. * * @return true if, and only if, this charset is known by its * implementor to be registered with the IANA @@ -742,14 +742,14 @@ public abstract class Charset public abstract boolean contains(Charset cs); /** - * Constructs a new decoder for this charset. + * Constructs a new decoder for this charset. * * @return A new decoder for this charset */ public abstract CharsetDecoder newDecoder(); /** - * Constructs a new encoder for this charset. + * Constructs a new encoder for this charset. * * @return A new encoder for this charset * @@ -881,7 +881,7 @@ public abstract class Charset } /** - * Computes a hashcode for this charset. + * Computes a hashcode for this charset. * * @return An integer hashcode */ @@ -907,7 +907,7 @@ public abstract class Charset } /** - * Returns a string describing this charset. + * Returns a string describing this charset. * * @return A string describing this charset */ diff --git a/jdk/src/share/classes/java/nio/charset/CoderResult.java b/jdk/src/share/classes/java/nio/charset/CoderResult.java index 00f29db07ef..5b2c4d41f89 100644 --- a/jdk/src/share/classes/java/nio/charset/CoderResult.java +++ b/jdk/src/share/classes/java/nio/charset/CoderResult.java @@ -71,7 +71,7 @@ import java.util.HashMap; * * * - * For convenience, the {@link #isError() isError} method returns true + *For convenience, the {@link #isError() isError} method returns true * for result objects that describe malformed-input and unmappable-character * errors but false for those that describe underflow or overflow * conditions.
@@ -112,7 +112,7 @@ public class CoderResult { } /** - * Tells whether or not this object describes an underflow condition. + * Tells whether or not this object describes an underflow condition. * * @return true if, and only if, this object denotes underflow */ @@ -121,7 +121,7 @@ public class CoderResult { } /** - * Tells whether or not this object describes an overflow condition. + * Tells whether or not this object describes an overflow condition. * * @return true if, and only if, this object denotes overflow */ @@ -130,7 +130,7 @@ public class CoderResult { } /** - * Tells whether or not this object describes an error condition. + * Tells whether or not this object describes an error condition. * * @return true if, and only if, this object denotes either a * malformed-input error or an unmappable-character error @@ -141,7 +141,6 @@ public class CoderResult { /** * Tells whether or not this object describes a malformed-input error. - * * * @return true if, and only if, this object denotes a * malformed-input error @@ -152,7 +151,7 @@ public class CoderResult { /** * Tells whether or not this object describes an unmappable-character - * error. + * error. * * @return true if, and only if, this object denotes an * unmappable-character error @@ -163,7 +162,7 @@ public class CoderResult { /** * Returns the length of the erroneous input described by this - * object (optional operation). + * object (optional operation). * * @return The length of the erroneous input, a positive integer * @@ -180,14 +179,14 @@ public class CoderResult { /** * Result object indicating underflow, meaning that either the input buffer * has been completely consumed or, if the input buffer is not yet empty, - * that additional input is required. + * that additional input is required. */ public static final CoderResult UNDERFLOW = new CoderResult(CR_UNDERFLOW, 0); /** * Result object indicating overflow, meaning that there is insufficient - * room in the output buffer. + * room in the output buffer. */ public static final CoderResult OVERFLOW = new CoderResult(CR_OVERFLOW, 0); @@ -226,7 +225,7 @@ public class CoderResult { /** * Static factory method that returns the unique object describing a - * malformed-input error of the given length. + * malformed-input error of the given length. * * @return The requested coder-result object */ @@ -242,7 +241,7 @@ public class CoderResult { /** * Static factory method that returns the unique result object describing - * an unmappable-character error of the given length. + * an unmappable-character error of the given length. * * @return The requested coder-result object */ @@ -252,7 +251,6 @@ public class CoderResult { /** * Throws an exception appropriate to the result described by this object. - * * * @throws BufferUnderflowException * If this object is {@link #UNDERFLOW} diff --git a/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java b/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java index 8c9cb2193b2..8ca30e4900b 100644 --- a/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java +++ b/jdk/src/share/classes/java/nio/charset/CodingErrorAction.java @@ -50,7 +50,7 @@ public class CodingErrorAction { /** * Action indicating that a coding error is to be handled by dropping the - * erroneous input and resuming the coding operation. + * erroneous input and resuming the coding operation. */ public static final CodingErrorAction IGNORE = new CodingErrorAction("IGNORE"); @@ -58,7 +58,7 @@ public class CodingErrorAction { /** * Action indicating that a coding error is to be handled by dropping the * erroneous input, appending the coder's replacement value to the output - * buffer, and resuming the coding operation. + * buffer, and resuming the coding operation. */ public static final CodingErrorAction REPLACE = new CodingErrorAction("REPLACE"); @@ -73,7 +73,7 @@ public class CodingErrorAction { = new CodingErrorAction("REPORT"); /** - * Returns a string describing this action. + * Returns a string describing this action. * * @return A descriptive string */ diff --git a/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java b/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java index 4af924fd1fc..5fa12476d68 100644 --- a/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java +++ b/jdk/src/share/classes/java/nio/charset/UnmappableCharacterException.java @@ -29,7 +29,7 @@ package java.nio.charset; /** * Checked exception thrown when an input character (or byte) sequence * is valid but cannot be mapped to an output byte (or character) - * sequence. + * sequence. * * @since 1.4 */ diff --git a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java index a4d646a86e2..3525e201d87 100644 --- a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java +++ b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java @@ -72,7 +72,7 @@ import java.util.Iterator; public abstract class CharsetProvider { /** - * Initializes a new charset provider. + * Initializes a new charset provider. * * @throws SecurityException * If a security manager has been installed and it denies @@ -88,14 +88,14 @@ public abstract class CharsetProvider { * Creates an iterator that iterates over the charsets supported by this * provider. This method is used in the implementation of the {@link * java.nio.charset.Charset#availableCharsets Charset.availableCharsets} - * method. + * method. * * @return The new iterator */ public abstract Iteratorcharsets(); /** - * Retrieves a charset for the given charset name. + * Retrieves a charset for the given charset name. * * @param charsetName * The name of the requested charset; may be either diff --git a/jdk/src/share/classes/java/nio/file/Path.java b/jdk/src/share/classes/java/nio/file/Path.java index a7933a34815..57782765854 100644 --- a/jdk/src/share/classes/java/nio/file/Path.java +++ b/jdk/src/share/classes/java/nio/file/Path.java @@ -64,7 +64,7 @@ import java.util.Iterator; * those developing custom file system implementations. Methods may be added to * this interface in future releases. * - * Accessing Files
+ *Accessing Files
*Paths may be used with the {@link Files} class to operate on files, * directories, and other types of files. For example, suppose we want a {@link * java.io.BufferedReader} to read text from a file "{@code access.log}". The @@ -87,7 +87,7 @@ import java.util.Iterator; * addition, the {@link #toFile toFile} method is useful to construct a {@code * File} from the {@code String} representation of a {@code Path}. * - *
Concurrency
+ *Concurrency
*Implementations of this interface are immutable and safe for use by * multiple concurrent threads. * diff --git a/jdk/src/share/classes/java/security/KeyStore.java b/jdk/src/share/classes/java/security/KeyStore.java index 5ed7de233e0..64bb4f261b5 100644 --- a/jdk/src/share/classes/java/security/KeyStore.java +++ b/jdk/src/share/classes/java/security/KeyStore.java @@ -317,7 +317,7 @@ public class KeyStore { * been specified by properties in the domain configuration data. * It is cloned to prevent subsequent modification. * - * @exception NullPointerExcetion if {@code configuration} or + * @exception NullPointerException if {@code configuration} or * {@code protectionParams} is {@code null} */ public DomainLoadStoreParameter(URI configuration, diff --git a/jdk/src/share/classes/java/security/SecureRandom.java b/jdk/src/share/classes/java/security/SecureRandom.java index 1b4872fa6eb..7d25b147ed3 100644 --- a/jdk/src/share/classes/java/security/SecureRandom.java +++ b/jdk/src/share/classes/java/security/SecureRandom.java @@ -466,7 +466,7 @@ public class SecureRandom extends java.util.Random { *
nextLong
, andnextFloat
). * * @param numBits number of pseudo-random bits to be generated, where - * 0 <=numBits
<= 32. + * {@code 0 <= numBits <= 32}. * * @return anint
containing the user-specified number * of pseudo-random bits (right justified, with leading zeros). diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java index 9eedb620d9a..03cae751a0f 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java @@ -141,8 +141,8 @@ public class CertPathValidatorException extends GeneralSecurityException { * that caused the error (or -1 if not applicable). Note that * the list of certificates in aCertPath
is zero based. * @throws IndexOutOfBoundsException if the index is out of range - *(index < -1 || (certPath != null && index >= - * certPath.getCertificates().size())
+ * {@code (index < -1 || (certPath != null && index >= + * certPath.getCertificates().size()) } * @throws IllegalArgumentException ifcertPath
is *null
andindex
is not -1 */ @@ -164,8 +164,8 @@ public class CertPathValidatorException extends GeneralSecurityException { * the list of certificates in aCertPath
is zero based. * @param reason the reason the validation failed * @throws IndexOutOfBoundsException if the index is out of range - *(index < -1 || (certPath != null && index >= - * certPath.getCertificates().size())
+ * {@code (index < -1 || (certPath != null && index >= + * certPath.getCertificates().size()) } * @throws IllegalArgumentException ifcertPath
is *null
andindex
is not -1 * @throws NullPointerException ifreason
isnull
diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactory.java b/jdk/src/share/classes/java/security/cert/CertificateFactory.java index 57a3fe15f45..d0762df16be 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateFactory.java +++ b/jdk/src/share/classes/java/security/cert/CertificateFactory.java @@ -65,7 +65,7 @@ import sun.security.jca.GetInstance.Instance; * read position of the input stream is positioned to the next certificate in * the file:* - *
+ ** *{@code * FileInputStream fis = new FileInputStream(filename); * BufferedInputStream bis = new BufferedInputStream(fis); * @@ -75,7 +75,7 @@ import sun.security.jca.GetInstance.Instance; * Certificate cert = cf.generateCertificate(bis); * System.out.println(cert.toString()); * } - *+ * }The following example parses a PKCS#7-formatted certificate reply stored * in a file and extracts all the certificates from it:
diff --git a/jdk/src/share/classes/java/security/cert/X509Extension.java b/jdk/src/share/classes/java/security/cert/X509Extension.java index e2c362ee3ff..ee63e662347 100644 --- a/jdk/src/share/classes/java/security/cert/X509Extension.java +++ b/jdk/src/share/classes/java/security/cert/X509Extension.java @@ -84,12 +84,12 @@ public interface X509Extension { * * Here is sample code to get a Set of critical extensions from an * X509Certificate and print the OIDs: - *
+ * }+ *
{@code * X509Certificate cert = null; * try (InputStream inStrm = new FileInputStream("DER-encoded-Cert")) { * CertificateFactory cf = CertificateFactory.getInstance("X.509"); * cert = (X509Certificate)cf.generateCertificate(inStrm); - * }+ * } * * Set
critSet = cert.getCriticalExtensionOIDs(); * if (critSet != null && !critSet.isEmpty()) { @@ -98,7 +98,7 @@ public interface X509Extension { * System.out.println(oid); * } * } - * + *
+ * } */ public int hashCode() { return (field.hashCode() << 6 + diff --git a/jdk/src/share/classes/java/sql/DatabaseMetaData.java b/jdk/src/share/classes/java/sql/DatabaseMetaData.java index 7330b8eac02..035365512b7 100644 --- a/jdk/src/share/classes/java/sql/DatabaseMetaData.java +++ b/jdk/src/share/classes/java/sql/DatabaseMetaData.java @@ -1218,21 +1218,21 @@ public interface DatabaseMetaData extends Wrapper { * *{@code * (field.hashCode() << 6) + (a.hashCode() << 4) + (b.hashCode() << 2) - *Each procedure description has the the following columns: *
- *
*- PROCEDURE_CAT String => procedure catalog (may be
null
) - *- PROCEDURE_SCHEM String => procedure schema (may be
null
) - *- PROCEDURE_NAME String => procedure name + *
- PROCEDURE_CAT String {@code =>} procedure catalog (may be
null
) + *- PROCEDURE_SCHEM String {@code =>} procedure schema (may be
null
) + *- PROCEDURE_NAME String {@code =>} procedure name *
- reserved for future use *
- reserved for future use *
- reserved for future use - *
- REMARKS String => explanatory comment on the procedure - *
- PROCEDURE_TYPE short => kind of procedure: + *
- REMARKS String {@code =>} explanatory comment on the procedure + *
- PROCEDURE_TYPE short {@code =>} kind of procedure: *
*
- *- procedureResultUnknown - Cannot determine if a return value * will be returned *
- procedureNoResult - Does not return a return value *
- procedureReturnsResult - Returns a return value *
- SPECIFIC_NAME String => The name which uniquely identifies this + *
- SPECIFIC_NAME String {@code =>} The name which uniquely identifies this * procedure within its schema. *
@@ -1297,11 +1297,11 @@ public interface DatabaseMetaData extends Wrapper { *
Each row in the
ResultSet
is a parameter description or * column description with the following fields: *- *
* *- PROCEDURE_CAT String => procedure catalog (may be
null
) - *- PROCEDURE_SCHEM String => procedure schema (may be
null
) - *- PROCEDURE_NAME String => procedure name - *
- COLUMN_NAME String => column/parameter name - *
- COLUMN_TYPE Short => kind of column/parameter: + *
- PROCEDURE_CAT String {@code =>} procedure catalog (may be
null
) + *- PROCEDURE_SCHEM String {@code =>} procedure schema (may be
null
) + *- PROCEDURE_NAME String {@code =>} procedure name + *
- COLUMN_NAME String {@code =>} column/parameter name + *
- COLUMN_TYPE Short {@code =>} kind of column/parameter: *
*
- *- procedureColumnUnknown - nobody knows *
- procedureColumnIn - IN parameter @@ -1310,44 +1310,44 @@ public interface DatabaseMetaData extends Wrapper { *
- procedureColumnReturn - procedure return value *
- procedureColumnResult - result column in
ResultSet
*- DATA_TYPE int => SQL type from java.sql.Types - *
- TYPE_NAME String => SQL type name, for a UDT type the + *
- DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
- TYPE_NAME String {@code =>} SQL type name, for a UDT type the * type name is fully qualified - *
- PRECISION int => precision - *
- LENGTH int => length in bytes of data - *
- SCALE short => scale - null is returned for data types where + *
- PRECISION int {@code =>} precision + *
- LENGTH int {@code =>} length in bytes of data + *
- SCALE short {@code =>} scale - null is returned for data types where * SCALE is not applicable. - *
- RADIX short => radix - *
- NULLABLE short => can it contain NULL. + *
- RADIX short {@code =>} radix + *
- NULLABLE short {@code =>} can it contain NULL. *
*
- *- procedureNoNulls - does not allow NULL values *
- procedureNullable - allows NULL values *
- procedureNullableUnknown - nullability unknown *
- REMARKS String => comment describing parameter/column - *
- COLUMN_DEF String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be
null
) + *- REMARKS String {@code =>} comment describing parameter/column + *
- COLUMN_DEF String {@code =>} default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be
null
) **
- *- The string NULL (not enclosed in quotes) - if NULL was specified as the default value *
- TRUNCATE (not enclosed in quotes) - if the specified default value cannot be represented without truncation *
- NULL - if a default value was not specified *
- SQL_DATA_TYPE int => reserved for future use - *
- SQL_DATETIME_SUB int => reserved for future use - *
- CHAR_OCTET_LENGTH int => the maximum length of binary and character based columns. For any other datatype the returned value is a + *
- SQL_DATA_TYPE int {@code =>} reserved for future use + *
- SQL_DATETIME_SUB int {@code =>} reserved for future use + *
- CHAR_OCTET_LENGTH int {@code =>} the maximum length of binary and character based columns. For any other datatype the returned value is a * NULL - *
- ORDINAL_POSITION int => the ordinal position, starting from 1, for the input and output parameters for a procedure. A value of 0 + *
- ORDINAL_POSITION int {@code =>} the ordinal position, starting from 1, for the input and output parameters for a procedure. A value of 0 *is returned if this row describes the procedure's return value. For result set columns, it is the *ordinal position of the column in the result set starting from 1. If there are *multiple result sets, the column ordinal positions are implementation * defined. - *
- IS_NULLABLE String => ISO rules are used to determine the nullability for a column. + *
- IS_NULLABLE String {@code =>} ISO rules are used to determine the nullability for a column. *
*
- *- YES --- if the column can include NULLs *
- NO --- if the column cannot include NULLs *
- empty string --- if the nullability for the * column is unknown *
- SPECIFIC_NAME String => the name which uniquely identifies this procedure within its schema. + *
- SPECIFIC_NAME String {@code =>} the name which uniquely identifies this procedure within its schema. *
Note: Some databases may not return the column @@ -1481,19 +1481,19 @@ public interface DatabaseMetaData extends Wrapper { *
* Each table description has the following columns: *
- *
@@ -1528,8 +1528,8 @@ public interface DatabaseMetaData extends Wrapper { * *- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- TABLE_TYPE String => table type. Typical types are "TABLE", + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- TABLE_TYPE String {@code =>} table type. Typical types are "TABLE", * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", * "LOCAL TEMPORARY", "ALIAS", "SYNONYM". - *
- REMARKS String => explanatory comment on the table - *
- TYPE_CAT String => the types catalog (may be
null
) - *- TYPE_SCHEM String => the types schema (may be
null
) - *- TYPE_NAME String => type name (may be
null
) - *- SELF_REFERENCING_COL_NAME String => name of the designated + *
- REMARKS String {@code =>} explanatory comment on the table + *
- TYPE_CAT String {@code =>} the types catalog (may be
null
) + *- TYPE_SCHEM String {@code =>} the types schema (may be
null
) + *- TYPE_NAME String {@code =>} type name (may be
null
) + *- SELF_REFERENCING_COL_NAME String {@code =>} name of the designated * "identifier" column of a typed table (may be
null
) - *- REF_GENERATION String => specifies how values in + *
- REF_GENERATION String {@code =>} specifies how values in * SELF_REFERENCING_COL_NAME are created. Values are * "SYSTEM", "USER", "DERIVED". (may be
null
) *The schema columns are: *
- *
* * @return a- TABLE_SCHEM String => schema name - *
- TABLE_CATALOG String => catalog name (may be
null
) + *- TABLE_SCHEM String {@code =>} schema name + *
- TABLE_CATALOG String {@code =>} catalog name (may be
null
) *ResultSet
object in which each row is a @@ -1545,7 +1545,7 @@ public interface DatabaseMetaData extends Wrapper { * *The catalog column is: *
- *
* * @return a- TABLE_CAT String => catalog name + *
- TABLE_CAT String {@code =>} catalog name *
ResultSet
object in which each row has a @@ -1560,7 +1560,7 @@ public interface DatabaseMetaData extends Wrapper { * *The table type is: *
- *
@@ -1582,55 +1582,55 @@ public interface DatabaseMetaData extends Wrapper { * *- TABLE_TYPE String => table type. Typical types are "TABLE", + *
- TABLE_TYPE String {@code =>} table type. Typical types are "TABLE", * "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", * "LOCAL TEMPORARY", "ALIAS", "SYNONYM". *
Each column description has the following columns: *
- *
- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- COLUMN_NAME String => column name - *
- DATA_TYPE int => SQL type from java.sql.Types - *
- TYPE_NAME String => Data source dependent type name, + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- COLUMN_NAME String {@code =>} column name + *
- DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
- TYPE_NAME String {@code =>} Data source dependent type name, * for a UDT the type name is fully qualified - *
- COLUMN_SIZE int => column size. + *
- COLUMN_SIZE int {@code =>} column size. *
- BUFFER_LENGTH is not used. - *
- DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where + *
- DECIMAL_DIGITS int {@code =>} the number of fractional digits. Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
- NUM_PREC_RADIX int => Radix (typically either 10 or 2) - *
- NULLABLE int => is NULL allowed. + *
- NUM_PREC_RADIX int {@code =>} Radix (typically either 10 or 2) + *
- NULLABLE int {@code =>} is NULL allowed. *
*
- *- columnNoNulls - might not allow
NULL
values *- columnNullable - definitely allows
NULL
values *- columnNullableUnknown - nullability unknown *
- REMARKS String => comment describing column (may be
null
) - *- COLUMN_DEF String => default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be
null
) - *- SQL_DATA_TYPE int => unused - *
- SQL_DATETIME_SUB int => unused - *
- CHAR_OCTET_LENGTH int => for char types the + *
- REMARKS String {@code =>} comment describing column (may be
null
) + *- COLUMN_DEF String {@code =>} default value for the column, which should be interpreted as a string when the value is enclosed in single quotes (may be
null
) + *- SQL_DATA_TYPE int {@code =>} unused + *
- SQL_DATETIME_SUB int {@code =>} unused + *
- CHAR_OCTET_LENGTH int {@code =>} for char types the * maximum number of bytes in the column - *
- ORDINAL_POSITION int => index of column in table + *
- ORDINAL_POSITION int {@code =>} index of column in table * (starting at 1) - *
- IS_NULLABLE String => ISO rules are used to determine the nullability for a column. + *
- IS_NULLABLE String {@code =>} ISO rules are used to determine the nullability for a column. *
*
- *- YES --- if the column can include NULLs *
- NO --- if the column cannot include NULLs *
- empty string --- if the nullability for the * column is unknown *
- SCOPE_CATALOG String => catalog of table that is the scope + *
- SCOPE_CATALOG String {@code =>} catalog of table that is the scope * of a reference attribute (
null
if DATA_TYPE isn't REF) - *- SCOPE_SCHEMA String => schema of table that is the scope + *
- SCOPE_SCHEMA String {@code =>} schema of table that is the scope * of a reference attribute (
null
if the DATA_TYPE isn't REF) - *- SCOPE_TABLE String => table name that this the scope + *
- SCOPE_TABLE String {@code =>} table name that this the scope * of a reference attribute (
null
if the DATA_TYPE isn't REF) - *- SOURCE_DATA_TYPE short => source type of a distinct type or user-generated + *
- SOURCE_DATA_TYPE short {@code =>} source type of a distinct type or user-generated * Ref type, SQL type from java.sql.Types (
null
if DATA_TYPE * isn't DISTINCT or user-generated REF) - *- IS_AUTOINCREMENT String => Indicates whether this column is auto incremented + *
- IS_AUTOINCREMENT String {@code =>} Indicates whether this column is auto incremented *
*
- *- YES --- if the column is auto incremented *
- NO --- if the column is not auto incremented *
- empty string --- if it cannot be determined whether the column is auto incremented *
- IS_GENERATEDCOLUMN String => Indicates whether this is a generated column + *
- IS_GENERATEDCOLUMN String {@code =>} Indicates whether this is a generated column *
*
- YES --- if this a generated column *
- NO --- if this not a generated column @@ -1703,15 +1703,15 @@ public interface DatabaseMetaData extends Wrapper { * *
Each privilige description has the following columns: *
- *
* @@ -1749,14 +1749,14 @@ public interface DatabaseMetaData extends Wrapper { * *- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- COLUMN_NAME String => column name - *
- GRANTOR String => grantor of access (may be
null
) - *- GRANTEE String => grantee of access - *
- PRIVILEGE String => name of access (SELECT, + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- COLUMN_NAME String {@code =>} column name + *
- GRANTOR String {@code =>} grantor of access (may be
null
) + *- GRANTEE String {@code =>} grantee of access + *
- PRIVILEGE String {@code =>} name of access (SELECT, * INSERT, UPDATE, REFRENCES, ...) - *
- IS_GRANTABLE String => "YES" if grantee is permitted + *
- IS_GRANTABLE String {@code =>} "YES" if grantee is permitted * to grant to others; "NO" if not;
null
if unknown *Each privilige description has the following columns: *
- *
* @@ -1783,21 +1783,21 @@ public interface DatabaseMetaData extends Wrapper { * *- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- GRANTOR String => grantor of access (may be
null
) - *- GRANTEE String => grantee of access - *
- PRIVILEGE String => name of access (SELECT, + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- GRANTOR String {@code =>} grantor of access (may be
null
) + *- GRANTEE String {@code =>} grantee of access + *
- PRIVILEGE String {@code =>} name of access (SELECT, * INSERT, UPDATE, REFRENCES, ...) - *
- IS_GRANTABLE String => "YES" if grantee is permitted + *
- IS_GRANTABLE String {@code =>} "YES" if grantee is permitted * to grant to others; "NO" if not;
null
if unknown *Each column description has the following columns: *
- *
- SCOPE short => actual scope of result + *
- SCOPE short {@code =>} actual scope of result *
*
- *- bestRowTemporary - very temporary, while using row *
- bestRowTransaction - valid for remainder of current transaction *
- bestRowSession - valid for remainder of current session *
- COLUMN_NAME String => column name - *
- DATA_TYPE int => SQL data type from java.sql.Types - *
- TYPE_NAME String => Data source dependent type name, + *
- COLUMN_NAME String {@code =>} column name + *
- DATA_TYPE int {@code =>} SQL data type from java.sql.Types + *
- TYPE_NAME String {@code =>} Data source dependent type name, * for a UDT the type name is fully qualified - *
- COLUMN_SIZE int => precision - *
- BUFFER_LENGTH int => not used - *
- DECIMAL_DIGITS short => scale - Null is returned for data types where + *
- COLUMN_SIZE int {@code =>} precision + *
- BUFFER_LENGTH int {@code =>} not used + *
- DECIMAL_DIGITS short {@code =>} scale - Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
- PSEUDO_COLUMN short => is this a pseudo column + *
- PSEUDO_COLUMN short {@code =>} is this a pseudo column * like an Oracle ROWID *
*
- bestRowUnknown - may or may not be pseudo column @@ -1902,15 +1902,15 @@ public interface DatabaseMetaData extends Wrapper { * *
Each column description has the following columns: *
- *
- SCOPE short => is not used - *
- COLUMN_NAME String => column name - *
- DATA_TYPE int => SQL data type from
java.sql.Types
- *- TYPE_NAME String => Data source-dependent type name - *
- COLUMN_SIZE int => precision - *
- BUFFER_LENGTH int => length of column value in bytes - *
- DECIMAL_DIGITS short => scale - Null is returned for data types where + *
- SCOPE short {@code =>} is not used + *
- COLUMN_NAME String {@code =>} column name + *
- DATA_TYPE int {@code =>} SQL data type from
java.sql.Types
+ *- TYPE_NAME String {@code =>} Data source-dependent type name + *
- COLUMN_SIZE int {@code =>} precision + *
- BUFFER_LENGTH int {@code =>} length of column value in bytes + *
- DECIMAL_DIGITS short {@code =>} scale - Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
- PSEUDO_COLUMN short => whether this is pseudo column + *
- PSEUDO_COLUMN short {@code =>} whether this is pseudo column * like an Oracle ROWID *
*
- versionColumnUnknown - may or may not be pseudo column @@ -1978,14 +1978,14 @@ public interface DatabaseMetaData extends Wrapper { * *
Each primary key column description has the following columns: *
- *
* * @param catalog a catalog name; must match the catalog name as it @@ -2012,22 +2012,22 @@ public interface DatabaseMetaData extends Wrapper { * *- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- COLUMN_NAME String => column name - *
- KEY_SEQ short => sequence number within primary key( a value + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- COLUMN_NAME String {@code =>} column name + *
- KEY_SEQ short {@code =>} sequence number within primary key( a value * of 1 represents the first column of the primary key, a value of 2 would * represent the second column within the primary key). - *
- PK_NAME String => primary key name (may be
null
) + *- PK_NAME String {@code =>} primary key name (may be
null
) *Each primary key column description has the following columns: *
- *
- PKTABLE_CAT String => primary key table catalog + *
- PKTABLE_CAT String {@code =>} primary key table catalog * being imported (may be
null
) - *- PKTABLE_SCHEM String => primary key table schema + *
- PKTABLE_SCHEM String {@code =>} primary key table schema * being imported (may be
null
) - *- PKTABLE_NAME String => primary key table name + *
- PKTABLE_NAME String {@code =>} primary key table name * being imported - *
- PKCOLUMN_NAME String => primary key column name + *
- PKCOLUMN_NAME String {@code =>} primary key column name * being imported - *
- FKTABLE_CAT String => foreign key table catalog (may be
null
) - *- FKTABLE_SCHEM String => foreign key table schema (may be
null
) - *- FKTABLE_NAME String => foreign key table name - *
- FKCOLUMN_NAME String => foreign key column name - *
- KEY_SEQ short => sequence number within a foreign key( a value + *
- FKTABLE_CAT String {@code =>} foreign key table catalog (may be
null
) + *- FKTABLE_SCHEM String {@code =>} foreign key table schema (may be
null
) + *- FKTABLE_NAME String {@code =>} foreign key table name + *
- FKCOLUMN_NAME String {@code =>} foreign key column name + *
- KEY_SEQ short {@code =>} sequence number within a foreign key( a value * of 1 represents the first column of the foreign key, a value of 2 would * represent the second column within the foreign key). - *
- UPDATE_RULE short => What happens to a + *
- UPDATE_RULE short {@code =>} What happens to a * foreign key when the primary key is updated: *
*
- *- importedNoAction - do not allow update of primary @@ -2041,7 +2041,7 @@ public interface DatabaseMetaData extends Wrapper { *
- importedKeyRestrict - same as importedKeyNoAction * (for ODBC 2.x compatibility) *
- DELETE_RULE short => What happens to + *
- DELETE_RULE short {@code =>} What happens to * the foreign key when primary is deleted. *
*
- *- importedKeyNoAction - do not allow delete of primary @@ -2054,9 +2054,9 @@ public interface DatabaseMetaData extends Wrapper { *
- importedKeySetDefault - change imported key to default if * its primary key has been deleted *
- FK_NAME String => foreign key name (may be
null
) - *- PK_NAME String => primary key name (may be
null
) - *- DEFERRABILITY short => can the evaluation of foreign key + *
- FK_NAME String {@code =>} foreign key name (may be
null
) + *- PK_NAME String {@code =>} primary key name (may be
null
) + *- DEFERRABILITY short {@code =>} can the evaluation of foreign key * constraints be deferred until commit *
*
- importedKeyInitiallyDeferred - see SQL92 for definition @@ -2195,22 +2195,22 @@ public interface DatabaseMetaData extends Wrapper { * *
Each foreign key column description has the following columns: *
- *
- PKTABLE_CAT String => primary key table catalog (may be
null
) - *- PKTABLE_SCHEM String => primary key table schema (may be
null
) - *- PKTABLE_NAME String => primary key table name - *
- PKCOLUMN_NAME String => primary key column name - *
- FKTABLE_CAT String => foreign key table catalog (may be
null
) + *- PKTABLE_CAT String {@code =>} primary key table catalog (may be
null
) + *- PKTABLE_SCHEM String {@code =>} primary key table schema (may be
null
) + *- PKTABLE_NAME String {@code =>} primary key table name + *
- PKCOLUMN_NAME String {@code =>} primary key column name + *
- FKTABLE_CAT String {@code =>} foreign key table catalog (may be
null
) * being exported (may benull
) - *- FKTABLE_SCHEM String => foreign key table schema (may be
null
) + *- FKTABLE_SCHEM String {@code =>} foreign key table schema (may be
null
) * being exported (may benull
) - *- FKTABLE_NAME String => foreign key table name + *
- FKTABLE_NAME String {@code =>} foreign key table name * being exported - *
- FKCOLUMN_NAME String => foreign key column name + *
- FKCOLUMN_NAME String {@code =>} foreign key column name * being exported - *
- KEY_SEQ short => sequence number within foreign key( a value + *
- KEY_SEQ short {@code =>} sequence number within foreign key( a value * of 1 represents the first column of the foreign key, a value of 2 would * represent the second column within the foreign key). - *
- UPDATE_RULE short => What happens to + *
- UPDATE_RULE short {@code =>} What happens to * foreign key when primary is updated: *
*
- *- importedNoAction - do not allow update of primary @@ -2224,7 +2224,7 @@ public interface DatabaseMetaData extends Wrapper { *
- importedKeyRestrict - same as importedKeyNoAction * (for ODBC 2.x compatibility) *
- DELETE_RULE short => What happens to + *
- DELETE_RULE short {@code =>} What happens to * the foreign key when primary is deleted. *
*
- *- importedKeyNoAction - do not allow delete of primary @@ -2237,9 +2237,9 @@ public interface DatabaseMetaData extends Wrapper { *
- importedKeySetDefault - change imported key to default if * its primary key has been deleted *
- FK_NAME String => foreign key name (may be
null
) - *- PK_NAME String => primary key name (may be
null
) - *- DEFERRABILITY short => can the evaluation of foreign key + *
- FK_NAME String {@code =>} foreign key name (may be
null
) + *- PK_NAME String {@code =>} primary key name (may be
null
) + *- DEFERRABILITY short {@code =>} can the evaluation of foreign key * constraints be deferred until commit *
*
- importedKeyInitiallyDeferred - see SQL92 for definition @@ -2276,22 +2276,22 @@ public interface DatabaseMetaData extends Wrapper { * *
Each foreign key column description has the following columns: *
- *
- PKTABLE_CAT String => parent key table catalog (may be
null
) - *- PKTABLE_SCHEM String => parent key table schema (may be
null
) - *- PKTABLE_NAME String => parent key table name - *
- PKCOLUMN_NAME String => parent key column name - *
- FKTABLE_CAT String => foreign key table catalog (may be
null
) + *- PKTABLE_CAT String {@code =>} parent key table catalog (may be
null
) + *- PKTABLE_SCHEM String {@code =>} parent key table schema (may be
null
) + *- PKTABLE_NAME String {@code =>} parent key table name + *
- PKCOLUMN_NAME String {@code =>} parent key column name + *
- FKTABLE_CAT String {@code =>} foreign key table catalog (may be
null
) * being exported (may benull
) - *- FKTABLE_SCHEM String => foreign key table schema (may be
null
) + *- FKTABLE_SCHEM String {@code =>} foreign key table schema (may be
null
) * being exported (may benull
) - *- FKTABLE_NAME String => foreign key table name + *
- FKTABLE_NAME String {@code =>} foreign key table name * being exported - *
- FKCOLUMN_NAME String => foreign key column name + *
- FKCOLUMN_NAME String {@code =>} foreign key column name * being exported - *
- KEY_SEQ short => sequence number within foreign key( a value + *
- KEY_SEQ short {@code =>} sequence number within foreign key( a value * of 1 represents the first column of the foreign key, a value of 2 would * represent the second column within the foreign key). - *
- UPDATE_RULE short => What happens to + *
- UPDATE_RULE short {@code =>} What happens to * foreign key when parent key is updated: *
*
- *- importedNoAction - do not allow update of parent @@ -2305,7 +2305,7 @@ public interface DatabaseMetaData extends Wrapper { *
- importedKeyRestrict - same as importedKeyNoAction * (for ODBC 2.x compatibility) *
- DELETE_RULE short => What happens to + *
- DELETE_RULE short {@code =>} What happens to * the foreign key when parent key is deleted. *
*
- *- importedKeyNoAction - do not allow delete of parent @@ -2318,9 +2318,9 @@ public interface DatabaseMetaData extends Wrapper { *
- importedKeySetDefault - change imported key to default if * its parent key has been deleted *
- FK_NAME String => foreign key name (may be
null
) - *- PK_NAME String => parent key name (may be
null
) - *- DEFERRABILITY short => can the evaluation of foreign key + *
- FK_NAME String {@code =>} foreign key name (may be
null
) + *- PK_NAME String {@code =>} parent key name (may be
null
) + *- DEFERRABILITY short {@code =>} can the evaluation of foreign key * constraints be deferred until commit *
*
- importedKeyInitiallyDeferred - see SQL92 for definition @@ -2371,40 +2371,40 @@ public interface DatabaseMetaData extends Wrapper { * *
Each type description has the following columns: *
- *
* *- TYPE_NAME String => Type name - *
- DATA_TYPE int => SQL data type from java.sql.Types - *
- PRECISION int => maximum precision - *
- LITERAL_PREFIX String => prefix used to quote a literal + *
- TYPE_NAME String {@code =>} Type name + *
- DATA_TYPE int {@code =>} SQL data type from java.sql.Types + *
- PRECISION int {@code =>} maximum precision + *
- LITERAL_PREFIX String {@code =>} prefix used to quote a literal * (may be
null
) - *- LITERAL_SUFFIX String => suffix used to quote a literal + *
- LITERAL_SUFFIX String {@code =>} suffix used to quote a literal (may be
null
) - *- CREATE_PARAMS String => parameters used in creating + *
- CREATE_PARAMS String {@code =>} parameters used in creating * the type (may be
null
) - *- NULLABLE short => can you use NULL for this type. + *
- NULLABLE short {@code =>} can you use NULL for this type. *
*
- *- typeNoNulls - does not allow NULL values *
- typeNullable - allows NULL values *
- typeNullableUnknown - nullability unknown *
- CASE_SENSITIVE boolean=> is it case sensitive. - *
- SEARCHABLE short => can you use "WHERE" based on this type: + *
- CASE_SENSITIVE boolean{@code =>} is it case sensitive. + *
- SEARCHABLE short {@code =>} can you use "WHERE" based on this type: *
*
- *- typePredNone - No support *
- typePredChar - Only supported with WHERE .. LIKE *
- typePredBasic - Supported except for WHERE .. LIKE *
- typeSearchable - Supported for all WHERE .. *
- UNSIGNED_ATTRIBUTE boolean => is it unsigned. - *
- FIXED_PREC_SCALE boolean => can it be a money value. - *
- AUTO_INCREMENT boolean => can it be used for an + *
- UNSIGNED_ATTRIBUTE boolean {@code =>} is it unsigned. + *
- FIXED_PREC_SCALE boolean {@code =>} can it be a money value. + *
- AUTO_INCREMENT boolean {@code =>} can it be used for an * auto-increment value. - *
- LOCAL_TYPE_NAME String => localized version of type name + *
- LOCAL_TYPE_NAME String {@code =>} localized version of type name * (may be
null
) - *- MINIMUM_SCALE short => minimum scale supported - *
- MAXIMUM_SCALE short => maximum scale supported - *
- SQL_DATA_TYPE int => unused - *
- SQL_DATETIME_SUB int => unused - *
- NUM_PREC_RADIX int => usually 2 or 10 + *
- MINIMUM_SCALE short {@code =>} minimum scale supported + *
- MAXIMUM_SCALE short {@code =>} maximum scale supported + *
- SQL_DATA_TYPE int {@code =>} unused + *
- SQL_DATETIME_SUB int {@code =>} unused + *
- NUM_PREC_RADIX int {@code =>} usually 2 or 10 *
The PRECISION column represents the maximum column size that the server supports for the given datatype. @@ -2498,16 +2498,16 @@ public interface DatabaseMetaData extends Wrapper { * *
Each index column description has the following columns: *
- *
* @@ -2781,14 +2781,14 @@ public interface DatabaseMetaData extends Wrapper { * *- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- NON_UNIQUE boolean => Can index values be non-unique. + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- NON_UNIQUE boolean {@code =>} Can index values be non-unique. * false when TYPE is tableIndexStatistic - *
- INDEX_QUALIFIER String => index catalog (may be
null
); + *- INDEX_QUALIFIER String {@code =>} index catalog (may be
null
); *null
when TYPE is tableIndexStatistic - *- INDEX_NAME String => index name;
null
when TYPE is + *- INDEX_NAME String {@code =>} index name;
null
when TYPE is * tableIndexStatistic - *- TYPE short => index type: + *
- TYPE short {@code =>} index type: *
*
- *- tableIndexStatistic - this identifies table statistics that are * returned in conjuction with a table's index descriptions @@ -2515,20 +2515,20 @@ public interface DatabaseMetaData extends Wrapper { *
- tableIndexHashed - this is a hashed index *
- tableIndexOther - this is some other style of index *
- ORDINAL_POSITION short => column sequence number + *
- ORDINAL_POSITION short {@code =>} column sequence number * within index; zero when TYPE is tableIndexStatistic - *
- COLUMN_NAME String => column name;
null
when TYPE is + *- COLUMN_NAME String {@code =>} column name;
null
when TYPE is * tableIndexStatistic - *- ASC_OR_DESC String => column sort sequence, "A" => ascending, - * "D" => descending, may be
null
if sort sequence is not supported; + *- ASC_OR_DESC String {@code =>} column sort sequence, "A" {@code =>} ascending, + * "D" {@code =>} descending, may be
null
if sort sequence is not supported; *null
when TYPE is tableIndexStatistic - *- CARDINALITY long => When TYPE is tableIndexStatistic, then + *
- CARDINALITY long {@code =>} When TYPE is tableIndexStatistic, then * this is the number of rows in the table; otherwise, it is the * number of unique values in the index. - *
- PAGES long => When TYPE is tableIndexStatisic then + *
- PAGES long {@code =>} When TYPE is tableIndexStatisic then * this is the number of pages used for the table, otherwise it * is the number of pages used for the current index. - *
- FILTER_CONDITION String => Filter condition, if any. + *
- FILTER_CONDITION String {@code =>} Filter condition, if any. * (may be
null
) *Each type description has the following columns: *
- *
- TYPE_CAT String => the type's catalog (may be
null
) - *- TYPE_SCHEM String => type's schema (may be
null
) - *- TYPE_NAME String => type name - *
- CLASS_NAME String => Java class name - *
- DATA_TYPE int => type value defined in java.sql.Types. + *
- TYPE_CAT String {@code =>} the type's catalog (may be
null
) + *- TYPE_SCHEM String {@code =>} type's schema (may be
null
) + *- TYPE_NAME String {@code =>} type name + *
- CLASS_NAME String {@code =>} Java class name + *
- DATA_TYPE int {@code =>} type value defined in java.sql.Types. * One of JAVA_OBJECT, STRUCT, or DISTINCT - *
- REMARKS String => explanatory comment on the type - *
- BASE_TYPE short => type code of the source type of a + *
- REMARKS String {@code =>} explanatory comment on the type + *
- BASE_TYPE short {@code =>} type code of the source type of a * DISTINCT type or the type that implements the user-generated * reference type of the SELF_REFERENCING_COLUMN of a structured * type as defined in java.sql.Types (
null
if DATA_TYPE is not @@ -2894,14 +2894,14 @@ public interface DatabaseMetaData extends Wrapper { * describes the designated UDT and a direct supertype. A row has the following * columns: *- *
* *- TYPE_CAT String => the UDT's catalog (may be
null
) - *- TYPE_SCHEM String => UDT's schema (may be
null
) - *- TYPE_NAME String => type name of the UDT - *
- SUPERTYPE_CAT String => the direct super type's catalog + *
- TYPE_CAT String {@code =>} the UDT's catalog (may be
null
) + *- TYPE_SCHEM String {@code =>} UDT's schema (may be
null
) + *- TYPE_NAME String {@code =>} type name of the UDT + *
- SUPERTYPE_CAT String {@code =>} the direct super type's catalog * (may be
null
) - *- SUPERTYPE_SCHEM String => the direct super type's schema + *
- SUPERTYPE_SCHEM String {@code =>} the direct super type's schema * (may be
null
) - *- SUPERTYPE_NAME String => the direct super type's name + *
- SUPERTYPE_NAME String {@code =>} the direct super type's name *
Note: If the driver does not support type hierarchies, an @@ -2936,10 +2936,10 @@ public interface DatabaseMetaData extends Wrapper { * *
Each type description has the following columns: *
- *
* *- TABLE_CAT String => the type's catalog (may be
null
) - *- TABLE_SCHEM String => type's schema (may be
null
) - *- TABLE_NAME String => type name - *
- SUPERTABLE_NAME String => the direct super type's name + *
- TABLE_CAT String {@code =>} the type's catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} type's schema (may be
null
) + *- TABLE_NAME String {@code =>} type name + *
- SUPERTABLE_NAME String {@code =>} the direct super type's name *
Note: If the driver does not support type hierarchies, an @@ -3001,35 +3001,35 @@ public interface DatabaseMetaData extends Wrapper { * The
ResultSet
object that is returned has the following * columns: *- *
@@ -3203,14 +3203,14 @@ public interface DatabaseMetaData extends Wrapper { * and if so the lifetime for which a- TYPE_CAT String => type catalog (may be
null
) - *- TYPE_SCHEM String => type schema (may be
null
) - *- TYPE_NAME String => type name - *
- ATTR_NAME String => attribute name - *
- DATA_TYPE int => attribute type SQL type from java.sql.Types - *
- ATTR_TYPE_NAME String => Data source dependent type name. + *
- TYPE_CAT String {@code =>} type catalog (may be
null
) + *- TYPE_SCHEM String {@code =>} type schema (may be
null
) + *- TYPE_NAME String {@code =>} type name + *
- ATTR_NAME String {@code =>} attribute name + *
- DATA_TYPE int {@code =>} attribute type SQL type from java.sql.Types + *
- ATTR_TYPE_NAME String {@code =>} Data source dependent type name. * For a UDT, the type name is fully qualified. For a REF, the type name is * fully qualified and represents the target type of the reference type. - *
- ATTR_SIZE int => column size. For char or date + *
- ATTR_SIZE int {@code =>} column size. For char or date * types this is the maximum number of characters; for numeric or * decimal types this is precision. - *
- DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where + *
- DECIMAL_DIGITS int {@code =>} the number of fractional digits. Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
- NUM_PREC_RADIX int => Radix (typically either 10 or 2) - *
- NULLABLE int => whether NULL is allowed + *
- NUM_PREC_RADIX int {@code =>} Radix (typically either 10 or 2) + *
- NULLABLE int {@code =>} whether NULL is allowed *
*
- *- attributeNoNulls - might not allow NULL values *
- attributeNullable - definitely allows NULL values *
- attributeNullableUnknown - nullability unknown *
- REMARKS String => comment describing column (may be
null
) - *- ATTR_DEF String => default value (may be
null
) - *- SQL_DATA_TYPE int => unused - *
- SQL_DATETIME_SUB int => unused - *
- CHAR_OCTET_LENGTH int => for char types the + *
- REMARKS String {@code =>} comment describing column (may be
null
) + *- ATTR_DEF String {@code =>} default value (may be
null
) + *- SQL_DATA_TYPE int {@code =>} unused + *
- SQL_DATETIME_SUB int {@code =>} unused + *
- CHAR_OCTET_LENGTH int {@code =>} for char types the * maximum number of bytes in the column - *
- ORDINAL_POSITION int => index of the attribute in the UDT + *
- ORDINAL_POSITION int {@code =>} index of the attribute in the UDT * (starting at 1) - *
- IS_NULLABLE String => ISO rules are used to determine + *
- IS_NULLABLE String {@code =>} ISO rules are used to determine * the nullability for a attribute. *
*
- *- YES --- if the attribute can include NULLs @@ -3037,13 +3037,13 @@ public interface DatabaseMetaData extends Wrapper { *
- empty string --- if the nullability for the * attribute is unknown *
- SCOPE_CATALOG String => catalog of table that is the + *
- SCOPE_CATALOG String {@code =>} catalog of table that is the * scope of a reference attribute (
null
if DATA_TYPE isn't REF) - *- SCOPE_SCHEMA String => schema of table that is the + *
- SCOPE_SCHEMA String {@code =>} schema of table that is the * scope of a reference attribute (
null
if DATA_TYPE isn't REF) - *- SCOPE_TABLE String => table name that is the scope of a + *
- SCOPE_TABLE String {@code =>} table name that is the scope of a * reference attribute (
null
if the DATA_TYPE isn't REF) - *- SOURCE_DATA_TYPE short => source type of a distinct type or user-generated + *
- SOURCE_DATA_TYPE short {@code =>} source type of a distinct type or user-generated * Ref type,SQL type from java.sql.Types (
null
if DATA_TYPE * isn't DISTINCT or user-generated REF) *RowId
object remains valid. ** The returned int values have the following relationship: - *
+ ** so conditional logic such as - *{@code * ROWID_UNSUPPORTED < ROWID_VALID_OTHER < ROWID_VALID_TRANSACTION * < ROWID_VALID_SESSION < ROWID_VALID_FOREVER - *+ * }+ ** can be used. Valid Forever means valid across all Sessions, and valid for * a Session means valid across all its contained Transactions. * @@ -3227,8 +3227,8 @@ public interface DatabaseMetaData extends Wrapper { * *{@code * if (metadata.getRowIdLifetime() > DatabaseMetaData.ROWID_VALID_TRANSACTION) - *+ * }The schema columns are: *
- *
* * @@ -3273,10 +3273,10 @@ public interface DatabaseMetaData extends Wrapper { * that the driver supports. The result set contains the following columns *- TABLE_SCHEM String => schema name - *
- TABLE_CATALOG String => catalog name (may be
null
) + *- TABLE_SCHEM String {@code =>} schema name + *
- TABLE_CATALOG String {@code =>} catalog name (may be
null
) **
- *
@@ -3305,19 +3305,19 @@ public interface DatabaseMetaData extends Wrapper { * *- NAME String=> The name of the client info property
- *- MAX_LEN int=> The maximum length of the value for the property
- *- DEFAULT_VALUE String=> The default value of the property
- *- DESCRIPTION String=> A description of the property. This will typically + *
- NAME String{@code =>} The name of the client info property
+ *- MAX_LEN int{@code =>} The maximum length of the value for the property
+ *- DEFAULT_VALUE String{@code =>} The default value of the property
+ *- DESCRIPTION String{@code =>} A description of the property. This will typically * contain information as to where this property is * stored in the database. *
Each function description has the the following columns: *
- *
- FUNCTION_CAT String => function catalog (may be
null
) - *- FUNCTION_SCHEM String => function schema (may be
null
) - *- FUNCTION_NAME String => function name. This is the name + *
- FUNCTION_CAT String {@code =>} function catalog (may be
null
) + *- FUNCTION_SCHEM String {@code =>} function schema (may be
null
) + *- FUNCTION_NAME String {@code =>} function name. This is the name * used to invoke the function - *
- REMARKS String => explanatory comment on the function - *
- FUNCTION_TYPE short => kind of function: + *
- REMARKS String {@code =>} explanatory comment on the function + *
- FUNCTION_TYPE short {@code =>} kind of function: *
*
- *- functionResultUnknown - Cannot determine if a return value * or table will be returned *
- functionNoTable- Does not return a table *
- functionReturnsTable - Returns a table *
- SPECIFIC_NAME String => the name which uniquely identifies + *
- SPECIFIC_NAME String {@code =>} the name which uniquely identifies * this function within its schema. This is a user specified, or DBMS * generated, name that may be different then the
FUNCTION_NAME
* for example with overload functions @@ -3359,12 +3359,12 @@ public interface DatabaseMetaData extends Wrapper { * is a parameter description, column description or * return type description with the following fields: *- *
- FUNCTION_CAT String => function catalog (may be
null
) - *- FUNCTION_SCHEM String => function schema (may be
null
) - *- FUNCTION_NAME String => function name. This is the name + *
- FUNCTION_CAT String {@code =>} function catalog (may be
null
) + *- FUNCTION_SCHEM String {@code =>} function schema (may be
null
) + *- FUNCTION_NAME String {@code =>} function name. This is the name * used to invoke the function - *
- COLUMN_NAME String => column/parameter name - *
- COLUMN_TYPE Short => kind of column/parameter: + *
- COLUMN_NAME String {@code =>} column/parameter name + *
- COLUMN_TYPE Short {@code =>} kind of column/parameter: *
*
- *- functionColumnUnknown - nobody knows *
- functionColumnIn - IN parameter @@ -3374,30 +3374,30 @@ public interface DatabaseMetaData extends Wrapper { *
- functionColumnResult - Indicates that the parameter or column * is a column in the
ResultSet
*- DATA_TYPE int => SQL type from java.sql.Types - *
- TYPE_NAME String => SQL type name, for a UDT type the + *
- DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
- TYPE_NAME String {@code =>} SQL type name, for a UDT type the * type name is fully qualified - *
- PRECISION int => precision - *
- LENGTH int => length in bytes of data - *
- SCALE short => scale - null is returned for data types where + *
- PRECISION int {@code =>} precision + *
- LENGTH int {@code =>} length in bytes of data + *
- SCALE short {@code =>} scale - null is returned for data types where * SCALE is not applicable. - *
- RADIX short => radix - *
- NULLABLE short => can it contain NULL. + *
- RADIX short {@code =>} radix + *
- NULLABLE short {@code =>} can it contain NULL. *
*
- *- functionNoNulls - does not allow NULL values *
- functionNullable - allows NULL values *
- functionNullableUnknown - nullability unknown *
- REMARKS String => comment describing column/parameter - *
- CHAR_OCTET_LENGTH int => the maximum length of binary + *
- REMARKS String {@code =>} comment describing column/parameter + *
- CHAR_OCTET_LENGTH int {@code =>} the maximum length of binary * and character based parameters or columns. For any other datatype the returned value * is a NULL - *
- ORDINAL_POSITION int => the ordinal position, starting + *
- ORDINAL_POSITION int {@code =>} the ordinal position, starting * from 1, for the input and output parameters. A value of 0 * is returned if this row describes the function's return value. * For result set columns, it is the * ordinal position of the column in the result set starting from 1. - *
- IS_NULLABLE String => ISO rules are used to determine + *
- IS_NULLABLE String {@code =>} ISO rules are used to determine * the nullability for a parameter or column. *
*
- *- YES --- if the parameter or column can include NULLs @@ -3405,7 +3405,7 @@ public interface DatabaseMetaData extends Wrapper { *
- empty string --- if the nullability for the * parameter or column is unknown *
- SPECIFIC_NAME String => the name which uniquely identifies + *
- SPECIFIC_NAME String {@code =>} the name which uniquely identifies * this function within its schema. This is a user specified, or DBMS * generated, name that may be different then the
FUNCTION_NAME
* for example with overload functions @@ -3591,21 +3591,21 @@ public interface DatabaseMetaData extends Wrapper { * *Each column description has the following columns: *
- *
- TABLE_CAT String => table catalog (may be
null
) - *- TABLE_SCHEM String => table schema (may be
null
) - *- TABLE_NAME String => table name - *
- COLUMN_NAME String => column name - *
- DATA_TYPE int => SQL type from java.sql.Types - *
- COLUMN_SIZE int => column size. - *
- DECIMAL_DIGITS int => the number of fractional digits. Null is returned for data types where + *
- TABLE_CAT String {@code =>} table catalog (may be
null
) + *- TABLE_SCHEM String {@code =>} table schema (may be
null
) + *- TABLE_NAME String {@code =>} table name + *
- COLUMN_NAME String {@code =>} column name + *
- DATA_TYPE int {@code =>} SQL type from java.sql.Types + *
- COLUMN_SIZE int {@code =>} column size. + *
- DECIMAL_DIGITS int {@code =>} the number of fractional digits. Null is returned for data types where * DECIMAL_DIGITS is not applicable. - *
- NUM_PREC_RADIX int => Radix (typically either 10 or 2) - *
- COLUMN_USAGE String => The allowed usage for the column. The + *
- NUM_PREC_RADIX int {@code =>} Radix (typically either 10 or 2) + *
- COLUMN_USAGE String {@code =>} The allowed usage for the column. The * value returned will correspond to the enum name returned by {@link PseudoColumnUsage#name PseudoColumnUsage.name()} - *
- REMARKS String => comment describing column (may be
null
) - *- CHAR_OCTET_LENGTH int => for char types the + *
- REMARKS String {@code =>} comment describing column (may be
null
) + *- CHAR_OCTET_LENGTH int {@code =>} for char types the * maximum number of bytes in the column - *
- IS_NULLABLE String => ISO rules are used to determine the nullability for a column. + *
- IS_NULLABLE String {@code =>} ISO rules are used to determine the nullability for a column. *
*
- YES --- if the column can include NULLs *
- NO --- if the column cannot include NULLs diff --git a/jdk/src/share/classes/java/sql/DriverManager.java b/jdk/src/share/classes/java/sql/DriverManager.java index fbe16363529..797a920d230 100644 --- a/jdk/src/share/classes/java/sql/DriverManager.java +++ b/jdk/src/share/classes/java/sql/DriverManager.java @@ -36,7 +36,7 @@ import sun.reflect.Reflection; /** *
*The basic service for managing a set of JDBC drivers.
- * NOTE: The {@linkDataSource
} interface, new in the + * NOTE: The {@link javax.sql.DataSource} interface, new in the * JDBC 2.0 API, provides another way to connect to a data source. * The use of aDataSource
object is the preferred means of * connecting to a data source. diff --git a/jdk/src/share/classes/java/sql/ResultSet.java b/jdk/src/share/classes/java/sql/ResultSet.java index ab547733128..7029c935906 100644 --- a/jdk/src/share/classes/java/sql/ResultSet.java +++ b/jdk/src/share/classes/java/sql/ResultSet.java @@ -1350,7 +1350,7 @@ public interface ResultSet extends Wrapper, AutoCloseable { * @param rows the number of rows to fetch * @exception SQLException if a database access error occurs; this method * is called on a closed result set or the - * conditionrows >= 0
is not satisfied + * condition {@code rows >= 0} is not satisfied * @since 1.2 * @see #getFetchSize */ diff --git a/jdk/src/share/classes/java/sql/Statement.java b/jdk/src/share/classes/java/sql/Statement.java index 34859c52c44..29b372f522e 100644 --- a/jdk/src/share/classes/java/sql/Statement.java +++ b/jdk/src/share/classes/java/sql/Statement.java @@ -144,7 +144,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param max the new column size limit in bytes; zero means there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closedStatement
- * or the condition max >= 0 is not satisfied + * or the condition {@code max >= 0} is not satisfied * @see #getMaxFieldSize */ void setMaxFieldSize(int max) throws SQLException; @@ -174,7 +174,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param max the new max rows limit; zero means there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closedStatement
- * or the condition max >= 0 is not satisfied + * or the condition {@code max >= 0} is not satisfied * @see #getMaxRows */ void setMaxRows(int max) throws SQLException; @@ -240,7 +240,7 @@ public interface Statement extends Wrapper, AutoCloseable { * there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closedStatement
- * or the condition seconds >= 0 is not satisfied + * or the condition {@code seconds >= 0} is not satisfied * @see #getQueryTimeout */ void setQueryTimeout(int seconds) throws SQLException; @@ -385,10 +385,10 @@ public interface Statement extends Wrapper, AutoCloseable { * object(s) obtained with the methodgetResultSet
. * *There are no more results when the following is true: - *
+ ** * @return{@code * // stmt is a Statement object * ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1)) - *+ * }true
if the next result is aResultSet
* object;false
if it is an update count or there are @@ -452,7 +452,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param rows the number of rows to fetch * @exception SQLException if a database access error occurs, * this method is called on a closedStatement
or the - * conditionrows >= 0
is not satisfied. + * condition {@code rows >= 0} is not satisfied. * @since 1.2 * @see #getFetchSize */ @@ -665,10 +665,10 @@ public interface Statement extends Wrapper, AutoCloseable { *true
if the next result is aResultSet
object. * *There are no more results when the following is true: - *
+ ** * @param current one of the following{@code * // stmt is a Statement object * ((stmt.getMoreResults(current) == false) && (stmt.getUpdateCount() == -1)) - *+ * }Statement
* constants indicating what should happen to current @@ -1107,7 +1107,7 @@ public interface Statement extends Wrapper, AutoCloseable { * @param max the new max rows limit; zero means there is no limit * @exception SQLException if a database access error occurs, * this method is called on a closedStatement
- * or the condition max >= 0 is not satisfied + * or the condition {@code max >= 0} is not satisfied * @see #getMaxRows * @since 1.8 */ diff --git a/jdk/src/share/classes/java/text/CharacterIterator.java b/jdk/src/share/classes/java/text/CharacterIterator.java index 2b21e14e5ed..7674268db16 100644 --- a/jdk/src/share/classes/java/text/CharacterIterator.java +++ b/jdk/src/share/classes/java/text/CharacterIterator.java @@ -62,27 +62,27 @@ package java.text; *Examples:
* * Traverse the text from start to finish - *
+ ** * Traverse the text backwards, from end to start - *{@code * public void traverseForward(CharacterIterator iter) { * for(char c = iter.first(); c != CharacterIterator.DONE; c = iter.next()) { * processChar(c); * } * } - *+ * }+ ** * Traverse both forward and backward from a given position in the text. * Calls to notBoundary() in this example represents some * additional stopping criteria. - *{@code * public void traverseBackward(CharacterIterator iter) { * for(char c = iter.last(); c != CharacterIterator.DONE; c = iter.previous()) { * processChar(c); * } * } - *+ * }+ ** * @see StringCharacterIterator * @see AttributedCharacterIterator diff --git a/jdk/src/share/classes/java/text/ChoiceFormat.java b/jdk/src/share/classes/java/text/ChoiceFormat.java index 1e318848300..7814f0ef2c5 100644 --- a/jdk/src/share/classes/java/text/ChoiceFormat.java +++ b/jdk/src/share/classes/java/text/ChoiceFormat.java @@ -376,7 +376,7 @@ public class ChoiceFormat extends NumberFormat { /** * Returns pattern with formatted double. - * @param number number to be formatted & substituted. + * @param number number to be formatted and substituted. * @param toAppendTo where text is appended. * @param status ignore no useful status is returned. */ diff --git a/jdk/src/share/classes/java/text/Collator.java b/jdk/src/share/classes/java/text/Collator.java index aaa5276d6f7..d105a810439 100644 --- a/jdk/src/share/classes/java/text/Collator.java +++ b/jdk/src/share/classes/java/text/Collator.java @@ -72,14 +72,14 @@ import sun.util.locale.provider.LocaleServiceProviderPool; * The following example shows how to compare two strings using * the{@code * public void traverseOut(CharacterIterator iter, int pos) { * for (char c = iter.setIndex(pos); * c != CharacterIterator.DONE && notBoundary(c); @@ -96,7 +96,7 @@ package java.text; * int start = iter.getIndex(); * processSection(start, end); * } - *+ * }Collator
for the default locale. *- ** *+ **{@code * // Compare two strings in the default locale * Collator myCollator = Collator.getInstance(); * if( myCollator.compare("abc", "ABC") < 0 ) * System.out.println("abc is less than ABC"); * else * System.out.println("abc is greater than or equal to ABC"); - *+ * }diff --git a/jdk/src/share/classes/java/util/Calendar.java b/jdk/src/share/classes/java/util/Calendar.java index 19c3c8540a7..566b8b090be 100644 --- a/jdk/src/share/classes/java/util/Calendar.java +++ b/jdk/src/share/classes/java/util/Calendar.java @@ -2681,9 +2681,9 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable
Calendar represents a time * before the time represented by the specified * Object
. This method is equivalent to: - *+ * } * if and only if+ *{@code * compareTo(when) < 0 - *when
is aCalendar
* instance. Otherwise, the method returnsfalse
. * @@ -2702,9 +2702,9 @@ public abstract class Calendar implements Serializable, Cloneable, ComparableCalendar represents a time * after the time represented by the specified * Object
. This method is equivalent to: - *+ * } * if and only if+ *{@code * compareTo(when) > 0 - *when
is aCalendar
* instance. Otherwise, the method returnsfalse
. * diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index 30d589cdc7d..da258793ba6 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -924,9 +924,9 @@ public class Collections { * Returns the starting position of the first occurrence of the specified * target list within the specified source list, or -1 if there is no * such occurrence. More formally, returns the lowest index i - * such that source.subList(i, i+target.size()).equals(target), + * such that {@code source.subList(i, i+target.size()).equals(target)}, * or -1 if there is no such index. (Returns -1 if - * target.size() > source.size().) + * {@code target.size() > source.size()}) * *This implementation uses the "brute force" technique of scanning * over the source list, looking for a match with the target at each @@ -977,9 +977,9 @@ public class Collections { * Returns the starting position of the last occurrence of the specified * target list within the specified source list, or -1 if there is no such * occurrence. More formally, returns the highest index i - * such that source.subList(i, i+target.size()).equals(target), + * such that {@code source.subList(i, i+target.size()).equals(target)}, * or -1 if there is no such index. (Returns -1 if - * target.size() > source.size().) + * {@code target.size() > source.size()}) * *
This implementation uses the "brute force" technique of iterating * over the source list, looking for a match with the target at each diff --git a/jdk/src/share/classes/java/util/Date.java b/jdk/src/share/classes/java/util/Date.java index 61dac350389..502daaefdbb 100644 --- a/jdk/src/share/classes/java/util/Date.java +++ b/jdk/src/share/classes/java/util/Date.java @@ -984,8 +984,9 @@ public class Date * exclusive OR of the two halves of the primitive long * value returned by the {@link Date#getTime} * method. That is, the hash code is the value of the expression: - *
+ *- * (int)(this.getTime()^(this.getTime() >>> 32))* * @return a hash code value for this object. */ @@ -1085,7 +1086,7 @@ public class Date /** * Creates a string representation of this Date object of * the form: - *{@code + * (int)(this.getTime()^(this.getTime() >>> 32)) + * }+ ** ** where:* d mon yyyy hh:mm:ss GMT*
- d is the day of the month (1 through 31), diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java index c9b106ff759..55f28011689 100644 --- a/jdk/src/share/classes/java/util/HashMap.java +++ b/jdk/src/share/classes/java/util/HashMap.java @@ -28,6 +28,7 @@ package java.util; import java.io.*; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; +import java.util.concurrent.ThreadLocalRandom; import java.util.function.Consumer; import java.util.function.BiFunction; import java.util.function.Function; @@ -912,7 +913,8 @@ public class HashMap
*/ final int initHashSeed() { if (sun.misc.VM.isBooted() && Holder.USE_HASHSEED) { - return sun.misc.Hashing.randomHashSeed(this); + int seed = ThreadLocalRandom.current().nextInt(); + return (seed != 0) ? seed : 1; } return 0; } @@ -2572,8 +2574,9 @@ public class HashMap // set other fields that need values if (Holder.USE_HASHSEED) { + int seed = ThreadLocalRandom.current().nextInt(); Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET, - sun.misc.Hashing.randomHashSeed(this)); + (seed != 0) ? seed : 1); } table = EMPTY_TABLE; diff --git a/jdk/src/share/classes/java/util/Hashtable.java b/jdk/src/share/classes/java/util/Hashtable.java index a078aa3e207..50b3f8b4366 100644 --- a/jdk/src/share/classes/java/util/Hashtable.java +++ b/jdk/src/share/classes/java/util/Hashtable.java @@ -26,6 +26,7 @@ package java.util; import java.io.*; +import java.util.concurrent.ThreadLocalRandom; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.function.BiFunction; @@ -219,7 +220,8 @@ public class Hashtable */ final int initHashSeed() { if (sun.misc.VM.isBooted() && Holder.USE_HASHSEED) { - return sun.misc.Hashing.randomHashSeed(this); + int seed = ThreadLocalRandom.current().nextInt(); + return (seed != 0) ? seed : 1; } return 0; } @@ -1206,8 +1208,9 @@ public class Hashtable // set hashMask if (Holder.USE_HASHSEED) { + int seed = ThreadLocalRandom.current().nextInt(); Holder.UNSAFE.putIntVolatile(this, Holder.HASHSEED_OFFSET, - sun.misc.Hashing.randomHashSeed(this)); + (seed != 0) ? seed : 1); } // Read the original length of the array and number of elements diff --git a/jdk/src/share/classes/java/util/LinkedHashMap.java b/jdk/src/share/classes/java/util/LinkedHashMap.java index 100710b1bdd..59a8d8f1a5d 100644 --- a/jdk/src/share/classes/java/util/LinkedHashMap.java +++ b/jdk/src/share/classes/java/util/LinkedHashMap.java @@ -437,13 +437,13 @@ public class LinkedHashMap * Sample use: this override will allow the map to grow up to 100 * entries and then delete the eldest entry each time a new entry is * added, maintaining a steady state of 100 entries. - *
+ ** *{@code * private static final int MAX_ENTRIES = 100; * * protected boolean removeEldestEntry(Map.Entry eldest) { * return size() > MAX_ENTRIES; * } - *+ * }This method typically does not modify the map in any way, * instead allowing the map to modify itself as directed by its diff --git a/jdk/src/share/classes/java/util/Random.java b/jdk/src/share/classes/java/util/Random.java index c169e053dfd..ca430bae26f 100644 --- a/jdk/src/share/classes/java/util/Random.java +++ b/jdk/src/share/classes/java/util/Random.java @@ -372,7 +372,7 @@ class Random implements java.io.Serializable { * range {@code 0.0f} (inclusive) to {@code 1.0f} (exclusive), is * pseudorandomly generated and returned. All 224 possible {@code float} values - * of the form m x 2m x 2-24, where m is a positive * integer less than 224 , are * produced with (approximately) equal probability. diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java index 0d52daa9c48..1d9d80b90a4 100644 --- a/jdk/src/share/classes/java/util/ResourceBundle.java +++ b/jdk/src/share/classes/java/util/ResourceBundle.java @@ -2323,9 +2323,9 @@ public abstract class ResourceBundle { * is returned. And if the resource bundles for the "ja" and * ""
Locale
s are found, then the runtime resource * lookup path (parent chain) is: - *+ ** * @param baseName * the base name of the resource bundle, a fully diff --git a/jdk/src/share/classes/java/util/Scanner.java b/jdk/src/share/classes/java/util/Scanner.java index cc19b0d1257..f6967f3a75c 100644 --- a/jdk/src/share/classes/java/util/Scanner.java +++ b/jdk/src/share/classes/java/util/Scanner.java @@ -49,47 +49,51 @@ import sun.misc.LRUCache; * *{@code * Messages_ja -> Messages - *+ * }For example, this code allows a user to read a number from * System.in: - *
* *+ *+ * }{@code * Scanner sc = new Scanner(System.in); * int i = sc.nextInt(); - *As another example, this code allows
long
types to be * assigned from entries in a filemyNumbers
: - ** *+ *+ * } + * }{@code * Scanner sc = new Scanner(new File("myNumbers")); * while (sc.hasNextLong()) { * long aLong = sc.nextLong(); - * }The scanner can also use delimiters other than whitespace. This * example reads several items in from a string: - *
*+ *+ * s.close(); + * }{@code * String input = "1 fish 2 fish red fish blue fish"; * Scanner s = new Scanner(input).useDelimiter("\\s*fish\\s*"); * System.out.println(s.nextInt()); * System.out.println(s.nextInt()); * System.out.println(s.next()); * System.out.println(s.next()); - * s.close();* prints the following output: - *
+ * blue + * }+ * {@code * 1 * 2 * red - * blueThe same output can be generated with this code, which uses a regular * expression to parse all four tokens at once: - *
* *+ *+ * s.close(); + * }{@code * String input = "1 fish 2 fish red fish blue fish"; * Scanner s = new Scanner(input); * s.findInLine("(\\d+) fish (\\d+) fish (\\w+) fish (\\w+)"); * MatchResult result = s.match(); * for (int i=1; i<=result.groupCount(); i++) * System.out.println(result.group(i)); - * s.close();The default whitespace delimiter used * by a scanner is as recognized by {@link java.lang.Character}.{@link @@ -2640,11 +2644,11 @@ public final class Scanner implements Iterator
, Closeable { * scanner.reset() behaves in exactly the same way as the * invocation * - * * * @return this scanner * diff --git a/jdk/src/share/classes/java/util/Spliterators.java b/jdk/src/share/classes/java/util/Spliterators.java index 860f37a812b..f0d7a4e3175 100644 --- a/jdk/src/share/classes/java/util/Spliterators.java +++ b/jdk/src/share/classes/java/util/Spliterators.java @@ -663,7 +663,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static+ *+ * }{@code * scanner.useDelimiter("\\p{javaWhitespace}+") * .useLocale(Locale.getDefault(Locale.Category.FORMAT)) * .useRadix(10); - *Iterator iteratorFromSpliterator(Spliterator extends T> spliterator) { + public static Iterator iterator(Spliterator extends T> spliterator) { Objects.requireNonNull(spliterator); class Adapter implements Iterator , Consumer { boolean valueReady = false; @@ -708,7 +708,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static PrimitiveIterator.OfInt iteratorFromSpliterator(Spliterator.OfInt spliterator) { + public static PrimitiveIterator.OfInt iterator(Spliterator.OfInt spliterator) { Objects.requireNonNull(spliterator); class Adapter implements PrimitiveIterator.OfInt, IntConsumer { boolean valueReady = false; @@ -753,7 +753,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static PrimitiveIterator.OfLong iteratorFromSpliterator(Spliterator.OfLong spliterator) { + public static PrimitiveIterator.OfLong iterator(Spliterator.OfLong spliterator) { Objects.requireNonNull(spliterator); class Adapter implements PrimitiveIterator.OfLong, LongConsumer { boolean valueReady = false; @@ -798,7 +798,7 @@ public final class Spliterators { * @return An iterator * @throws NullPointerException if the given spliterator is {@code null} */ - public static PrimitiveIterator.OfDouble iteratorFromSpliterator(Spliterator.OfDouble spliterator) { + public static PrimitiveIterator.OfDouble iterator(Spliterator.OfDouble spliterator) { Objects.requireNonNull(spliterator); class Adapter implements PrimitiveIterator.OfDouble, DoubleConsumer { boolean valueReady = false; diff --git a/jdk/src/share/classes/java/util/TimerTask.java b/jdk/src/share/classes/java/util/TimerTask.java index b8c83408680..691c9a03dae 100644 --- a/jdk/src/share/classes/java/util/TimerTask.java +++ b/jdk/src/share/classes/java/util/TimerTask.java @@ -130,14 +130,14 @@ public abstract class TimerTask implements Runnable { * This method is typically invoked from within a task's run method, to * determine whether the current execution of the task is sufficiently * timely to warrant performing the scheduled activity: - *
+ ** This method is typically not used in conjunction with * fixed-delay execution repeating tasks, as their scheduled * execution times are allowed to drift over time, and so are not terribly diff --git a/jdk/src/share/classes/java/util/WeakHashMap.java b/jdk/src/share/classes/java/util/WeakHashMap.java index 183909afd1e..d354a773c8c 100644 --- a/jdk/src/share/classes/java/util/WeakHashMap.java +++ b/jdk/src/share/classes/java/util/WeakHashMap.java @@ -27,6 +27,7 @@ package java.util; import java.lang.ref.WeakReference; import java.lang.ref.ReferenceQueue; +import java.util.concurrent.ThreadLocalRandom; import java.util.function.Consumer; @@ -215,7 +216,8 @@ public class WeakHashMap{@code * public void run() { * if (System.currentTimeMillis() - scheduledExecutionTime() >= * MAX_TARDINESS) * return; // Too late; skip this execution. * // Perform the task * } - *+ * }if (sun.misc.VM.isBooted() && Holder.USE_HASHSEED) { // Do not set hashSeed more than once! // assert hashSeed == 0; - hashSeed = sun.misc.Hashing.randomHashSeed(this); + int seed = ThreadLocalRandom.current().nextInt(); + hashSeed = (seed != 0) ? seed : 1; } } diff --git a/jdk/src/share/classes/java/util/jar/Pack200.java b/jdk/src/share/classes/java/util/jar/Pack200.java index c3ea39587a4..dbefe59305d 100644 --- a/jdk/src/share/classes/java/util/jar/Pack200.java +++ b/jdk/src/share/classes/java/util/jar/Pack200.java @@ -45,7 +45,7 @@ import java.beans.PropertyChangeListener; * transform the byte-stream back to JAR format. * * Here is an example using packer and unpacker:
- *
+ * } *+ *{@code * import java.util.jar.Pack200; * import java.util.jar.Pack200.*; * ... @@ -90,7 +90,7 @@ import java.beans.PropertyChangeListener; * } catch (IOException ioe) { * ioe.printStackTrace(); * } - ** A Pack200 file compressed with gzip can be hosted on HTTP/1.1 web servers. * The deployment applications can use "Accept-Encoding=pack200-gzip". This diff --git a/jdk/src/share/classes/java/util/logging/ConsoleHandler.java b/jdk/src/share/classes/java/util/logging/ConsoleHandler.java index e0e70a5e689..a8b4bc4f0cd 100644 --- a/jdk/src/share/classes/java/util/logging/ConsoleHandler.java +++ b/jdk/src/share/classes/java/util/logging/ConsoleHandler.java @@ -35,7 +35,7 @@ import java.net.*; *
* Configuration: * By default each ConsoleHandler is initialized using the following - * LogManager configuration properties where
+ * LogManager configuration properties where {@code } * refers to the fully-qualified class name of the handler. * If properties are not defined * (or have invalid values) then the specified default values are used. diff --git a/jdk/src/share/classes/java/util/logging/FileHandler.java b/jdk/src/share/classes/java/util/logging/FileHandler.java index 8d3b28d8d52..52360c206ee 100644 --- a/jdk/src/share/classes/java/util/logging/FileHandler.java +++ b/jdk/src/share/classes/java/util/logging/FileHandler.java @@ -333,7 +333,7 @@ public class FileHandler extends StreamHandler { * @exception IOException if there are IO problems opening the files. * @exception SecurityException if a security manager exists and if * the caller does not have LoggingPermission("control"). - * @exception IllegalArgumentException if limit < 0, or count < 1. + * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if pattern is an empty string */ public FileHandler(String pattern, int limit, int count) @@ -371,7 +371,7 @@ public class FileHandler extends StreamHandler { * @exception IOException if there are IO problems opening the files. * @exception SecurityException if a security manager exists and if * the caller does not have LoggingPermission("control"). - * @exception IllegalArgumentException if limit < 0, or count < 1. + * @exception IllegalArgumentException if {@code limit < 0}, or {@code count < 1}. * @exception IllegalArgumentException if pattern is an empty string * */ diff --git a/jdk/src/share/classes/java/util/logging/MemoryHandler.java b/jdk/src/share/classes/java/util/logging/MemoryHandler.java index 5c545cc2912..ddf72c2a1e1 100644 --- a/jdk/src/share/classes/java/util/logging/MemoryHandler.java +++ b/jdk/src/share/classes/java/util/logging/MemoryHandler.java @@ -64,7 +64,7 @@ package java.util.logging; * (defaults to no Filter). - <handler-name>.size * defines the buffer size (defaults to 1000).
- *- <handler-name>.push + *
- <handler-name>.push * defines the pushLevel (defaults to level.SEVERE).
*- <handler-name>.target * specifies the name of the target Handler class. @@ -155,7 +155,7 @@ public class MemoryHandler extends Handler { * @param size the number of log records to buffer (must be greater than zero) * @param pushLevel message level to push on * - * @throws IllegalArgumentException if size is <= 0 + * @throws IllegalArgumentException if {@code size is <= 0} */ public MemoryHandler(Handler target, int size, Level pushLevel) { if (target == null || pushLevel == null) { diff --git a/jdk/src/share/classes/java/util/prefs/Preferences.java b/jdk/src/share/classes/java/util/prefs/Preferences.java index 1867fca9186..e3f459290b2 100644 --- a/jdk/src/share/classes/java/util/prefs/Preferences.java +++ b/jdk/src/share/classes/java/util/prefs/Preferences.java @@ -134,52 +134,52 @@ import java.lang.Double; * subsequently restore from the backup. * *
The XML document has the following DOCTYPE declaration: - *
- * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd"> - *+ *{@code + * + * }* Note that the system URI (http://java.sun.com/dtd/preferences.dtd) is * not accessed when exporting or importing preferences; it merely * serves as a string to uniquely identify the DTD, which is: - *- * <?xml version="1.0" encoding="UTF-8"?> + *{@code + * * - * <!-- DTD for a Preferences tree. --> + * * - * <!-- The preferences element is at the root of an XML document - * representing a Preferences tree. --> - * <!ELEMENT preferences (root)> + * + * * - * <!-- The preferences element contains an optional version attribute, - * which specifies version of DTD. --> - * <!ATTLIST preferences EXTERNAL_XML_VERSION CDATA "0.0" > + * + * * - * <!-- The root element has a map representing the root's preferences - * (if any), and one node for each child of the root (if any). --> - * <!ELEMENT root (map, node*) > + * + * * - * <!-- Additionally, the root contains a type attribute, which - * specifies whether it's the system or user root. --> - * <!ATTLIST root - * type (system|user) #REQUIRED > + * + * * - * <!-- Each node has a map representing its preferences (if any), - * and one node for each child (if any). --> - * <!ELEMENT node (map, node*) > + * + * * - * <!-- Additionally, each node has a name attribute --> - * <!ATTLIST node - * name CDATA #REQUIRED > + * + * * - * <!-- A map represents the preferences stored at a node (if any). --> - * <!ELEMENT map (entry*) > + * + * * - * <!-- An entry represents a single preference, which is simply - * a key-value pair. --> - * <!ELEMENT entry EMPTY > - * <!ATTLIST entry + * + * + * + * value CDATA #REQUIRED > + * }* * Every Preferences implementation must have an associated {@link * PreferencesFactory} implementation. Every Java(TM) SE implementation must provide @@ -1161,9 +1161,9 @@ public abstract class Preferences { * This XML document is, in effect, an offline backup of the node. * *The XML document will have the following DOCTYPE declaration: - *
- * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd"> - *+ *{@code + * + * }* The UTF-8 character encoding will be used. * *This method is an exception to the general rule that the results of @@ -1192,9 +1192,9 @@ public abstract class Preferences { * effect, an offline backup of the subtree rooted at the node. * *
The XML document will have the following DOCTYPE declaration: - *
- * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd"> - *+ *{@code + * + * }* The UTF-8 character encoding will be used. * *This method is an exception to the general rule that the results of @@ -1228,9 +1228,9 @@ public abstract class Preferences { * do not exist, the nodes will be created. * *
The XML document must have the following DOCTYPE declaration: - *
- * <!DOCTYPE preferences SYSTEM "http://java.sun.com/dtd/preferences.dtd"> - *+ *{@code + * + * }* (This method is designed for use in conjunction with * {@link #exportNode(OutputStream)} and * {@link #exportSubtree(OutputStream)}. diff --git a/jdk/src/share/classes/java/util/regex/MatchResult.java b/jdk/src/share/classes/java/util/regex/MatchResult.java index 9b52331808f..9767d286377 100644 --- a/jdk/src/share/classes/java/util/regex/MatchResult.java +++ b/jdk/src/share/classes/java/util/regex/MatchResult.java @@ -79,7 +79,7 @@ public interface MatchResult { /** * Returns the offset after the last character matched. * - * @return @return The offset after the last character matched + * @return The offset after the last character matched * * @throws IllegalStateException * If no match has yet been attempted, diff --git a/jdk/src/share/classes/java/util/regex/Pattern.java b/jdk/src/share/classes/java/util/regex/Pattern.java index 14cde68c552..ae7468758c8 100644 --- a/jdk/src/share/classes/java/util/regex/Pattern.java +++ b/jdk/src/share/classes/java/util/regex/Pattern.java @@ -108,7 +108,7 @@ import java.util.stream.StreamSupport; ** \x{h...h} *The character with hexadecimal value 0xh...h * ({@link java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT} - * <= 0xh...h <=  + * <= 0xh...h <= * {@link java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT}) diff --git a/jdk/src/share/classes/java/util/stream/DoublePipeline.java b/jdk/src/share/classes/java/util/stream/DoublePipeline.java index b403a433fbf..c934445b8f0 100644 --- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java +++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java @@ -168,7 +168,7 @@ abstract class DoublePipeline \t *The tab character ('\u0009') @Override public final PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -461,7 +461,7 @@ abstract class DoublePipeline @Override public final double[] toArray() { return Nodes.flattenDouble((Node.OfDouble) evaluateToArrayNode(Double[]::new)) - .asDoubleArray(); + .asPrimitiveArray(); } // diff --git a/jdk/src/share/classes/java/util/stream/DoubleStream.java b/jdk/src/share/classes/java/util/stream/DoubleStream.java index f402b5daee6..1706c31572c 100644 --- a/jdk/src/share/classes/java/util/stream/DoubleStream.java +++ b/jdk/src/share/classes/java/util/stream/DoubleStream.java @@ -753,75 +753,4 @@ public interface DoubleStream extends BaseStream { }, Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL)); } - - /** - * Returns a sequential {@code DoubleStream} from {@code startInclusive} (inclusive) - * to {@code endExclusive} (exclusive) by an incremental step of 1.0. - * - * @implSpec - * The implementation behaves as if: - * {@code - * doubleRange(startInclusive, endExclusive, 1.0); - * }- * - * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @return a sequential {@code DoubleStream} for the range of {@code double} - * elements - */ - public static DoubleStream range(double startInclusive, double endExclusive) { - return range(startInclusive, endExclusive, 1.0); - } - - /** - * Returns a sequential {@code DoubleStream} from {@code startInclusive} - * (inclusive) to {@code endExclusive} (exclusive) by {@code step}. If - * {@code startInclusive} is greater than or equal to {@code - * endExclusive}, an empty stream is returned. - * - * An equivalent sequence of increasing values can be produced - * sequentially using a {@code for} loop as follows: - *{@code - * long size = (long) Math.ceil((startInclusive - endExclusive) / step); - * long i = 0 - * for (double v = startInclusive; i < size; i++, v = startInclusive + step * i) { - * ... - * } - * }- * - * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @param step the difference between consecutive values - * @return a sequential {@code DoubleStream} for tne range of {@code double} - * elements - * @throws IllegalArgumentException if {@code step} is less than or equal to - * 0. is {@code NaN}, or the count of elements in the range would be - * greater than {@code Long.MAX_VALUE} - */ - public static DoubleStream range(double startInclusive, double endExclusive, double step) { - // @@@ Need to check for ranges that may not produce distinct values - // such as when the step is very small - // Also clarify the size of the range which may produce more or less - // than expected - if (step <= 0 || Double.isNaN(step)) { - throw new IllegalArgumentException(String.format("Illegal step: %f", step)); - } else { - double range = endExclusive - startInclusive; - if (range <= 0) { - return empty(); - } - double size = Math.ceil((endExclusive - startInclusive) / step); - if (Double.isNaN(size)) { - throw new IllegalArgumentException( - String.format("Illegal range: %f size is NaN", size)); - } else if (size > Long.MAX_VALUE) { - throw new IllegalArgumentException( - String.format("Illegal range: size %f > Long.MAX_VALUE", size)); - } else { - return StreamSupport.doubleStream( - new Streams.RangeDoubleSpliterator( - startInclusive, endExclusive, step, 0, (long) size)); - } - } - } } diff --git a/jdk/src/share/classes/java/util/stream/IntPipeline.java b/jdk/src/share/classes/java/util/stream/IntPipeline.java index ec6a4eb0bd3..aa7155abbde 100644 --- a/jdk/src/share/classes/java/util/stream/IntPipeline.java +++ b/jdk/src/share/classes/java/util/stream/IntPipeline.java @@ -172,7 +172,7 @@ abstract class IntPipeline@Override public final PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -183,7 +183,7 @@ abstract class IntPipeline // Stateless intermediate ops from IntStream @Override - public final LongStream longs() { + public final LongStream asLongStream() { return new LongPipeline.StatelessOp (this, StreamShape.INT_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override @@ -199,7 +199,7 @@ abstract class IntPipeline } @Override - public final DoubleStream doubles() { + public final DoubleStream asDoubleStream() { return new DoublePipeline.StatelessOp (this, StreamShape.INT_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override @@ -424,7 +424,7 @@ abstract class IntPipeline @Override public final long count() { - return longs().map(e -> 1L).sum(); + return asLongStream().map(e -> 1L).sum(); } @Override @@ -498,7 +498,7 @@ abstract class IntPipeline @Override public final int[] toArray() { return Nodes.flattenInt((Node.OfInt) evaluateToArrayNode(Integer[]::new)) - .asIntArray(); + .asPrimitiveArray(); } // diff --git a/jdk/src/share/classes/java/util/stream/IntStream.java b/jdk/src/share/classes/java/util/stream/IntStream.java index 576a6aadea2..3545c9b83ab 100644 --- a/jdk/src/share/classes/java/util/stream/IntStream.java +++ b/jdk/src/share/classes/java/util/stream/IntStream.java @@ -625,7 +625,7 @@ public interface IntStream extends BaseStream { * @return a {@code LongStream} consisting of the elements of this stream, * converted to {@code long} */ - LongStream longs(); + LongStream asLongStream(); /** * Returns a {@code DoubleStream} consisting of the elements of this stream, @@ -634,7 +634,7 @@ public interface IntStream extends BaseStream { * @return a {@code DoubleStream} consisting of the elements of this stream, * converted to {@code double} */ - DoubleStream doubles(); + DoubleStream asDoubleStream(); /** * Returns a {@code Stream} consisting of the elements of this stream, @@ -759,12 +759,13 @@ public interface IntStream extends BaseStream { /** * Returns a sequential {@code IntStream} from {@code startInclusive} * (inclusive) to {@code endExclusive} (exclusive) by an incremental step of - * 1. + * {@code 1}. * - * @implSpec - * The implementation behaves as if: + * @apiNote + * An equivalent sequence of increasing values can be produced + * sequentially using a {@code for} loop as follows: *
{@code - * intRange(startInclusive, endExclusive, 1); + * for (int i = startInclusive; i < endExclusive ; i++) { ... } * }* * @param startInclusive the (inclusive) initial value @@ -773,36 +774,37 @@ public interface IntStream extends BaseStream{ * elements */ public static IntStream range(int startInclusive, int endExclusive) { - return range(startInclusive, endExclusive, 1); + if (startInclusive >= endExclusive) { + return empty(); + } else { + return StreamSupport.intStream( + new Streams.RangeIntSpliterator(startInclusive, endExclusive, false)); + } } /** * Returns a sequential {@code IntStream} from {@code startInclusive} - * (inclusive) to {@code endExclusive} (exclusive) by a positive {@code - * step}. If {@code startInclusive} is greater than or equal to {@code - * endExclusive}, an empty stream is returned. + * (inclusive) to {@code endInclusive} (inclusive) by an incremental step of + * {@code 1}. * + * @apiNote * An equivalent sequence of increasing values can be produced * sequentially using a {@code for} loop as follows: *
{@code - * for (int i = startInclusive; i < endExclusive ; i += step) { ... } + * for (int i = startInclusive; i <= endInclusive ; i++) { ... } * }* * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @param step the positive difference between consecutive values + * @param endInclusive the inclusive upper bound * @return a sequential {@code IntStream} for the range of {@code int} * elements - * @throws IllegalArgumentException if {@code step} is less than or equal to - * 0 */ - public static IntStream range(int startInclusive, int endExclusive, int step) { - if (step <= 0) { - throw new IllegalArgumentException(String.format("Illegal step: %d", step)); - } else if (startInclusive >= endExclusive) { + public static IntStream rangeClosed(int startInclusive, int endInclusive) { + if (startInclusive > endInclusive) { return empty(); } else { - return StreamSupport.intStream(new Streams.RangeIntSpliterator(startInclusive, endExclusive, step)); + return StreamSupport.intStream( + new Streams.RangeIntSpliterator(startInclusive, endInclusive, true)); } } } diff --git a/jdk/src/share/classes/java/util/stream/LongPipeline.java b/jdk/src/share/classes/java/util/stream/LongPipeline.java index 1a4da10b040..9cbc9785be4 100644 --- a/jdk/src/share/classes/java/util/stream/LongPipeline.java +++ b/jdk/src/share/classes/java/util/stream/LongPipeline.java @@ -169,7 +169,7 @@ abstract class LongPipeline@Override public final PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -180,7 +180,7 @@ abstract class LongPipeline // Stateless intermediate ops from LongStream @Override - public final DoubleStream doubles() { + public final DoubleStream asDoubleStream() { return new DoublePipeline.StatelessOp (this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override @@ -479,7 +479,8 @@ abstract class LongPipeline @Override public final long[] toArray() { - return Nodes.flattenLong((Node.OfLong) evaluateToArrayNode(Long[]::new)).asLongArray(); + return Nodes.flattenLong((Node.OfLong) evaluateToArrayNode(Long[]::new)) + .asPrimitiveArray(); } diff --git a/jdk/src/share/classes/java/util/stream/LongStream.java b/jdk/src/share/classes/java/util/stream/LongStream.java index 22fae149baa..1a1b2414338 100644 --- a/jdk/src/share/classes/java/util/stream/LongStream.java +++ b/jdk/src/share/classes/java/util/stream/LongStream.java @@ -625,7 +625,7 @@ public interface LongStream extends BaseStream { * @return a {@code DoubleStream} consisting of the elements of this stream, * converted to {@code double} */ - DoubleStream doubles(); + DoubleStream asDoubleStream(); /** * Returns a {@code Stream} consisting of the elements of this stream, @@ -750,12 +750,13 @@ public interface LongStream extends BaseStream { /** * Returns a sequential {@code LongStream} from {@code startInclusive} * (inclusive) to {@code endExclusive} (exclusive) by an incremental step of - * 1. + * {@code 1}. * - * @implSpec - * The implementation behaves as if: + * @apiNote + * An equivalent sequence of increasing values can be produced + * sequentially using a {@code for} loop as follows: *
{@code - * longRange(startInclusive, endExclusive, 1); + * for (long i = startInclusive; i < endExclusive ; i++) { ... } * }* * @param startInclusive the (inclusive) initial value @@ -764,36 +765,56 @@ public interface LongStream extends BaseStream{ * elements */ public static LongStream range(long startInclusive, final long endExclusive) { - return range(startInclusive, endExclusive, 1); + if (startInclusive >= endExclusive) { + return empty(); + } else if (endExclusive - startInclusive < 0) { + // Size of range > Long.MAX_VALUE + // Split the range in two and concatenate + // Note: if the range is [Long.MIN_VALUE, Long.MAX_VALUE) then + // the lower range, [Long.MIN_VALUE, 0) will be further split in two +// long m = startInclusive + Long.divideUnsigned(endExclusive - startInclusive, 2) + 1; +// return Streams.concat(range(startInclusive, m), range(m, endExclusive)); + // This is temporary until Streams.concat is supported + throw new UnsupportedOperationException(); + } else { + return StreamSupport.longStream( + new Streams.RangeLongSpliterator(startInclusive, endExclusive, false)); + } } /** * Returns a sequential {@code LongStream} from {@code startInclusive} - * (inclusive) to {@code endExclusive} (exclusive) by {@code step}. If - * {@code startInclusive} is greater than or equal to {@code - * endExclusive}, an empty stream is returned. + * (inclusive) to {@code endInclusive} (inclusive) by an incremental step of + * {@code 1}. * + * @apiNote * An equivalent sequence of increasing values can be produced * sequentially using a {@code for} loop as follows: *
{@code - * for (long i = startInclusive; i < endExclusive ; i += step) { ... } + * for (long i = startInclusive; i <= endInclusive ; i++) { ... } * }* * @param startInclusive the (inclusive) initial value - * @param endExclusive the exclusive upper bound - * @param step the difference between consecutive values + * @param endInclusive the inclusive upper bound * @return a sequential {@code LongStream} for the range of {@code long} * elements - * @throws IllegalArgumentException if {@code step} is less than or equal to - * 0 */ - public static LongStream range(long startInclusive, final long endExclusive, final long step) { - if (step <= 0) { - throw new IllegalArgumentException(String.format("Illegal step: %d", step)); - } else if (startInclusive >= endExclusive) { + public static LongStream rangeClosed(long startInclusive, final long endInclusive) { + if (startInclusive > endInclusive) { return empty(); + } else if (endInclusive - startInclusive + 1 <= 0) { + // Size of range > Long.MAX_VALUE + // Split the range in two and concatenate + // Note: if the range is [Long.MIN_VALUE, Long.MAX_VALUE] then + // the lower range, [Long.MIN_VALUE, 0), and upper range, + // [0, Long.MAX_VALUE], will both be further split in two +// long m = startInclusive + Long.divideUnsigned(endInclusive - startInclusive, 2) + 1; +// return Streams.concat(range(startInclusive, m), rangeClosed(m, endInclusive)); + // This is temporary until Streams.concat is supported + throw new UnsupportedOperationException(); } else { - return StreamSupport.longStream(new Streams.RangeLongSpliterator(startInclusive, endExclusive, step)); + return StreamSupport.longStream( + new Streams.RangeLongSpliterator(startInclusive, endInclusive, true)); } } } diff --git a/jdk/src/share/classes/java/util/stream/Node.java b/jdk/src/share/classes/java/util/stream/Node.java index 528c3a6cca2..3cd765a6922 100644 --- a/jdk/src/share/classes/java/util/stream/Node.java +++ b/jdk/src/share/classes/java/util/stream/Node.java @@ -242,7 +242,7 @@ interface Node{ * an instance of an Integer[] array with a length of {@link #count()} * and then invokes {@link #copyInto(Integer[], int)} with that * Integer[] array at an offset of 0. This is not efficient and it is - * recommended to invoke {@link #asIntArray()}. + * recommended to invoke {@link #asPrimitiveArray()}. */ @Override default Integer[] asArray(IntFunction generator) { @@ -254,7 +254,7 @@ interface Node { /** * {@inheritDoc} * - * @implSpec the default implementation invokes {@link #asIntArray()} to + * @implSpec the default implementation invokes {@link #asPrimitiveArray()} to * obtain an int[] array then and copies the elements from that int[] * array into the boxed Integer[] array. This is not efficient and it * is recommended to invoke {@link #copyInto(int[], int)}. @@ -264,7 +264,7 @@ interface Node { if (Tripwire.ENABLED) Tripwire.trip(getClass(), "{0} calling Node.OfInt.copyInto(Integer[], int)"); - int[] array = asIntArray(); + int[] array = asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } @@ -285,7 +285,7 @@ interface Node { * * @return an array containing the contents of this {@code Node} */ - int[] asIntArray(); + int[] asPrimitiveArray(); /** * Copies the content of this {@code Node} into an int[] array, starting @@ -362,7 +362,7 @@ interface Node { * an instance of a Long[] array with a length of {@link #count()} and * then invokes {@link #copyInto(Long[], int)} with that Long[] array at * an offset of 0. This is not efficient and it is recommended to - * invoke {@link #asLongArray()}. + * invoke {@link #asPrimitiveArray()}. */ @Override default Long[] asArray(IntFunction generator) { @@ -374,7 +374,7 @@ interface Node { /** * {@inheritDoc} * - * @implSpec the default implementation invokes {@link #asLongArray()} + * @implSpec the default implementation invokes {@link #asPrimitiveArray()} * to obtain a long[] array then and copies the elements from that * long[] array into the boxed Long[] array. This is not efficient and * it is recommended to invoke {@link #copyInto(long[], int)}. @@ -384,7 +384,7 @@ interface Node { if (Tripwire.ENABLED) Tripwire.trip(getClass(), "{0} calling Node.OfInt.copyInto(Long[], int)"); - long[] array = asLongArray(); + long[] array = asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } @@ -405,7 +405,7 @@ interface Node { * * @return an array containing the contents of this {@code Node} */ - long[] asLongArray(); + long[] asPrimitiveArray(); /** * Copies the content of this {@code Node} into a long[] array, starting @@ -485,7 +485,7 @@ interface Node { * an instance of a Double[] array with a length of {@link #count()} and * then invokes {@link #copyInto(Double[], int)} with that Double[] * array at an offset of 0. This is not efficient and it is recommended - * to invoke {@link #asDoubleArray()}. + * to invoke {@link #asPrimitiveArray()}. */ @Override default Double[] asArray(IntFunction generator) { @@ -497,7 +497,7 @@ interface Node { /** * {@inheritDoc} * - * @implSpec the default implementation invokes {@link #asDoubleArray()} + * @implSpec the default implementation invokes {@link #asPrimitiveArray()} * to obtain a double[] array then and copies the elements from that * double[] array into the boxed Double[] array. This is not efficient * and it is recommended to invoke {@link #copyInto(double[], int)}. @@ -507,7 +507,7 @@ interface Node { if (Tripwire.ENABLED) Tripwire.trip(getClass(), "{0} calling Node.OfDouble.copyInto(Double[], int)"); - double[] array = asDoubleArray(); + double[] array = asPrimitiveArray(); for (int i = 0; i < array.length; i++) { boxed[offset + i] = array[i]; } @@ -528,7 +528,7 @@ interface Node { * * @return an array containing the contents of this {@code Node} */ - double[] asDoubleArray(); + double[] asPrimitiveArray(); /** * Copies the content of this {@code Node} into a double[] array, starting diff --git a/jdk/src/share/classes/java/util/stream/Nodes.java b/jdk/src/share/classes/java/util/stream/Nodes.java index 57e8a7c070c..e4ccfb96f9a 100644 --- a/jdk/src/share/classes/java/util/stream/Nodes.java +++ b/jdk/src/share/classes/java/util/stream/Nodes.java @@ -679,7 +679,7 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { return EMPTY_INT_ARRAY; } } @@ -696,7 +696,7 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { return EMPTY_LONG_ARRAY; } } @@ -713,7 +713,7 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { return EMPTY_DOUBLE_ARRAY; } } @@ -1395,7 +1395,7 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { if (array.length == curSize) { return array; } else { @@ -1449,7 +1449,7 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { if (array.length == curSize) { return array; } else { @@ -1503,7 +1503,7 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { if (array.length == curSize) { return array; } else { @@ -1561,7 +1561,7 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { int[] array = new int[(int) count()]; copyInto(array, 0); return array; @@ -1594,7 +1594,7 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { long[] array = new long[(int) count()]; copyInto(array, 0); return array; @@ -1627,7 +1627,7 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { double[] array = new double[(int) count()]; copyInto(array, 0); return array; @@ -1844,9 +1844,9 @@ final class Nodes { } @Override - public int[] asIntArray() { + public int[] asPrimitiveArray() { assert !building : "during building"; - return super.asIntArray(); + return super.asPrimitiveArray(); } @Override @@ -1904,9 +1904,9 @@ final class Nodes { } @Override - public long[] asLongArray() { + public long[] asPrimitiveArray() { assert !building : "during building"; - return super.asLongArray(); + return super.asPrimitiveArray(); } @Override @@ -1964,9 +1964,9 @@ final class Nodes { } @Override - public double[] asDoubleArray() { + public double[] asPrimitiveArray() { assert !building : "during building"; - return super.asDoubleArray(); + return super.asPrimitiveArray(); } @Override diff --git a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java index 6fc4cc0e7ff..92a139fa618 100644 --- a/jdk/src/share/classes/java/util/stream/ReferencePipeline.java +++ b/jdk/src/share/classes/java/util/stream/ReferencePipeline.java @@ -137,7 +137,7 @@ abstract class ReferencePipeline @Override public final Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } diff --git a/jdk/src/share/classes/java/util/stream/SortedOps.java b/jdk/src/share/classes/java/util/stream/SortedOps.java index 976f207f662..7b2a6934b4e 100644 --- a/jdk/src/share/classes/java/util/stream/SortedOps.java +++ b/jdk/src/share/classes/java/util/stream/SortedOps.java @@ -192,7 +192,7 @@ final class SortedOps { else { Node.OfInt n = (Node.OfInt) helper.evaluate(spliterator, true, generator); - int[] content = n.asIntArray(); + int[] content = n.asPrimitiveArray(); Arrays.parallelSort(content); return Nodes.node(content); @@ -231,7 +231,7 @@ final class SortedOps { else { Node.OfLong n = (Node.OfLong) helper.evaluate(spliterator, true, generator); - long[] content = n.asLongArray(); + long[] content = n.asPrimitiveArray(); Arrays.parallelSort(content); return Nodes.node(content); @@ -270,7 +270,7 @@ final class SortedOps { else { Node.OfDouble n = (Node.OfDouble) helper.evaluate(spliterator, true, generator); - double[] content = n.asDoubleArray(); + double[] content = n.asPrimitiveArray(); Arrays.parallelSort(content); return Nodes.node(content); @@ -401,7 +401,7 @@ final class SortedOps { @Override public void end() { - int[] ints = b.asIntArray(); + int[] ints = b.asPrimitiveArray(); Arrays.sort(ints); downstream.begin(ints.length); for (int anInt : ints) @@ -466,7 +466,7 @@ final class SortedOps { @Override public void end() { - long[] longs = b.asLongArray(); + long[] longs = b.asPrimitiveArray(); Arrays.sort(longs); downstream.begin(longs.length); for (long aLong : longs) @@ -531,7 +531,7 @@ final class SortedOps { @Override public void end() { - double[] doubles = b.asDoubleArray(); + double[] doubles = b.asPrimitiveArray(); Arrays.sort(doubles); downstream.begin(doubles.length); for (double aDouble : doubles) diff --git a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java index 8c051f00ca4..77c375612ea 100644 --- a/jdk/src/share/classes/java/util/stream/SpinedBuffer.java +++ b/jdk/src/share/classes/java/util/stream/SpinedBuffer.java @@ -227,7 +227,7 @@ class SpinedBuffer @Override public Iterator iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } @Override @@ -269,25 +269,45 @@ class SpinedBuffer * Return a {@link Spliterator} describing the contents of the buffer. */ public Spliterator spliterator() { - return new Spliterator () { + class Splitr implements Spliterator { // The current spine index int splSpineIndex; + // Last spine index + final int lastSpineIndex; + // The current element index into the current spine int splElementIndex; - // When splSpineIndex >= spineIndex and splElementIndex >= elementIndex then + // Last spine's last element index + 1 + final int lastSpineElementFence; + + // When splSpineIndex >= lastSpineIndex and + // splElementIndex >= lastSpineElementFence then // this spliterator is fully traversed // tryAdvance can set splSpineIndex > spineIndex if the last spine is full // The current spine array - E[] splChunk = (spine == null) ? curChunk : spine[0]; + E[] splChunk; + + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + this.splSpineIndex = firstSpineIndex; + this.lastSpineIndex = lastSpineIndex; + this.splElementIndex = firstSpineElementIndex; + this.lastSpineElementFence = lastSpineElementFence; + assert spine != null || firstSpineIndex == 0 && lastSpineIndex == 0; + splChunk = (spine == null) ? curChunk : spine[firstSpineIndex]; + } @Override public long estimateSize() { - return (spine == null) - ? (elementIndex - splElementIndex) - : count() - (priorElementCount[splSpineIndex] + splElementIndex); + return (splSpineIndex == lastSpineIndex) + ? (long) lastSpineElementFence - splElementIndex + : // # of elements prior to end - + priorElementCount[lastSpineIndex] + lastSpineElementFence - + // # of elements prior to current + priorElementCount[splSpineIndex] - splElementIndex; } @Override @@ -297,14 +317,14 @@ class SpinedBuffer @Override public boolean tryAdvance(Consumer super E> consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { consumer.accept(splChunk[splElementIndex++]); if (splElementIndex == splChunk.length) { splElementIndex = 0; ++splSpineIndex; - if (spine != null && splSpineIndex < spine.length) + if (spine != null && splSpineIndex <= lastSpineIndex) splChunk = spine[splSpineIndex]; } return true; @@ -314,45 +334,47 @@ class SpinedBuffer @Override public void forEachRemaining(Consumer super E> consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { int i = splElementIndex; // completed chunks, if any - for (int sp = splSpineIndex; sp < spineIndex; sp++) { + for (int sp = splSpineIndex; sp < lastSpineIndex; sp++) { E[] chunk = spine[sp]; for (; i < chunk.length; i++) { consumer.accept(chunk[i]); } i = 0; } - - // current chunk - E[] chunk = curChunk; - int hElementIndex = elementIndex; + // last (or current uncompleted) chunk + E[] chunk = (splSpineIndex == lastSpineIndex) ? splChunk : spine[lastSpineIndex]; + int hElementIndex = lastSpineElementFence; for (; i < hElementIndex; i++) { consumer.accept(chunk[i]); } - - splSpineIndex = spineIndex; - splElementIndex = elementIndex; + // mark consumed + splSpineIndex = lastSpineIndex; + splElementIndex = lastSpineElementFence; } } @Override public Spliterator trySplit() { - if (splSpineIndex < spineIndex) { - Spliterator ret = Arrays.spliterator(spine[splSpineIndex], - splElementIndex, spine[splSpineIndex].length); - splChunk = spine[++splSpineIndex]; + if (splSpineIndex < lastSpineIndex) { + // split just before last chunk (if it is full this means 50:50 split) + Spliterator ret = new Splitr(splSpineIndex, lastSpineIndex - 1, + splElementIndex, spine[lastSpineIndex-1].length); + // position to start of last chunk + splSpineIndex = lastSpineIndex; splElementIndex = 0; + splChunk = spine[splSpineIndex]; return ret; } - else if (splSpineIndex == spineIndex) { - int t = (elementIndex - splElementIndex) / 2; + else if (splSpineIndex == lastSpineIndex) { + int t = (lastSpineElementFence - splElementIndex) / 2; if (t == 0) return null; else { - Spliterator ret = Arrays.spliterator(curChunk, splElementIndex, splElementIndex + t); + Spliterator ret = Arrays.spliterator(splChunk, splElementIndex, splElementIndex + t); splElementIndex += t; return ret; } @@ -361,7 +383,8 @@ class SpinedBuffer return null; } } - }; + } + return new Splitr(0, spineIndex, 0, elementIndex); } /** @@ -436,7 +459,7 @@ class SpinedBuffer protected abstract T_ARR[] newArrayArray(int size); /** Create a new array of the proper type and size */ - protected abstract T_ARR newArray(int size); + public abstract T_ARR newArray(int size); /** Get the length of an array */ protected abstract int arrayLength(T_ARR array); @@ -555,30 +578,53 @@ class SpinedBuffer arrayForEach(curChunk, 0, elementIndex, consumer); } - abstract class BaseSpliterator > - implements Spliterator { + abstract class BaseSpliterator > + implements Spliterator.OfPrimitive { // The current spine index int splSpineIndex; + // Last spine index + final int lastSpineIndex; + // The current element index into the current spine int splElementIndex; - // When splSpineIndex >= spineIndex and splElementIndex >= elementIndex then + // Last spine's last element index + 1 + final int lastSpineElementFence; + + // When splSpineIndex >= lastSpineIndex and + // splElementIndex >= lastSpineElementFence then // this spliterator is fully traversed // tryAdvance can set splSpineIndex > spineIndex if the last spine is full // The current spine array - T_ARR splChunk = (spine == null) ? curChunk : spine[0]; + T_ARR splChunk; + + BaseSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + this.splSpineIndex = firstSpineIndex; + this.lastSpineIndex = lastSpineIndex; + this.splElementIndex = firstSpineElementIndex; + this.lastSpineElementFence = lastSpineElementFence; + assert spine != null || firstSpineIndex == 0 && lastSpineIndex == 0; + splChunk = (spine == null) ? curChunk : spine[firstSpineIndex]; + } + + abstract T_SPLITR newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence); abstract void arrayForOne(T_ARR array, int index, T_CONS consumer); - abstract T_SPLITER arraySpliterator(T_ARR array, int offset, int len); + abstract T_SPLITR arraySpliterator(T_ARR array, int offset, int len); @Override public long estimateSize() { - return (spine == null) - ? (elementIndex - splElementIndex) - : count() - (priorElementCount[splSpineIndex] + splElementIndex); + return (splSpineIndex == lastSpineIndex) + ? (long) lastSpineElementFence - splElementIndex + : // # of elements prior to end - + priorElementCount[lastSpineIndex] + lastSpineElementFence - + // # of elements prior to current + priorElementCount[splSpineIndex] - splElementIndex; } @Override @@ -586,15 +632,16 @@ class SpinedBuffer return SPLITERATOR_CHARACTERISTICS; } + @Override public boolean tryAdvance(T_CONS consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { arrayForOne(splChunk, splElementIndex++, consumer); if (splElementIndex == arrayLength(splChunk)) { splElementIndex = 0; ++splSpineIndex; - if (spine != null && splSpineIndex < spine.length) + if (spine != null && splSpineIndex <= lastSpineIndex) splChunk = spine[splSpineIndex]; } return true; @@ -602,39 +649,44 @@ class SpinedBuffer return false; } + @Override public void forEachRemaining(T_CONS consumer) { - if (splSpineIndex < spineIndex - || (splSpineIndex == spineIndex && splElementIndex < elementIndex)) { + if (splSpineIndex < lastSpineIndex + || (splSpineIndex == lastSpineIndex && splElementIndex < lastSpineElementFence)) { int i = splElementIndex; // completed chunks, if any - for (int sp = splSpineIndex; sp < spineIndex; sp++) { + for (int sp = splSpineIndex; sp < lastSpineIndex; sp++) { T_ARR chunk = spine[sp]; arrayForEach(chunk, i, arrayLength(chunk), consumer); i = 0; } - - arrayForEach(curChunk, i, elementIndex, consumer); - - splSpineIndex = spineIndex; - splElementIndex = elementIndex; + // last (or current uncompleted) chunk + T_ARR chunk = (splSpineIndex == lastSpineIndex) ? splChunk : spine[lastSpineIndex]; + arrayForEach(chunk, i, lastSpineElementFence, consumer); + // mark consumed + splSpineIndex = lastSpineIndex; + splElementIndex = lastSpineElementFence; } } @Override - public T_SPLITER trySplit() { - if (splSpineIndex < spineIndex) { - T_SPLITER ret = arraySpliterator(spine[splSpineIndex], splElementIndex, - arrayLength(spine[splSpineIndex]) - splElementIndex); - splChunk = spine[++splSpineIndex]; + public T_SPLITR trySplit() { + if (splSpineIndex < lastSpineIndex) { + // split just before last chunk (if it is full this means 50:50 split) + T_SPLITR ret = newSpliterator(splSpineIndex, lastSpineIndex - 1, + splElementIndex, arrayLength(spine[lastSpineIndex - 1])); + // position us to start of last chunk + splSpineIndex = lastSpineIndex; splElementIndex = 0; + splChunk = spine[splSpineIndex]; return ret; } - else if (splSpineIndex == spineIndex) { - int t = (elementIndex - splElementIndex) / 2; + else if (splSpineIndex == lastSpineIndex) { + int t = (lastSpineElementFence - splElementIndex) / 2; if (t == 0) return null; else { - T_SPLITER ret = arraySpliterator(curChunk, splElementIndex, t); + T_SPLITR ret = arraySpliterator(splChunk, splElementIndex, t); splElementIndex += t; return ret; } @@ -675,7 +727,7 @@ class SpinedBuffer } @Override - protected int[] newArray(int size) { + public int[] newArray(int size) { return new int[size]; } @@ -706,18 +758,26 @@ class SpinedBuffer return spine[ch][(int) (index-priorElementCount[ch])]; } - public int[] asIntArray() { - return asPrimitiveArray(); - } - @Override public PrimitiveIterator.OfInt iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfInt spliterator() { class Splitr extends BaseSpliterator implements Spliterator.OfInt { + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + super(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + + @Override + Splitr newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + return new Splitr(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } @Override void arrayForOne(int[] array, int index, IntConsumer consumer) { @@ -728,13 +788,13 @@ class SpinedBuffer Spliterator.OfInt arraySpliterator(int[] array, int offset, int len) { return Arrays.spliterator(array, offset, offset+len); } - }; - return new Splitr(); + } + return new Splitr(0, spineIndex, 0, elementIndex); } @Override public String toString() { - int[] array = asIntArray(); + int[] array = asPrimitiveArray(); if (array.length < 200) { return String.format("%s[length=%d, chunks=%d]%s", getClass().getSimpleName(), array.length, @@ -778,7 +838,7 @@ class SpinedBuffer } @Override - protected long[] newArray(int size) { + public long[] newArray(int size) { return new long[size]; } @@ -809,19 +869,28 @@ class SpinedBuffer return spine[ch][(int) (index-priorElementCount[ch])]; } - public long[] asLongArray() { - return asPrimitiveArray(); - } - @Override public PrimitiveIterator.OfLong iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfLong spliterator() { class Splitr extends BaseSpliterator implements Spliterator.OfLong { + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + super(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + + @Override + Splitr newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + return new Splitr(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + @Override void arrayForOne(long[] array, int index, LongConsumer consumer) { consumer.accept(array[index]); @@ -831,13 +900,13 @@ class SpinedBuffer Spliterator.OfLong arraySpliterator(long[] array, int offset, int len) { return Arrays.spliterator(array, offset, offset+len); } - }; - return new Splitr(); + } + return new Splitr(0, spineIndex, 0, elementIndex); } @Override public String toString() { - long[] array = asLongArray(); + long[] array = asPrimitiveArray(); if (array.length < 200) { return String.format("%s[length=%d, chunks=%d]%s", getClass().getSimpleName(), array.length, @@ -882,7 +951,7 @@ class SpinedBuffer } @Override - protected double[] newArray(int size) { + public double[] newArray(int size) { return new double[size]; } @@ -913,18 +982,27 @@ class SpinedBuffer return spine[ch][(int) (index-priorElementCount[ch])]; } - public double[] asDoubleArray() { - return asPrimitiveArray(); - } - @Override public PrimitiveIterator.OfDouble iterator() { - return Spliterators.iteratorFromSpliterator(spliterator()); + return Spliterators.iterator(spliterator()); } public Spliterator.OfDouble spliterator() { class Splitr extends BaseSpliterator implements Spliterator.OfDouble { + Splitr(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + super(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + + @Override + Splitr newSpliterator(int firstSpineIndex, int lastSpineIndex, + int firstSpineElementIndex, int lastSpineElementFence) { + return new Splitr(firstSpineIndex, lastSpineIndex, + firstSpineElementIndex, lastSpineElementFence); + } + @Override void arrayForOne(double[] array, int index, DoubleConsumer consumer) { consumer.accept(array[index]); @@ -935,12 +1013,12 @@ class SpinedBuffer return Arrays.spliterator(array, offset, offset+len); } } - return new Splitr(); + return new Splitr(0, spineIndex, 0, elementIndex); } @Override public String toString() { - double[] array = asDoubleArray(); + double[] array = asPrimitiveArray(); if (array.length < 200) { return String.format("%s[length=%d, chunks=%d]%s", getClass().getSimpleName(), array.length, diff --git a/jdk/src/share/classes/java/util/stream/Streams.java b/jdk/src/share/classes/java/util/stream/Streams.java index 9693839de62..11dbbe3d7ca 100644 --- a/jdk/src/share/classes/java/util/stream/Streams.java +++ b/jdk/src/share/classes/java/util/stream/Streams.java @@ -25,7 +25,6 @@ package java.util.stream; import java.util.Comparator; -import java.util.Iterator; import java.util.Objects; import java.util.Spliterator; import java.util.Spliterators; @@ -62,39 +61,62 @@ class Streams { * An {@code int} range spliterator. */ static final class RangeIntSpliterator implements Spliterator.OfInt { + // Can never be greater that upTo, this avoids overflow if upper bound + // is Integer.MAX_VALUE + // All elements are traversed if from == upTo & last == 0 private int from; private final int upTo; - private final int step; + // 1 if the range is closed and the last element has not been traversed + // Otherwise, 0 if the range is open, or is a closed range and all + // elements have been traversed + private int last; - RangeIntSpliterator(int from, int upTo, int step) { + RangeIntSpliterator(int from, int upTo, boolean closed) { + this(from, upTo, closed ? 1 : 0); + } + + private RangeIntSpliterator(int from, int upTo, int last) { this.from = from; this.upTo = upTo; - this.step = step; + this.last = last; } @Override public boolean tryAdvance(IntConsumer consumer) { - boolean hasNext = from < upTo; - if (hasNext) { - consumer.accept(from); - from += step; + final int i = from; + if (i < upTo) { + from++; + consumer.accept(i); + return true; } - return hasNext; + else if (last > 0) { + last = 0; + consumer.accept(i); + return true; + } + return false; } @Override public void forEachRemaining(IntConsumer consumer) { - int hUpTo = upTo; - int hStep = step; // hoist accesses and checks from loop - for (int i = from; i < hUpTo; i += hStep) - consumer.accept(i); + int i = from; + final int hUpTo = upTo; + int hLast = last; from = upTo; + last = 0; + while (i < hUpTo) { + consumer.accept(i++); + } + if (hLast > 0) { + // Last element of closed range + consumer.accept(i); + } } @Override public long estimateSize() { - int d = upTo - from; - return (d / step) + ((d % step == 0) ? 0 : 1); + // Ensure ranges of size > Integer.MAX_VALUE report the correct size + return ((long) upTo) - from + last; } @Override @@ -111,57 +133,108 @@ class Streams { @Override public Spliterator.OfInt trySplit() { - return estimateSize() <= 1 + long size = estimateSize(); + return size <= 1 ? null - : new RangeIntSpliterator(from, from = from + midPoint(), step); + // Left split always has a half-open range + : new RangeIntSpliterator(from, from = from + splitPoint(size), 0); } - private int midPoint() { - // Size is known to be >= 2 - int bisection = (upTo - from) / 2; - // If bisection > step then round down to nearest multiple of step - // otherwise round up to step - return bisection > step ? bisection - bisection % step : step; + /** + * The spliterator size below which the spliterator will be split + * at the mid-point to produce balanced splits. Above this size the + * spliterator will be split at a ratio of + * 1:(RIGHT_BALANCED_SPLIT_RATIO - 1) + * to produce right-balanced splits. + * + * Such splitting ensures that for very large ranges that the left + * side of the range will more likely be processed at a lower-depth + * than a balanced tree at the expense of a higher-depth for the right + * side of the range. + * + *
This is optimized for cases such as IntStream.ints() that is + * implemented as range of 0 to Integer.MAX_VALUE but is likely to be + * augmented with a limit operation that limits the number of elements + * to a count lower than this threshold. + */ + private static final int BALANCED_SPLIT_THRESHOLD = 1 << 24; + + /** + * The split ratio of the left and right split when the spliterator + * size is above BALANCED_SPLIT_THRESHOLD. + */ + private static final int RIGHT_BALANCED_SPLIT_RATIO = 1 << 3; + + private int splitPoint(long size) { + int d = (size < BALANCED_SPLIT_THRESHOLD) ? 2 : RIGHT_BALANCED_SPLIT_RATIO; + // 2 <= size <= 2^32 + return (int) (size / d); } } /** * A {@code long} range spliterator. + * + * This implementation cannot be used for ranges whose size is greater + * than Long.MAX_VALUE */ static final class RangeLongSpliterator implements Spliterator.OfLong { + // Can never be greater that upTo, this avoids overflow if upper bound + // is Long.MAX_VALUE + // All elements are traversed if from == upTo & last == 0 private long from; private final long upTo; - private final long step; + // 1 if the range is closed and the last element has not been traversed + // Otherwise, 0 if the range is open, or is a closed range and all + // elements have been traversed + private int last; - RangeLongSpliterator(long from, long upTo, long step) { + RangeLongSpliterator(long from, long upTo, boolean closed) { + this(from, upTo, closed ? 1 : 0); + } + + private RangeLongSpliterator(long from, long upTo, int last) { + assert upTo - from + last > 0; this.from = from; this.upTo = upTo; - this.step = step; + this.last = last; } @Override public boolean tryAdvance(LongConsumer consumer) { - boolean hasNext = from < upTo; - if (hasNext) { - consumer.accept(from); - from += step; + final long i = from; + if (i < upTo) { + from++; + consumer.accept(i); + return true; } - return hasNext; + else if (last > 0) { + last = 0; + consumer.accept(i); + return true; + } + return false; } @Override public void forEachRemaining(LongConsumer consumer) { - long hUpTo = upTo; - long hStep = step; // hoist accesses and checks from loop - for (long i = from; i < hUpTo; i += hStep) - consumer.accept(i); + long i = from; + final long hUpTo = upTo; + int hLast = last; from = upTo; + last = 0; + while (i < hUpTo) { + consumer.accept(i++); + } + if (hLast > 0) { + // Last element of closed range + consumer.accept(i); + } } @Override public long estimateSize() { - long d = upTo - from; - return (d / step) + ((d % step == 0) ? 0 : 1); + return upTo - from + last; } @Override @@ -178,98 +251,42 @@ class Streams { @Override public Spliterator.OfLong trySplit() { - return estimateSize() <= 1 + long size = estimateSize(); + return size <= 1 ? null - : new RangeLongSpliterator(from, from = from + midPoint(), step); + // Left split always has a half-open range + : new RangeLongSpliterator(from, from = from + splitPoint(size), 0); } - private long midPoint() { - // Size is known to be >= 2 - long bisection = (upTo - from) / 2; - // If bisection > step then round down to nearest multiple of step - // otherwise round up to step - return bisection > step ? bisection - bisection % step : step; - } - } + /** + * The spliterator size below which the spliterator will be split + * at the mid-point to produce balanced splits. Above this size the + * spliterator will be split at a ratio of + * 1:(RIGHT_BALANCED_SPLIT_RATIO - 1) + * to produce right-balanced splits. + * + *
Such splitting ensures that for very large ranges that the left + * side of the range will more likely be processed at a lower-depth + * than a balanced tree at the expense of a higher-depth for the right + * side of the range. + * + *
This is optimized for cases such as LongStream.longs() that is + * implemented as range of 0 to Long.MAX_VALUE but is likely to be + * augmented with a limit operation that limits the number of elements + * to a count lower than this threshold. + */ + private static final long BALANCED_SPLIT_THRESHOLD = 1 << 24; - /** - * A {@code double} range spliterator. - * - *
The traversing and splitting logic is equivalent to that of - * {@code RangeLongSpliterator} for increasing values with a {@code step} of - * {@code 1}. - * - *
A {@code double} value is calculated from the function - * {@code start + i * step} where {@code i} is the absolute position of the - * value when traversing an instance of this class that has not been split. - * This ensures the same values are produced at the same absolute positions - * regardless of how an instance of this class is split or traversed. - */ - static final class RangeDoubleSpliterator implements Spliterator.OfDouble { - private final double from; - private final double upTo; - private final double step; + /** + * The split ratio of the left and right split when the spliterator + * size is above BALANCED_SPLIT_THRESHOLD. + */ + private static final long RIGHT_BALANCED_SPLIT_RATIO = 1 << 3; - private long lFrom; - private final long lUpTo; - - RangeDoubleSpliterator(double from, double upTo, double step, long lFrom, long lUpTo) { - this.from = from; - this.upTo = upTo; - this.step = step; - this.lFrom = lFrom; - this.lUpTo = lUpTo; - } - - @Override - public boolean tryAdvance(DoubleConsumer consumer) { - boolean hasNext = lFrom < lUpTo; - if (hasNext) { - consumer.accept(from + lFrom * step); - lFrom++; - } - return hasNext; - } - - @Override - public void forEachRemaining(DoubleConsumer consumer) { - double hOrigin = from; - double hStep = step; - long hLUpTo = lUpTo; - long i = lFrom; - for (; i < hLUpTo; i++) { - consumer.accept(hOrigin + i * hStep); - } - lFrom = i; - } - - @Override - public long estimateSize() { - return lUpTo - lFrom; - } - - @Override - public int characteristics() { - return Spliterator.ORDERED | Spliterator.SIZED | Spliterator.SUBSIZED | - Spliterator.IMMUTABLE | Spliterator.NONNULL | - Spliterator.DISTINCT | Spliterator.SORTED; - } - - @Override - public Comparator super Double> getComparator() { - return null; - } - - @Override - public Spliterator.OfDouble trySplit() { - return estimateSize() <= 1 - ? null - : new RangeDoubleSpliterator(from, upTo, step, lFrom, lFrom = lFrom + midPoint()); - } - - private long midPoint() { - // Size is known to be >= 2 - return (lUpTo - lFrom) / 2; + private long splitPoint(long size) { + long d = (size < BALANCED_SPLIT_THRESHOLD) ? 2 : RIGHT_BALANCED_SPLIT_RATIO; + // 2 <= size <= Long.MAX_VALUE + return size / d; } } diff --git a/jdk/src/share/classes/java/util/stream/package-info.java b/jdk/src/share/classes/java/util/stream/package-info.java index 4dfb1e998d2..39509ffffc6 100644 --- a/jdk/src/share/classes/java/util/stream/package-info.java +++ b/jdk/src/share/classes/java/util/stream/package-info.java @@ -141,7 +141,7 @@ * parallelism is explicitly requested. For example, {@code Collection} has methods * {@link java.util.Collection#stream} and {@link java.util.Collection#parallelStream}, * which produce sequential and parallel streams respectively; other stream-bearing methods - * such as {@link java.util.stream.Streams#intRange(int, int)} produce sequential + * such as {@link java.util.stream.IntStream#range(int, int)} produce sequential * streams but these can be efficiently parallelized by calling {@code parallel()} on the * result. The set of operations on serial and parallel streams is identical. To execute the * "sum of weights of blocks" query in parallel, we would do: diff --git a/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java index a996b14e0eb..cdca7f63bfc 100644 --- a/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java +++ b/jdk/src/share/classes/java/util/zip/DeflaterInputStream.java @@ -97,7 +97,7 @@ public class DeflaterInputStream extends FilterInputStream { * @param in input stream to read the uncompressed data to * @param defl compressor ("deflater") for this stream * @param bufLen compression buffer size - * @throws IllegalArgumentException if {@code bufLen} is <= 0 + * @throws IllegalArgumentException if {@code bufLen <= 0} * @throws NullPointerException if {@code in} or {@code defl} is null */ public DeflaterInputStream(InputStream in, Deflater defl, int bufLen) { @@ -163,8 +163,7 @@ public class DeflaterInputStream extends FilterInputStream { * @param len maximum number of compressed bytes to read into {@code b} * @return the actual number of bytes read, or -1 if the end of the * uncompressed input stream is reached - * @throws IndexOutOfBoundsException if {@code len} > {@code b.length - - * off} + * @throws IndexOutOfBoundsException if {@code len > b.length - off} * @throws IOException if an I/O error occurs or if this input stream is * already closed */ diff --git a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java index c19a222e5dc..7cb0f8388c4 100644 --- a/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/DeflaterOutputStream.java @@ -71,7 +71,7 @@ class DeflaterOutputStream extends FilterOutputStream { * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream * - * @throws IllegalArgumentException if size is <= 0 + * @throws IllegalArgumentException if {@code size <= 0} * * @since 1.7 */ @@ -101,7 +101,7 @@ class DeflaterOutputStream extends FilterOutputStream { * @param out the output stream * @param def the compressor ("deflater") * @param size the output buffer size - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public DeflaterOutputStream(OutputStream out, Deflater def, int size) { this(out, def, size, false); diff --git a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java index 74a5c60f1a8..b3d9240ba01 100644 --- a/jdk/src/share/classes/java/util/zip/GZIPInputStream.java +++ b/jdk/src/share/classes/java/util/zip/GZIPInputStream.java @@ -71,7 +71,7 @@ class GZIPInputStream extends InflaterInputStream { * @exception ZipException if a GZIP format error has occurred or the * compression method used is unsupported * @exception IOException if an I/O error has occurred - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public GZIPInputStream(InputStream in, int size) throws IOException { super(in, new Inflater(true), size); diff --git a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java index d5edcf1226a..e454956a127 100644 --- a/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/GZIPOutputStream.java @@ -61,8 +61,7 @@ class GZIPOutputStream extends DeflaterOutputStream { * @param out the output stream * @param size the output buffer size * @exception IOException If an I/O error has occurred. - * @exception IllegalArgumentException if size is <= 0 - + * @exception IllegalArgumentException if {@code size <= 0} */ public GZIPOutputStream(OutputStream out, int size) throws IOException { this(out, size, false); @@ -81,7 +80,7 @@ class GZIPOutputStream extends DeflaterOutputStream { * {@link Deflater#SYNC_FLUSH} before flushing the output * stream, otherwise only flushes the output stream * @exception IOException If an I/O error has occurred. - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} * * @since 1.7 */ diff --git a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java index b948905d0e8..23cb9d943d2 100644 --- a/jdk/src/share/classes/java/util/zip/InflaterInputStream.java +++ b/jdk/src/share/classes/java/util/zip/InflaterInputStream.java @@ -75,7 +75,7 @@ class InflaterInputStream extends FilterInputStream { * @param in the input stream * @param inf the decompressor ("inflater") * @param size the input buffer size - * @exception IllegalArgumentException if size is <= 0 + * @exception IllegalArgumentException if {@code size <= 0} */ public InflaterInputStream(InputStream in, Inflater inf, int size) { super(in); @@ -191,7 +191,7 @@ class InflaterInputStream extends FilterInputStream { * @param n the number of bytes to skip * @return the actual number of bytes skipped. * @exception IOException if an I/O error has occurred - * @exception IllegalArgumentException if n < 0 + * @exception IllegalArgumentException if {@code n < 0} */ public long skip(long n) throws IOException { if (n < 0) { diff --git a/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java b/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java index ab90ccb0300..53f8b5dedee 100644 --- a/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java +++ b/jdk/src/share/classes/java/util/zip/InflaterOutputStream.java @@ -97,7 +97,7 @@ public class InflaterOutputStream extends FilterOutputStream { * @param out output stream to write the uncompressed data to * @param infl decompressor ("inflater") for this stream * @param bufLen decompression buffer size - * @throws IllegalArgumentException if {@code bufLen} is <= 0 + * @throws IllegalArgumentException if {@code bufLen <= 0} * @throws NullPointerException if {@code out} or {@code infl} is null */ public InflaterOutputStream(OutputStream out, Inflater infl, int bufLen) { @@ -211,8 +211,8 @@ public class InflaterOutputStream extends FilterOutputStream { * the output stream * @param off starting offset of the compressed data within {@code b} * @param len number of bytes to decompress from {@code b} - * @throws IndexOutOfBoundsException if {@code off} < 0, or if - * {@code len} < 0, or if {@code len} > {@code b.length - off} + * @throws IndexOutOfBoundsException if {@code off < 0}, or if + * {@code len < 0}, or if {@code len > b.length - off} * @throws IOException if an I/O error occurs or this stream is already * closed * @throws NullPointerException if {@code b} is null diff --git a/jdk/src/share/classes/java/util/zip/ZipInputStream.java b/jdk/src/share/classes/java/util/zip/ZipInputStream.java index 5c315d452c0..fee9f5108d3 100644 --- a/jdk/src/share/classes/java/util/zip/ZipInputStream.java +++ b/jdk/src/share/classes/java/util/zip/ZipInputStream.java @@ -232,7 +232,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants { * @return the actual number of bytes skipped * @exception ZipException if a ZIP file error has occurred * @exception IOException if an I/O error has occurred - * @exception IllegalArgumentException if n < 0 + * @exception IllegalArgumentException if {@code n < 0} */ public long skip(long n) throws IOException { if (n < 0) { diff --git a/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java b/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java index e396c5b45f2..fa1eaedd2f2 100644 --- a/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/IvParameterSpec.java @@ -68,7 +68,7 @@ public class IvParameterSpec implements AlgorithmParameterSpec { * starts. * @param len the number of IV bytes. * @throws IllegalArgumentException if
iv
isnull
- * or(iv.length - offset < len)
+ * or {@code (iv.length - offset < len)} * @throws ArrayIndexOutOfBoundsException is thrown ifoffset
* orlen
index bytes outside theiv
. */ diff --git a/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java b/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java index 7248eefa804..499480c2c5f 100644 --- a/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/RC5ParameterSpec.java @@ -80,7 +80,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { * bytes of the buffer are copied to protect against subsequent * modification. * @exception IllegalArgumentException ifiv
is - *null
or(iv.length < 2 * (wordSize / 8))
+ *null
or {@code (iv.length < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) { this(version, rounds, wordSize, iv, 0); @@ -107,7 +107,7 @@ public class RC5ParameterSpec implements AlgorithmParameterSpec { * @param offset the offset iniv
where the IV starts. * @exception IllegalArgumentException ifiv
is *null
or - *(iv.length - offset < 2 * (wordSize / 8))
+ * {@code (iv.length - offset < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int offset) { diff --git a/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java b/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java index 827be0f5274..586399dea4f 100644 --- a/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java +++ b/jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java @@ -130,7 +130,7 @@ public class SecretKeySpec implements KeySpec, SecretKey { * for information about standard algorithm names. * @exception IllegalArgumentException ifalgorithm
* is null orkey
is null, empty, or too short, - * i.e.key.length-offset
or. + * i.e. {@code key.length-offset offset len
index bytes outside the *key
. diff --git a/jdk/src/share/classes/javax/naming/BinaryRefAddr.java b/jdk/src/share/classes/javax/naming/BinaryRefAddr.java index 541c0342094..711a834087b 100644 --- a/jdk/src/share/classes/javax/naming/BinaryRefAddr.java +++ b/jdk/src/share/classes/javax/naming/BinaryRefAddr.java @@ -89,9 +89,9 @@ public class BinaryRefAddr extends RefAddr { * @param src The non-null contents of the address as a byte array. * The contents of src is copied into the new BinaryRefAddr. * @param offset The starting index in src to get the bytes. - * 0 <= offset <= src.length. + * {@code 0 <= offset <= src.length}. * @param count The number of bytes to extract from src. - * 0 <= count <= src.length-offset. + * {@code 0 <= count <= src.length-offset}. */ public BinaryRefAddr(String addrType, byte[] src, int offset, int count) { super(addrType); diff --git a/jdk/src/share/classes/javax/naming/directory/Attribute.java b/jdk/src/share/classes/javax/naming/directory/Attribute.java index fda9e3de264..6ed0d9ad530 100644 --- a/jdk/src/share/classes/javax/naming/directory/Attribute.java +++ b/jdk/src/share/classes/javax/naming/directory/Attribute.java @@ -265,7 +265,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * If the attribute values are unordered, * this method returns the value that happens to be at that index. * @param ix The index of the value in the ordered list of attribute values. - * 0 <= ix < size(). + * {@code 0 <= ix < size()}. * @return The possibly null attribute value at index ix; * null if the attribute value is null. * @exception NamingException If a naming exception was encountered while @@ -284,7 +284,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * the front of the list (and their indices decremented by one). * * @param ix The index of the value to remove. - * 0 <= ix < size(). + * {@code 0 <= ix < size()}. * @return The possibly null attribute value at index ix that was removed; * null if the attribute value is null. * @exception IndexOutOfBoundsException If ix is outside the specified range. @@ -302,7 +302,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * IllegalStateException is thrown. * * @param ix The index in the ordered list of attribute values to add the new value. - * 0 <= ix <= size(). + * {@code 0 <= ix <= size()}. * @param attrVal The possibly null attribute value to add; if null, null is * the value added. * @exception IndexOutOfBoundsException If ix is outside the specified range. @@ -322,7 +322,7 @@ public interface Attribute extends Cloneable, java.io.Serializable { * In that case, IllegalStateException is thrown. * * @param ix The index of the value in the ordered list of attribute values. - * 0 <= ix < size(). + * {@code 0 <= ix < size()}. * @param attrVal The possibly null attribute value to use. * If null, 'null' replaces the old value. * @return The possibly null attribute value at index ix that was replaced. diff --git a/jdk/src/share/classes/javax/naming/ldap/LdapName.java b/jdk/src/share/classes/javax/naming/ldap/LdapName.java index 256f7530cdc..ce94537062d 100644 --- a/jdk/src/share/classes/javax/naming/ldap/LdapName.java +++ b/jdk/src/share/classes/javax/naming/ldap/LdapName.java @@ -443,7 +443,7 @@ public class LdapName implements Name { * @throws InvalidNameException if suffix is not a valid LDAP * name, or if the addition of the components would violate the * syntax rules of this LDAP name. - * @throws IndexOutOfBoundsException. + * @throws IndexOutOfBoundsException * If posn is outside the specified range. */ public Name addAll(int posn, Name suffix) @@ -474,7 +474,7 @@ public class LdapName implements Name { * Must be in the range [0,size()]. * * @return The updated name (not a new instance). - * @throws IndexOutOfBoundsException. + * @throws IndexOutOfBoundsException * If posn is outside the specified range. */ public Name addAll(int posn, ListsuffixRdns) { @@ -527,7 +527,7 @@ public class LdapName implements Name { * Must be in the range [0,size()]. * @return The updated LdapName, not a new instance. * Cannot be null. - * @exception IndexOutOfBoundsException. + * @exception IndexOutOfBoundsException * If posn is outside the specified range. * @exception InvalidNameException If adding comp at the * specified position would violate the name's syntax. diff --git a/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java b/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java index 07e29b7a36f..18c08e59933 100644 --- a/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/PagedResultsControl.java @@ -36,7 +36,7 @@ import com.sun.jndi.ldap.BerEncoder; * at which it invokes search operations. * * The following code sample shows how the class may be used: - *
+ **{@code * * // Open an LDAP association * LdapContext ctx = new InitialLdapContext(); @@ -89,13 +89,13 @@ import com.sun.jndi.ldap.BerEncoder; * ctx.close(); * ... * - *+ * }* This class implements the LDAPv3 Control for paged-results as defined in * RFC 2696. * * The control's value has the following ASN.1 definition: - *
+ ** * @since 1.5 * @see PagedResultsResponseControl diff --git a/jdk/src/share/classes/javax/naming/ldap/SortControl.java b/jdk/src/share/classes/javax/naming/ldap/SortControl.java index 486600f72fd..3aef9fdd9ec 100644 --- a/jdk/src/share/classes/javax/naming/ldap/SortControl.java +++ b/jdk/src/share/classes/javax/naming/ldap/SortControl.java @@ -40,7 +40,7 @@ import com.sun.jndi.ldap.BerEncoder; * then the search operation is not performed and an error is returned. *{@code * * realSearchControlValue ::= SEQUENCE { * size INTEGER (0..maxInt), @@ -104,7 +104,7 @@ import com.sun.jndi.ldap.BerEncoder; * cookie OCTET STRING * } * - *+ * }* The following code sample shows how the class may be used: - *
+ **{@code * * // Open an LDAP association * LdapContext ctx = new InitialLdapContext(); @@ -85,7 +85,7 @@ import com.sun.jndi.ldap.BerEncoder; * ctx.close(); * ... * - *+ * }* This class implements the LDAPv3 Request Control for server-side sorting * as defined in diff --git a/jdk/src/share/classes/javax/net/ssl/SNIHostName.java b/jdk/src/share/classes/javax/net/ssl/SNIHostName.java index 1d02104e172..588a8547e11 100644 --- a/jdk/src/share/classes/javax/net/ssl/SNIHostName.java +++ b/jdk/src/share/classes/javax/net/ssl/SNIHostName.java @@ -295,8 +295,8 @@ public final class SNIHostName extends SNIServerName { * representing the hostname(s) to match * @throws NullPointerException if {@code regex} is * {@code null} - * @throws PatternSyntaxException if the regular expression's syntax - * is invalid + * @throws java.util.regex.PatternSyntaxException if the regular expression's + * syntax is invalid */ public static SNIMatcher createSNIMatcher(String regex) { if (regex == null) { diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java index 433361c6a6b..92e838623f4 100644 --- a/jdk/src/share/classes/javax/net/ssl/SSLEngine.java +++ b/jdk/src/share/classes/javax/net/ssl/SSLEngine.java @@ -211,7 +211,7 @@ import java.nio.ReadOnlyBufferException; * that the source buffer has enough room to hold a record (enlarging if * necessary), and then obtain more inbound data. * - *
+ ** *{@code * SSLEngineResult r = engine.unwrap(src, dst); * switch (r.getStatus()) { * BUFFER_OVERFLOW: @@ -238,7 +238,7 @@ import java.nio.ReadOnlyBufferException; * break; * // other cases: CLOSED, OK. * } - *+ * }* Unlike
SSLSocket
, all methods of SSLEngine are @@ -442,7 +442,7 @@ public abstract class SSLEngine { ** {@link #wrap(ByteBuffer [], int, int, ByteBuffer) * engine.wrap(new ByteBuffer [] { src }, 0, 1, dst);} - *+ *
ByteBuffer
containing outbound application data
@@ -478,7 +478,7 @@ public abstract class SSLEngine {
* * * @param srcs * an array of* {@link #wrap(ByteBuffer [], int, int, ByteBuffer) * engine.wrap(srcs, 0, srcs.length, dst);} - *+ *
ByteBuffers
containing the
@@ -597,7 +597,7 @@ public abstract class SSLEngine {
* * * @param src * a* {@link #unwrap(ByteBuffer, ByteBuffer [], int, int) * engine.unwrap(src, new ByteBuffer [] { dst }, 0, 1);} - *+ *
ByteBuffer
containing inbound network data.
@@ -633,7 +633,7 @@ public abstract class SSLEngine {
* * * @param src * a* {@link #unwrap(ByteBuffer, ByteBuffer [], int, int) * engine.unwrap(src, dsts, 0, dsts.length);} - *+ *
ByteBuffer
containing inbound network data.
diff --git a/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java b/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java
index 45dcddbdeca..93ad6a7b383 100644
--- a/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java
+++ b/jdk/src/share/classes/javax/net/ssl/SSLEngineResult.java
@@ -173,7 +173,7 @@ public class SSLEngineResult {
*
* @throws IllegalArgumentException
* if the status
or handshakeStatus
- * arguments are null, or if <bytesConsumed
or
+ * arguments are null, or if bytesConsumed
or
* bytesProduced
is negative.
*/
public SSLEngineResult(Status status, HandshakeStatus handshakeStatus,
diff --git a/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java b/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java
index 61f1ddcccce..3459545e96d 100644
--- a/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java
+++ b/jdk/src/share/classes/javax/net/ssl/SSLSessionContext.java
@@ -90,7 +90,7 @@ public interface SSLSessionContext {
* @param seconds the new session timeout limit in seconds; zero means
* there is no limit.
*
- * @exception IllegalArgumentException if the timeout specified is < 0.
+ * @exception IllegalArgumentException if the timeout specified is {@code < 0}.
* @see #getSessionTimeout
*/
public void setSessionTimeout(int seconds)
@@ -122,7 +122,7 @@ public interface SSLSessionContext {
*
* @param size the new session cache size limit; zero means there is no
* limit.
- * @exception IllegalArgumentException if the specified size is < 0.
+ * @exception IllegalArgumentException if the specified size is {@code < 0}.
* @see #getSessionCacheSize
*/
public void setSessionCacheSize(int size)
diff --git a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java
index ae064acf9b7..ca22d163590 100644
--- a/jdk/src/share/classes/javax/script/ScriptEngineFactory.java
+++ b/jdk/src/share/classes/javax/script/ScriptEngineFactory.java
@@ -144,8 +144,7 @@ public interface ScriptEngineFactory {
* of the supported scripting language. For instance, an implementaton for a Javascript
* engine might be;
* - *
- *
+ * {@code
* public String getMethodCallSyntax(String obj,
* String m, String... args) {
* String ret = obj;
@@ -159,8 +158,7 @@ public interface ScriptEngineFactory {
* ret += ")";
* return ret;
* }
- *
- *
+ * }
* * * @param obj The name representing the object whose method is to be invoked. The @@ -200,17 +198,17 @@ public interface ScriptEngineFactory { * Returns A valid scripting language executable progam with given statements. * For instance an implementation for a PHP engine might be: *
- *
+ * {@code
* public String getProgram(String... statements) {
- * $retval = "<?\n";
+ * $retval = "\n";
* int len = statements.length;
* for (int i = 0; i < len; i++) {
* $retval += statements[i] + ";\n";
* }
- * $retval += "?>";
+ * $retval += "?>";
*
* }
- *
+ * }
*
* @param statements The statements to be executed. May be return values of
* calls to the getMethodCallSyntax
and getOutputStatement
methods.
diff --git a/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java b/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java
index 4c6e9a271fa..843accac99b 100644
--- a/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java
+++ b/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java
@@ -79,7 +79,7 @@ public interface CallbackHandler {
* This example code is for guidance only. Many details,
* including proper error handling, are left out for simplicity.
*
- * + ** * @param callbacks an array of{@code * public void handle(Callback[] callbacks) * throws IOException, UnsupportedCallbackException { * @@ -133,7 +133,7 @@ public interface CallbackHandler { * private char[] readPassword(InputStream in) throws IOException { * // insert code to read a user password from the input stream * } - *+ * }
Callback
objects provided
* by an underlying security service which contains
diff --git a/jdk/src/share/classes/javax/security/sasl/Sasl.java b/jdk/src/share/classes/javax/security/sasl/Sasl.java
index 6bdc104b98a..bb9fb2eec04 100644
--- a/jdk/src/share/classes/javax/security/sasl/Sasl.java
+++ b/jdk/src/share/classes/javax/security/sasl/Sasl.java
@@ -278,7 +278,7 @@ public class Sasl {
*
* This method uses the
JCA Security Provider Framework, described in the
- * "Java Cryptography Architecture API Specification & Reference", for
+ * "Java Cryptography Architecture API Specification & Reference", for
* locating and selecting a SaslClient implementation.
*
* First, it
@@ -303,7 +303,7 @@ public class Sasl {
* SaslClientFactory.DIGEST-MD5 com.wiz.sasl.digest.ClientFactory
** See the - * "Java Cryptography Architecture API Specification & Reference" + * "Java Cryptography Architecture API Specification & Reference" * for information about how to install and configure security service * providers. * @@ -428,7 +428,7 @@ public class Sasl { * This method uses the JCA Security Provider Framework, * described in the - * "Java Cryptography Architecture API Specification & Reference", for + * "Java Cryptography Architecture API Specification & Reference", for * locating and selecting a SaslServer implementation. * * First, it @@ -453,7 +453,7 @@ public class Sasl { * SaslServerFactory.DIGEST-MD5 com.wiz.sasl.digest.ServerFactory *
* See the - * "Java Cryptography Architecture API Specification & Reference" + * "Java Cryptography Architecture API Specification & Reference" * for information about how to install and configure security * service providers. * diff --git a/jdk/src/share/classes/javax/security/sasl/SaslClient.java b/jdk/src/share/classes/javax/security/sasl/SaslClient.java index 010246c4b13..10f8d3dc3c2 100644 --- a/jdk/src/share/classes/javax/security/sasl/SaslClient.java +++ b/jdk/src/share/classes/javax/security/sasl/SaslClient.java @@ -38,13 +38,13 @@ package javax.security.sasl; *
* Here's an example of how an LDAP library might use a SaslClient. * It first gets an instance of a SaslClient: - *
* It can then proceed to use the client for authentication. * For example, an LDAP library might use the client as follows: - *+ *+ *}{@code * SaslClient sc = Sasl.createSaslClient(mechanisms, * authorizationId, protocol, serverName, props, callbackHandler); - *
* * If the mechanism has an initial response, the library invokes * evaluateChallenge() with an empty diff --git a/jdk/src/share/classes/javax/security/sasl/SaslServer.java b/jdk/src/share/classes/javax/security/sasl/SaslServer.java index 54ba6843411..ec5d20a230d 100644 --- a/jdk/src/share/classes/javax/security/sasl/SaslServer.java +++ b/jdk/src/share/classes/javax/security/sasl/SaslServer.java @@ -47,7 +47,7 @@ package javax.security.sasl; * For example, suppose the LDAP server received an LDAP BIND request * containing the name of the SASL mechanism and an (optional) initial * response. It then might use the server as follows: - *+ *+ *}{@code * // Get initial response and send to server * byte[] response = (sc.hasInitialResponse() ? sc.evaluateChallenge(new byte[0]) : * null); @@ -74,7 +74,7 @@ package javax.security.sasl; * ldap.out = new SecureOutputStream(sc, ldap.out); * } * } - *
* * @since 1.5 * diff --git a/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java b/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java index 94859e83098..7caa52eb5d6 100644 --- a/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java +++ b/jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java @@ -121,7 +121,7 @@ public final class ResponseAPDU implements java.io.Serializable { * Returns the value of the status bytes SW1 and SW2 as a single * status word SW. * It is defined as - *+ *+ *}{@code * while (!ss.isComplete()) { * try { * byte[] challenge = ss.evaluateResponse(response); @@ -75,7 +75,7 @@ package javax.security.sasl; * ldap.out = new SecureOutputStream(ss, ldap.out); * } * } - *
(getSW1() << 8) | getSW2()
.
+ * {@code (getSW1() << 8) | getSW2()}
*
* @return the value of the status word SW.
*/
diff --git a/jdk/src/share/classes/javax/sql/DataSource.java b/jdk/src/share/classes/javax/sql/DataSource.java
index d4d9d70ddd4..8235d2a2779 100644
--- a/jdk/src/share/classes/javax/sql/DataSource.java
+++ b/jdk/src/share/classes/javax/sql/DataSource.java
@@ -82,7 +82,7 @@ public interface DataSource extends CommonDataSource, Wrapper {
*
* @return a connection to the data source
* @exception SQLException if a database access error occurs
- * @throws SQLTimeoutException when the driver has determined that the
+ * @throws java.sql.SQLTimeoutException when the driver has determined that the
* timeout value specified by the {@code setLoginTimeout} method
* has been exceeded and has at least tried to cancel the
* current database connection attempt
@@ -98,7 +98,7 @@ public interface DataSource extends CommonDataSource, Wrapper {
* @param password the user's password
* @return a connection to the data source
* @exception SQLException if a database access error occurs
- * @throws SQLTimeoutException when the driver has determined that the
+ * @throws java.sql.SQLTimeoutException when the driver has determined that the
* timeout value specified by the {@code setLoginTimeout} method
* has been exceeded and has at least tried to cancel the
* current database connection attempt
diff --git a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
index 1019b8de19f..a3b13fa0f5c 100644
--- a/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
+++ b/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
@@ -109,10 +109,10 @@ import javax.sql.rowset.serial.*;
* CachedRowSet
TM
* object crs
might have its command property set. Note that if a
* tool is used to set properties, this is the code that the tool would use.
- * + **{@code * crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" + * "WHERE CREDIT_LIMIT > ? AND REGION = ?"); - *+ * }
* In this example, the values for CREDIT_LIMIT
and
* REGION
are placeholder parameters, which are indicated with a
@@ -129,16 +129,16 @@ import javax.sql.rowset.serial.*;
*
* The following code fragment demonstrates * setting the two parameters in the query from the previous example. - *
+ ** If the{@code * crs.setInt(1, 5000); * crs.setString(2, "West"); - *+ * }
execute
method is called at this point, the query
* sent to the DBMS will be:
- * + ** NOTE: Setting{@code * "SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" + * "WHERE CREDIT_LIMIT > 5000 AND REGION = 'West'" - *+ * }
Array
, Clob
, Blob
and
* Ref
objects as a command parameter, stores these values as
* SerialArray
, SerialClob
, SerialBlob
@@ -158,7 +158,7 @@ import javax.sql.rowset.serial.*;
* When the method execute
is called, the values in the
* Hashtable
object are substituted for the appropriate placeholder
* parameters in the command.
- * + *
* A call to the method getParams
returns the values stored in the
* Hashtable
object as an array of Object
instances.
* An element in this array may be a simple Object
instance or an
@@ -2535,7 +2535,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
* specific abstract data types.
*
* The parameter value set by this method is stored internally and
- * will be supplied as the appropriate parameter in this RowSet
RowSet
* object's command when the method execute
is called.
* Methods such as execute
and populate
must be
* provided in any class that extends this class and implements one or
diff --git a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java
index 7861223911b..1a8517520a2 100644
--- a/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java
+++ b/jdk/src/share/classes/javax/sql/rowset/CachedRowSet.java
@@ -118,7 +118,7 @@ import javax.sql.rowset.spi.*;
*
* There are two ways for a CachedRowSet
object to specify which
* SyncProvider
object it will use.
- *
CachedRowSet
* object crs2 that is initialized with default values except that its
@@ -135,7 +135,7 @@ import javax.sql.rowset.spi.*;
* * crs.setSyncProvider("com.fred.providers.HighAvailabilityProvider"); *- *
SyncFactory
and SyncProvider
for
* more details.
*
@@ -426,10 +426,10 @@ import javax.sql.rowset.spi.*;
* The following code fragment illustrates how the CachedRowSet
* object crs
might have its command property set. Note that if a
* tool is used to set properties, this is the code that the tool would use.
- * + **{@code * crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS " + * "WHERE CREDIT_LIMIT > ? AND REGION = ?"); - *+ * }
* The values that will be used to set the command's placeholder parameters are
* contained in the RowSet
object's params
field, which is a
@@ -457,7 +457,7 @@ import javax.sql.rowset.spi.*;
* The following code fragment gives an idea of how the reader
* does this, after obtaining the Connection
object
* con
.
- *
+ **{@code * PreparedStatement pstmt = con.prepareStatement(crs.getCommand()); * reader.decodeParams(); * // decodeParams figures out which setter methods to use and does something @@ -465,16 +465,16 @@ import javax.sql.rowset.spi.*; * // for (i = 0; i < params.length; i++) { * // pstmt.setObject(i + 1, params[i]); * // } - *+ * }
- * At this point, the command for crs
is the query "SELECT
+ * At this point, the command for
. After the crs
is the query {@code "SELECT
* FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS WHERE CREDIT_LIMIT > 5000
- * AND REGION = "West"readData
method executes
+ * AND REGION = "West"}. After the readData
method executes
* this command with the following line of code, it will have the data from
* rs
with which to populate crs
.
- *
+ **{@code * ResultSet rs = pstmt.executeQuery(); - *+ * }
* The preceding code fragments give an idea of what goes on behind the
* scenes; they would not appear in an application, which would not invoke
@@ -484,13 +484,13 @@ import javax.sql.rowset.spi.*;
* the command. Simply by calling the execute
method,
* crs
populates itself with the requested data from the
* table CUSTOMERS
.
- *
+ ** *{@code * crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" + * "WHERE CREDIT_LIMIT > ? AND REGION = ?"); * crs.setInt(1, 5000); * crs.setString(2, "West"); * crs.execute(); - *+ * }
CachedRowSet
object stores data in memory,
diff --git a/jdk/src/share/classes/javax/sql/rowset/Predicate.java b/jdk/src/share/classes/javax/sql/rowset/Predicate.java
index a9672c98e10..eb747602eb0 100644
--- a/jdk/src/share/classes/javax/sql/rowset/Predicate.java
+++ b/jdk/src/share/classes/javax/sql/rowset/Predicate.java
@@ -53,8 +53,7 @@ import java.sql.*;
* and application motivated implementations of Predicate
to emerge.
* * A sample implementation would look something like this: - *
- *
+ * {@code
* public class Range implements Predicate {
*
* private Object lo[];
@@ -79,19 +78,19 @@ import java.sql.*;
* if ((rs.getObject(idx[i]) >= lo[i]) &&
* (rs.getObject(idx[i]) >= hi[i]) {
* bool1 = true; // within filter constraints
+ * } else {
+ * bool2 = true; // outside of filter constraints
+ * }
+ * }
+ *
+ * if (bool2) {
+ * return false;
* } else {
- * bool2 = true; // outside of filter constraints
+ * return true;
* }
* }
- *
- * if (bool2) {
- * return false;
- * } else {
- * return true;
- * }
* }
- *
- *
+ * }
*
* The example above implements a simple range predicate. Note, that
* implementations should but are not required to provider String
diff --git a/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java b/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
index e1b78a9202c..a5c998170c3 100644
--- a/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
+++ b/jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
@@ -159,7 +159,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* @param property true
if the given column is
* automatically incremented; false
* otherwise
- * @throws SQLException
if a database access error occurs or
+ * @throws SQLException if a database access error occurs or
* the given index is out of bounds
*/
public void setAutoIncrement(int columnIndex, boolean property) throws SQLException {
@@ -195,7 +195,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* value can be used in a WHERE
clause;
* false
otherwise
*
- * @throws SQLException
if a database access error occurs or
+ * @throws SQLException if a database access error occurs or
* the given column number is out of bounds
*/
public void setSearchable(int columnIndex, boolean property)
@@ -212,7 +212,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* must be between 1
and the number of columns,
* inclusive between 1
and the number of columns, inclusive
* @param property true if the value is a cash value; false otherwise.
- * @throws SQLException
if a database access error occurs
+ * @throws SQLException if a database access error occurs
* or the given column number is out of bounds
*/
public void setCurrency(int columnIndex, boolean property)
@@ -233,7 +233,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* columnNullable
, or
* columnNullableUnknown
*
- * @throws SQLException
if a database access error occurs,
+ * @throws SQLException if a database access error occurs,
* the given column number is out of bounds, or the value supplied
* for the property parameter is not one of the following
* constants:
diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java
index 10e6158e77b..e9b10bdcbfb 100644
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncFactory.java
@@ -627,8 +627,6 @@ public class SyncFactory {
* required
* @throws java.lang.SecurityException if a security manager exists and its
* {@code checkPermission} method denies calling {@code setLogger}
- * @throws java.util.logging.LoggingPermission if a security manager exists and its
- * {@code checkPermission} method denies calling {@code setLevel}
* @throws NullPointerException if the logger is null
* @see SecurityManager#checkPermission
* @see LoggingPermission
diff --git a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java
index 87b5393a725..c1180cf9251 100644
--- a/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java
+++ b/jdk/src/share/classes/javax/sql/rowset/spi/SyncResolver.java
@@ -193,7 +193,7 @@ import java.sql.SQLException;
* code fragment, the value in crs is the one set as the resolved value, which means
* that it will be used to overwrite the conflict value in the data source.
*
- *
+ ** @author Jonathan Bruce */ diff --git a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java index f0266fc7351..6e35b6156f0 100644 --- a/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java +++ b/jdk/src/share/classes/javax/swing/DefaultComboBoxModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,8 +55,7 @@ public class DefaultComboBoxModel{@code * try { * * crs.acceptChanges(con); @@ -202,8 +202,8 @@ import java.sql.SQLException; * * SyncResolver resolver = spe.getSyncResolver(); * - * Object crsValue; // value in the+ * }RowSet
object - * Object resolverValue: // value in theSyncResolver
object + * Object crsValue; // value in the RowSet object + * Object resolverValue: // value in the SyncResolver object * Object resolvedValue: // value to be persisted * * while(resolver.nextConflict()) { @@ -227,7 +227,7 @@ import java.sql.SQLException; * } * } * } - *
- * <element name="Manifest" type="ds:ManifestType"/>
- * <complexType name="ManifestType">
- * <sequence>
- * <element ref="ds:Reference" maxOccurs="unbounded"/>
- * </sequence>
- * <attribute name="Id" type="ID" use="optional"/>
- * </complexType>
- *
+ * {@code + ** * A+ * + * + * }+ * + *+ * + *
Manifest
instance may be created by invoking
* one of the {@link XMLSignatureFactory#newManifest newManifest}
diff --git a/jdk/src/share/classes/sun/awt/AWTAccessor.java b/jdk/src/share/classes/sun/awt/AWTAccessor.java
index 1907ac4c7c1..781750b0f1c 100644
--- a/jdk/src/share/classes/sun/awt/AWTAccessor.java
+++ b/jdk/src/share/classes/sun/awt/AWTAccessor.java
@@ -484,6 +484,11 @@ public final class AWTAccessor {
*/
void invokeAndWait(Object source, Runnable r)
throws InterruptedException, InvocationTargetException;
+
+ /**
+ * Sets the delegate for the EventQueue used by FX/AWT single threaded mode
+ */
+ public void setFwDispatcher(EventQueue eventQueue, FwDispatcher dispatcher);
}
/*
diff --git a/jdk/src/share/classes/sun/awt/FwDispatcher.java b/jdk/src/share/classes/sun/awt/FwDispatcher.java
new file mode 100644
index 00000000000..8ceb67e05b1
--- /dev/null
+++ b/jdk/src/share/classes/sun/awt/FwDispatcher.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.awt;
+
+import java.awt.*;
+
+/**
+ * An interface for the EventQueue delegate.
+ * This class is added to support JavaFX/AWT interop single threaded mode
+ * The delegate should be set in EventQueue by {@link EventQueue#setFwDispatcher(FwDispatcher)}
+ * If the delegate is not null, than it handles supported methods instead of the
+ * event queue. If it is null than the behaviour of an event queue does not change.
+ *
+ * @see EventQueue
+ *
+ * @author Petr Pchelko
+ *
+ * @since 1.8
+ */
+public interface FwDispatcher {
+ /**
+ * Delegates the {@link EventQueue#isDispatchThread()} method
+ */
+ boolean isDispatchThread();
+
+ /**
+ * Forwards a runnable to the delegate, which executes it on an appropriate thread.
+ * @param r - a runnable calling {@link EventQueue#dispatchEventImpl(java.awt.AWTEvent, Object)}
+ */
+ void scheduleDispatch(Runnable r);
+
+ /**
+ * Delegates the {@link java.awt.EventQueue#createSecondaryLoop()} method
+ */
+ SecondaryLoop createSecondaryLoop();
+}
diff --git a/jdk/src/share/classes/sun/java2d/loops/MaskFill.java b/jdk/src/share/classes/sun/java2d/loops/MaskFill.java
index 47c41ee1cd3..601a3fc7eb8 100644
--- a/jdk/src/share/classes/sun/java2d/loops/MaskFill.java
+++ b/jdk/src/share/classes/sun/java2d/loops/MaskFill.java
@@ -36,6 +36,7 @@ import sun.awt.image.BufImgSurfaceData;
import sun.java2d.loops.GraphicsPrimitive;
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
+import sun.java2d.pipe.Region;
/**
* MaskFill
@@ -194,10 +195,13 @@ public class MaskFill extends GraphicsPrimitive
// REMIND: This is not pretty. It would be nicer if we
// passed a "FillData" object to the Pixel loops, instead
// of a SunGraphics2D parameter...
+ Region clip = sg2d.clipRegion;
+ sg2d.clipRegion = null;
int pixel = sg2d.pixel;
sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
sg2d.pixel = pixel;
+ sg2d.clipRegion = clip;
maskop.MaskBlit(tmpData, sData, comp, null,
0, 0, x, y, w, h,
diff --git a/jdk/src/share/classes/sun/misc/Hashing.java b/jdk/src/share/classes/sun/misc/Hashing.java
deleted file mode 100644
index 39ed201da3e..00000000000
--- a/jdk/src/share/classes/sun/misc/Hashing.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package sun.misc;
-
-import java.util.concurrent.ThreadLocalRandom;
-
-/**
- * Hashing utilities.
- *
- * Little endian implementations of Murmur3 hashing.
- */
-public class Hashing {
-
- /**
- * Static utility methods only.
- */
- private Hashing() {
- throw new Error("No instances");
- }
-
- public static int murmur3_32(byte[] data) {
- return murmur3_32(0, data, 0, data.length);
- }
-
- public static int murmur3_32(int seed, byte[] data) {
- return murmur3_32(seed, data, 0, data.length);
- }
-
- @SuppressWarnings("fallthrough")
- public static int murmur3_32(int seed, byte[] data, int offset, int len) {
- int h1 = seed;
- int count = len;
-
- // body
- while (count >= 4) {
- int k1 = (data[offset] & 0x0FF)
- | (data[offset + 1] & 0x0FF) << 8
- | (data[offset + 2] & 0x0FF) << 16
- | data[offset + 3] << 24;
-
- count -= 4;
- offset += 4;
-
- k1 *= 0xcc9e2d51;
- k1 = Integer.rotateLeft(k1, 15);
- k1 *= 0x1b873593;
-
- h1 ^= k1;
- h1 = Integer.rotateLeft(h1, 13);
- h1 = h1 * 5 + 0xe6546b64;
- }
-
- // tail
-
- if (count > 0) {
- int k1 = 0;
-
- switch (count) {
- case 3:
- k1 ^= (data[offset + 2] & 0xff) << 16;
- // fall through
- case 2:
- k1 ^= (data[offset + 1] & 0xff) << 8;
- // fall through
- case 1:
- k1 ^= (data[offset] & 0xff);
- // fall through
- default:
- k1 *= 0xcc9e2d51;
- k1 = Integer.rotateLeft(k1, 15);
- k1 *= 0x1b873593;
- h1 ^= k1;
- }
- }
-
- // finalization
-
- h1 ^= len;
-
- // finalization mix force all bits of a hash block to avalanche
- h1 ^= h1 >>> 16;
- h1 *= 0x85ebca6b;
- h1 ^= h1 >>> 13;
- h1 *= 0xc2b2ae35;
- h1 ^= h1 >>> 16;
-
- return h1;
- }
-
- public static int murmur3_32(char[] data) {
- return murmur3_32(0, data, 0, data.length);
- }
-
- public static int murmur3_32(int seed, char[] data) {
- return murmur3_32(seed, data, 0, data.length);
- }
-
- public static int murmur3_32(int seed, char[] data, int offset, int len) {
- int h1 = seed;
-
- int off = offset;
- int count = len;
-
- // body
- while (count >= 2) {
- int k1 = (data[off++] & 0xFFFF) | (data[off++] << 16);
-
- count -= 2;
-
- k1 *= 0xcc9e2d51;
- k1 = Integer.rotateLeft(k1, 15);
- k1 *= 0x1b873593;
-
- h1 ^= k1;
- h1 = Integer.rotateLeft(h1, 13);
- h1 = h1 * 5 + 0xe6546b64;
- }
-
- // tail
-
- if (count > 0) {
- int k1 = data[off];
-
- k1 *= 0xcc9e2d51;
- k1 = Integer.rotateLeft(k1, 15);
- k1 *= 0x1b873593;
- h1 ^= k1;
- }
-
- // finalization
-
- h1 ^= len * (Character.SIZE / Byte.SIZE);
-
- // finalization mix force all bits of a hash block to avalanche
- h1 ^= h1 >>> 16;
- h1 *= 0x85ebca6b;
- h1 ^= h1 >>> 13;
- h1 *= 0xc2b2ae35;
- h1 ^= h1 >>> 16;
-
- return h1;
- }
-
- public static int murmur3_32(int[] data) {
- return murmur3_32(0, data, 0, data.length);
- }
-
- public static int murmur3_32(int seed, int[] data) {
- return murmur3_32(seed, data, 0, data.length);
- }
-
- public static int murmur3_32(int seed, int[] data, int offset, int len) {
- int h1 = seed;
-
- int off = offset;
- int end = offset + len;
-
- // body
- while (off < end) {
- int k1 = data[off++];
-
- k1 *= 0xcc9e2d51;
- k1 = Integer.rotateLeft(k1, 15);
- k1 *= 0x1b873593;
-
- h1 ^= k1;
- h1 = Integer.rotateLeft(h1, 13);
- h1 = h1 * 5 + 0xe6546b64;
- }
-
- // tail (always empty, as body is always 32-bit chunks)
-
- // finalization
-
- h1 ^= len * (Integer.SIZE / Byte.SIZE);
-
- // finalization mix force all bits of a hash block to avalanche
- h1 ^= h1 >>> 16;
- h1 *= 0x85ebca6b;
- h1 ^= h1 >>> 13;
- h1 *= 0xc2b2ae35;
- h1 ^= h1 >>> 16;
-
- return h1;
- }
-
- /**
- * Return a non-zero 32-bit pseudo random value. The {@code instance} object
- * may be used as part of the value.
- *
- * @param instance an object to use if desired in choosing value.
- * @return a non-zero 32-bit pseudo random value.
- */
- public static int randomHashSeed(Object instance) {
- int seed;
- if (sun.misc.VM.isBooted()) {
- seed = ThreadLocalRandom.current().nextInt();
- } else {
- // lower quality "random" seed value--still better than zero and not
- // not practically reversible.
- int hashing_seed[] = {
- System.identityHashCode(Hashing.class),
- System.identityHashCode(instance),
- System.identityHashCode(Thread.currentThread()),
- (int) Thread.currentThread().getId(),
- (int) (System.currentTimeMillis() >>> 2), // resolution is poor
- (int) (System.nanoTime() >>> 5), // resolution is poor
- (int) (Runtime.getRuntime().freeMemory() >>> 4) // alloc min
- };
-
- seed = murmur3_32(hashing_seed);
- }
-
- // force to non-zero.
- return (0 != seed) ? seed : 1;
- }
-}
diff --git a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
index 96f5d8d3ae7..fc23ac683be 100644
--- a/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
+++ b/jdk/src/share/classes/sun/net/www/http/ChunkedOutputStream.java
@@ -125,7 +125,7 @@ public class ChunkedOutputStream extends PrintStream {
completeHeader = getHeader(preferredChunkDataSize);
/* start with an initial buffer */
- buf = new byte[preferredChunkDataSize + 32];
+ buf = new byte[preferredChunkGrossSize];
reset();
}
diff --git a/jdk/src/share/classes/sun/security/krb5/Config.java b/jdk/src/share/classes/sun/security/krb5/Config.java
index 1b63cd60295..5771886023c 100644
--- a/jdk/src/share/classes/sun/security/krb5/Config.java
+++ b/jdk/src/share/classes/sun/security/krb5/Config.java
@@ -761,22 +761,23 @@ public class Config {
}
/**
- * Returns the default encryption types.
- *
+ * Returns all etypes specified in krb5.conf for the given configName,
+ * or all the builtin defaults. This result is always non-empty.
+ * If no etypes are found, an exception is thrown.
*/
- public int[] defaultEtype(String enctypes) {
+ public int[] defaultEtype(String configName) throws KrbException {
String default_enctypes;
- default_enctypes = get("libdefaults", enctypes);
- String delim = " ";
- StringTokenizer st;
+ default_enctypes = get("libdefaults", configName);
int[] etype;
if (default_enctypes == null) {
if (DEBUG) {
System.out.println("Using builtin default etypes for " +
- enctypes);
+ configName);
}
etype = EType.getBuiltInDefaults();
} else {
+ String delim = " ";
+ StringTokenizer st;
for (int j = 0; j < default_enctypes.length(); j++) {
if (default_enctypes.substring(j, j + 1).equals(",")) {
// only two delimiters are allowed to use
@@ -791,17 +792,13 @@ public class Config {
int type;
for (int i = 0; i < len; i++) {
type = Config.getType(st.nextToken());
- if ((type != -1) &&
- (EType.isSupported(type))) {
+ if (type != -1 && EType.isSupported(type)) {
ls.add(type);
}
}
if (ls.isEmpty()) {
- if (DEBUG) {
- System.out.println(
- "no supported default etypes for " + enctypes);
- }
- return null;
+ throw new KrbException("no supported default etypes for "
+ + configName);
} else {
etype = new int[ls.size()];
for (int i = 0; i < etype.length; i++) {
@@ -811,7 +808,7 @@ public class Config {
}
if (DEBUG) {
- System.out.print("default etypes for " + enctypes + ":");
+ System.out.print("default etypes for " + configName + ":");
for (int i = 0; i < etype.length; i++) {
System.out.print(" " + etype[i]);
}
diff --git a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java
index ba27220f66f..155ccf67138 100644
--- a/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java
+++ b/jdk/src/share/classes/sun/security/krb5/EncryptionKey.java
@@ -97,36 +97,6 @@ public class EncryptionKey
return new EncryptionKey(keyValue, keyType, kvno);
}
- /**
- * Obtains the latest version of the secret key of
- * the principal from a keytab.
- *
- * @param princ the principal whose secret key is desired
- * @param keytab the path to the keytab file. A value of null
- * will be accepted to indicate that the default path should be
- * searched.
- * @returns the secret key or null if none was found.
- */
- /*
- // Replaced by acquireSecretKeys
- public static EncryptionKey acquireSecretKey(PrincipalName princ,
- String keytab)
- throws KrbException, IOException {
-
- if (princ == null) {
- throw new IllegalArgumentException(
- "Cannot have null pricipal name to look in keytab.");
- }
-
- KeyTab ktab = KeyTab.getInstance(keytab);
-
- if (ktab == null)
- return null;
-
- return ktab.readServiceKey(princ);
- }
- */
-
/**
* Obtains all versions of the secret key of the principal from a
* keytab.
@@ -208,9 +178,6 @@ public class EncryptionKey
String salt) throws KrbException {
int[] etypes = EType.getDefaults("default_tkt_enctypes");
- if (etypes == null) {
- etypes = EType.getBuiltInDefaults();
- }
EncryptionKey[] encKeys = new EncryptionKey[etypes.length];
for (int i = 0; i < etypes.length; i++) {
diff --git a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
index 2bc01f693f5..7ea5d85bf36 100644
--- a/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
+++ b/jdk/src/share/classes/sun/security/krb5/KrbApReq.java
@@ -490,10 +490,6 @@ public class KrbApReq {
// Check that key is one of the permitted types
private static void checkPermittedEType(int target) throws KrbException {
int[] etypes = EType.getDefaults("permitted_enctypes");
- if (etypes == null) {
- throw new KrbException(
- "No supported encryption types listed in permitted_enctypes");
- }
if (!EType.isSupported(target, etypes)) {
throw new KrbException(EType.toString(target) +
" encryption type not in permitted_enctypes list");
diff --git a/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java b/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java
index 32263b53770..fa599e47892 100644
--- a/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java
+++ b/jdk/src/share/classes/sun/security/krb5/KrbTgsReq.java
@@ -291,8 +291,7 @@ public class KrbTgsReq {
Ticket[] additionalTickets,
EncryptionKey subKey,
PAData extraPA)
- throws Asn1Exception, IOException, KdcErrException, KrbApErrException,
- UnknownHostException, KrbCryptoException {
+ throws IOException, KrbException, UnknownHostException {
KerberosTime req_till = null;
if (till == null) {
req_till = new KerberosTime(0);
@@ -314,10 +313,6 @@ public class KrbTgsReq {
int[] req_eTypes = null;
if (eTypes == null) {
req_eTypes = EType.getDefaults("default_tgs_enctypes");
- if (req_eTypes == null) {
- throw new KrbCryptoException(
- "No supported encryption types listed in default_tgs_enctypes");
- }
} else {
req_eTypes = eTypes;
}
diff --git a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java
index 91d0c2faada..534bc8fcfbc 100644
--- a/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java
+++ b/jdk/src/share/classes/sun/security/krb5/internal/crypto/EType.java
@@ -230,11 +230,14 @@ public abstract class EType {
/**
* Retrieves the default etypes from the configuration file, or
* if that's not available, return the built-in list of default etypes.
+ * This result is always non-empty. If no etypes are found,
+ * an exception is thrown.
*/
- // used in KrbAsReq, KeyTab
- public static int[] getDefaults(String configName) {
+ public static int[] getDefaults(String configName)
+ throws KrbException {
+ Config config = null;
try {
- return Config.getInstance().defaultEtype(configName);
+ config = Config.getInstance();
} catch (KrbException exc) {
if (DEBUG) {
System.out.println("Exception while getting " +
@@ -243,6 +246,7 @@ public abstract class EType {
}
return getBuiltInDefaults();
}
+ return config.defaultEtype(configName);
}
/**
@@ -254,12 +258,8 @@ public abstract class EType {
* we have keys.
*/
public static int[] getDefaults(String configName, EncryptionKey[] keys)
- throws KrbException {
+ throws KrbException {
int[] answer = getDefaults(configName);
- if (answer == null) {
- throw new KrbException("No supported encryption types listed in "
- + configName);
- }
List@@ -63,9 +64,9 @@ First, policytool will be invoked.
/* AUTOMATICALLY GENERATED ON Tue Jul 19 16:27:30 CST 2005*/ /* DO NOT EDIT */ diff --git a/jdk/test/sun/security/tools/policytool/ChangeUI.sh b/jdk/test/sun/security/tools/policytool/ChangeUI.sh index 95e25af1227..1b6a7984087 100644 --- a/jdk/test/sun/security/tools/policytool/ChangeUI.sh +++ b/jdk/test/sun/security/tools/policytool/ChangeUI.sh @@ -22,7 +22,7 @@ # # @test -# @bug 6296772 6293981 6290216 +# @bug 6296772 6293981 6290216 8015276 # @summary FilePermission and DelegationPermission, and cancel button # # @run applet/manual=done ChangeUI.html @@ -51,6 +51,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/OpenPolicy.sh b/jdk/test/sun/security/tools/policytool/OpenPolicy.sh index 5aca3324661..325b817c3d2 100644 --- a/jdk/test/sun/security/tools/policytool/OpenPolicy.sh +++ b/jdk/test/sun/security/tools/policytool/OpenPolicy.sh @@ -51,6 +51,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/SaveAs.sh b/jdk/test/sun/security/tools/policytool/SaveAs.sh index 661ebd99a3e..af18ad96c21 100644 --- a/jdk/test/sun/security/tools/policytool/SaveAs.sh +++ b/jdk/test/sun/security/tools/policytool/SaveAs.sh @@ -52,6 +52,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/UpdatePermissions.html b/jdk/test/sun/security/tools/policytool/UpdatePermissions.html index 2a59b5908ae..31e6fcf7fc3 100644 --- a/jdk/test/sun/security/tools/policytool/UpdatePermissions.html +++ b/jdk/test/sun/security/tools/policytool/UpdatePermissions.html @@ -10,8 +10,8 @@ reading these instructions.
First, policytool will be invoked.
Then, follow these steps:
-0) If testing on Windows, create a temporary directory. -(Example: C:\foo\tmp)
+0) Find (or create) a temporary directory that you have write access to. +(Example: 'C:\foo\tmp' on Windows or '/tmp' on other systems)
1) Click on the "Add Policy Entry" button in the main policytool window.
@@ -32,13 +32,10 @@ select "Save As".
8) In the SaveAs window, enter "/tmp/ptool.test" as the file name and click "OK".
-If testing on Windows, use the temporary directory created in Step 0. -(Example: Save as "C:\foo\tmp\ptool.test")
- -9) cat /tmp/ptool.test
-If testing on Windows, check the contents of the file created in the previous -step.
+(Or use the temporary directory mentioned in Step 0 if it's not '/tmp'. +For example, "C:\foo\tmp\ptool.test" on Windows)
+9) Check the content of the file created in the previous step
10) check to make sure that the new entry is in the policy file.
@@ -53,8 +50,8 @@ step.
In the confirmation dialog pop-up, click "OK".
-Exit policytool. If testing on Windows, delete the temporary directory and its -contents created during this test.
+Exit policytool. Delete the files created during this test. If the +temporary directory is also newly created, empty and delete it.
Press "Pass" if ... press "Fail" otherwise.
diff --git a/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh b/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh index eada9d734cd..05978a38b57 100644 --- a/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh +++ b/jdk/test/sun/security/tools/policytool/UpdatePermissions.sh @@ -23,6 +23,7 @@ # @test # @bug 4218206 +# @bug 8015276 # @summary missing or invalid permission target names in policy tool # # @run applet/manual=done UpdatePermissions.html @@ -51,6 +52,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/UsePolicy.sh b/jdk/test/sun/security/tools/policytool/UsePolicy.sh index 3422f2cfc15..c8412389a3b 100644 --- a/jdk/test/sun/security/tools/policytool/UsePolicy.sh +++ b/jdk/test/sun/security/tools/policytool/UsePolicy.sh @@ -51,6 +51,11 @@ case "$OS" in PS=":" FS="/" ;; + CYGWIN* ) + NULL=/dev/null + PS=";" + FS="/" + ;; Windows* ) NULL=NUL PS=";" diff --git a/jdk/test/sun/security/tools/policytool/i18n.html b/jdk/test/sun/security/tools/policytool/i18n.html index 6c70d24398c..b358c50d2d9 100644 --- a/jdk/test/sun/security/tools/policytool/i18n.html +++ b/jdk/test/sun/security/tools/policytool/i18n.html @@ -15,10 +15,15 @@ If at any time an exception is thrown, or if any message is incomprehensible, then the test failed. Otherwise, the test passed.+Preparation: Find (or create) a temporary directory that you have write +access to (Example: 'C:\tmp' on Windows or '/tmp' on other systems) and copy +the files "ks", "good", "bad" from the scratch sub-directory of this test's +working directory (the -w argument of jtreg) into the temporary directory. +If 'policy1' or 'policy2' already exists in this directory, remove it. +
Press "Pass" if ... press "Fail" otherwise.
-
-
- If testing on Windows, create a temporary directory. (Example: C:\foo\tmp) +
+
- Pull down the 'File' and 'KeyStore' menus and check values
- Pull down 'File' menu and select 'View Warning Log'. Confirm FileNotFound.
- Pull down 'File' menu and select 'New'. @@ -46,65 +51,65 @@ Press "Pass" if ... press "Fail" otherwise.
- Select "play" from Target menu.
- Click OK, confirm changed permission.
- Type "hello" for 'CodeBase', click on 'Done', and check error message +
- Clean up the 'CodeBase' textbox
- Type "hello" for 'SignedBy', click on 'Done', and check warning message -
- Click, on 'Edit Policy Entry' and 'Remove Policy Entry' +
- Click on 'Edit Policy Entry' and 'Remove Policy Entry' and check error messages -
- Select policy entry, click on 'Edit Policy Entry', and check pop-up window +
- Select policy entry, click on 'Edit Policy Entry', check pop-up window and close it
- Select policy entry, click on 'Remove Policy Entry', and check pop-up window
- Do not remove the entry, click 'Cancel'.
- Pull down 'File' menu and select 'Exit'. Confirm Save option. Click 'Cancel'. -
- Select 'File' menu value 'Save' and enter "/tmp/policy1" as the filename.
- If testing on Windows, use the temporary directory created in Step 0. - (Example: Save as "C:\foo\tmp\policy1")
- Check status message. +- Select 'File' menu value 'Save' and save into file "policy1" in the + temporary directory. Check status message.
- Select 'File' menu value 'New'
- Click 'Add Policy Entry', type in "hello" for 'SignedBy' field, click 'Done'. Confirm warning.
- Select 'File' menu value 'Open' and confirm save option - (do not save changes) -
- Type "/tmp/policy1" (if Windows, "C:\foo\tmp\policy1") for the filename - and confirm warning message
+ (Click 'Cancel', do not save changes)- Pull down 'File' menu, select 'View Warning Log' and confirm KeyStore alias warning
- Pull down 'KeyStore' menu and select 'Edit' -
- Enter 'foo' as KeyStore URL and check error -
- Using keytool create JKS keystore -
- Enter KeyStore URL but leave other fields empty. Should succeed. +
- Enter 'foo' as KeyStore URL, click 'OK', and check error +
- Enter KeyStore URL "file:/tmp/ks" (Or use the temporary directory mentioned + in the preparation if it's not '/tmp'. For example, "file:/C:/tmp/ks" on Windows) + but leave other fields empty. Click 'OK'. Should succeed.
- Pull down 'KeyStore' menu and select 'Edit' -
- Confirm URL and Type values. -
- Enter 'foo' as the provider and check error message. -
- Enter 'SUN' as the provider. Should succeed. +
- Confirm URL and Type values. The Type should be "jks" +
- Enter 'foo' as the provider, click 'OK' and check error message. +
- Enter 'SUN' as the provider, click 'OK'. Should succeed.
- Pull down 'KeyStore' menu and select 'Edit'
- Confirm URL, Type, and Provider values. -
- Enter 'foo' as the password URL and check error message. -
- Enter URL with bad password and check error message. -
- Enter URL with good password. Should succeed. +
- Enter 'foo' as the password URL, click 'OK' and check error message. +
- Enter URL "file:/tmp/bad" (Or use the temporary directory mentioned in + the preparation if it's not '/tmp'. For example, "file:/C:/tmp/bad" on Windows), + click 'OK' and check error message. +
- Enter URL "file:/tmp/good" (Or use the temporary directory mentioned in + the preparation if it's not '/tmp'. For example, "file:/C:/tmp/good" on Windows) + and click 'OK'. Should succeed.
- Pull down 'KeyStore' menu and select 'Edit'
- Confirm URL, Type, Provider, and Password URL values.
- Click OK -
- Pull down 'File' menu and select 'Save As'. Enter "/tmp/policy2" - (if Windows, "C:\foo\tmp\policy2"). - Confirm status message.
+- Pull down 'File' menu and select 'Save As' and save into file "policy2" + in the temporary directory. Confirm status message.
- Pull down 'File' menu and select 'New'. -
- Pull down 'File' menu and select 'Open'. Enter "/tmp/policy2" - (if Windows, "C:\foo\tmp\policy2"). - Confirm warning message.
+- Pull down 'File' menu and select 'Open' and open "policy2" in the + temporary directory.
- Click on 'Add Policy Entry', enter Codebase 'http://foo', SignedBy 'bar'. Click on 'Done' and confirm alias warning.
- Double-Click on just created policy entry, confirm edit window appears. -
- Change SignedBy to an alias in previously created keystore. +
- Change SignedBy to an 'hello'.
- Click on Done and confirm it worked with no warning.
- Double-Click on "SignedBy hello" policy entry and confirm edit window appears.
- Click on Edit/Remove Principal, confirm errors.
- Click on 'Add Principal' and check new window.
- Click on 'OK' and confirm error message (no principal name) -
- Enter valid KeyStore alias as principal name, click OK and +
- Enter 'hello' as principal name, click OK and confirm status message.
- Confirm new principal in Principals list. -
- Click on 'Done' (creating policy entry), confirm alias warning. +
- Click on 'Done' (creating policy entry).
- View warning log and confirm X500Principal/KeyStore alias message.
- Confirm principal added to policy entry in main window listing.
- Double click on that entry. @@ -116,14 +121,14 @@ Press "Pass" if ... press "Fail" otherwise. Confirm name cleared. Type 'foo' as name. Click OK. Confirm error. type 'cn=foo' as name. Click OK. should succeed.
- Confirm changed principal in list. -
- Click on 'Add Permission', and add any FilePermission. -
- Click on 'Done' in Policy Entry window. Confirm alias warning. +
- Click on 'Add Permission', and add a FilePermission, choose a target and + an action. Click OK. +
- Click on 'Done' in Policy Entry window.
- Confirm entries in main window listing.
- Select 'File' menu value 'Exit'
- Save Changes, confirm status message. -
- If testing on Windows, delete the temporary directory and its contents - created during this test. -
- Delete all files created during this test. If the temporary directory + is also newly created, empty and delete it.