Merge
This commit is contained in:
commit
adb5f5e10f
1
.hgtags
1
.hgtags
@ -306,3 +306,4 @@ da950f343762a856d69751570a4c07cfa68a415b jdk9-b59
|
|||||||
ac3f5a39d4ff14d70c365e12cf5ec8f2abd52a04 jdk9-b61
|
ac3f5a39d4ff14d70c365e12cf5ec8f2abd52a04 jdk9-b61
|
||||||
e7dbbef69d12b6a74dfad331b7188e7f893e8d29 jdk9-b62
|
e7dbbef69d12b6a74dfad331b7188e7f893e8d29 jdk9-b62
|
||||||
989253a902c34dcb7564695161c9200a5fbb7412 jdk9-b63
|
989253a902c34dcb7564695161c9200a5fbb7412 jdk9-b63
|
||||||
|
8ffdeabc7c2b9a8280bf46cae026ac46b4d31c26 jdk9-b64
|
||||||
|
@ -306,3 +306,4 @@ f25ee9f62427a9ba27418e5531a89754791a305b jdk9-b57
|
|||||||
ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
|
ea38728b4f4bdd8fd0d7a89b18069f521cf05013 jdk9-b61
|
||||||
105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62
|
105d045a69174d870b69bfe471b3f2d05a9f8ecc jdk9-b62
|
||||||
0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63
|
0b32ed628fa60e4ab99fb0b5866d648e16231f17 jdk9-b63
|
||||||
|
82cf9aab9a83e41c8194ba01af9666afdb856cbe jdk9-b64
|
||||||
|
@ -705,9 +705,9 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
|||||||
# is performed.
|
# is performed.
|
||||||
filtered_files=`$ECHO "$files_present" \
|
filtered_files=`$ECHO "$files_present" \
|
||||||
| $SED -e 's/config.log//g' \
|
| $SED -e 's/config.log//g' \
|
||||||
-e 's/confdefs.h//g' \
|
-e 's/configure.log//g' \
|
||||||
-e 's/fixpath.exe//g' \
|
-e 's/confdefs.h//g' \
|
||||||
-e 's/ //g' \
|
-e 's/ //g' \
|
||||||
| $TR -d '\n'`
|
| $TR -d '\n'`
|
||||||
if test "x$filtered_files" != x; then
|
if test "x$filtered_files" != x; then
|
||||||
AC_MSG_NOTICE([Current directory is $CURDIR.])
|
AC_MSG_NOTICE([Current directory is $CURDIR.])
|
||||||
@ -1054,3 +1054,29 @@ AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
|
|||||||
|
|
||||||
AC_SUBST(BASH_ARGS)
|
AC_SUBST(BASH_ARGS)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Code to run after AC_OUTPUT
|
||||||
|
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
|
||||||
|
[
|
||||||
|
# Try to move config.log (generated by autoconf) to the configure-support directory.
|
||||||
|
if test -e ./config.log; then
|
||||||
|
$MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Rotate our log file (configure.log)
|
||||||
|
if test -e "$OUTPUT_ROOT/configure.log.old"; then
|
||||||
|
$RM -f "$OUTPUT_ROOT/configure.log.old"
|
||||||
|
fi
|
||||||
|
if test -e "$OUTPUT_ROOT/configure.log"; then
|
||||||
|
$MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Move configure.log from current directory to the build output root
|
||||||
|
if test -e ./configure.log; then
|
||||||
|
echo found it
|
||||||
|
$MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make the compare script executable
|
||||||
|
$CHMOD +x $OUTPUT_ROOT/compare.sh
|
||||||
|
])
|
||||||
|
11
common/autoconf/configure
vendored
11
common/autoconf/configure
vendored
@ -255,13 +255,10 @@ if test "x$conf_debug_configure" != x; then
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "x$conf_debug_configure" = xtrue; then
|
# Now transfer control to the script generated by autoconf. This is where the
|
||||||
# Turn on logging, but don't turn on twice when called recursive
|
# main work is done.
|
||||||
conf_debug_logfile=./debug-configure.log
|
conf_logfile=./configure.log
|
||||||
(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile
|
(exec 3>&1 ; (. $conf_script_to_run "${conf_processed_arguments[@]}" 2>&1 1>&3 ) | tee -a $conf_logfile 1>&2 ; exec 3>&-) | tee -a $conf_logfile
|
||||||
else
|
|
||||||
( . $conf_script_to_run "${conf_processed_arguments[@]}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
conf_result_code=$?
|
conf_result_code=$?
|
||||||
###
|
###
|
||||||
|
@ -265,15 +265,10 @@ CONFIG_STATUS="$CONFIGURESUPPORT_OUTPUTDIR/config.status"
|
|||||||
|
|
||||||
# Create the actual output files. Now the main work of configure is done.
|
# Create the actual output files. Now the main work of configure is done.
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
# After AC_OUTPUT, we need to do final work
|
||||||
CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
|
CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
|
||||||
|
BASIC_POST_CONFIG_OUTPUT
|
||||||
# Try to move the config.log file to the output directory.
|
|
||||||
if test -e ./config.log; then
|
|
||||||
$MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make the compare script executable
|
|
||||||
$CHMOD +x $OUTPUT_ROOT/compare.sh
|
|
||||||
|
|
||||||
# Finally output some useful information to the user
|
# Finally output some useful information to the user
|
||||||
HELP_PRINT_SUMMARY_AND_WARNINGS
|
HELP_PRINT_SUMMARY_AND_WARNINGS
|
||||||
|
@ -231,7 +231,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
|||||||
|
|
||||||
AC_SUBST(C_FLAG_REORDER)
|
AC_SUBST(C_FLAG_REORDER)
|
||||||
AC_SUBST(CXX_FLAG_REORDER)
|
AC_SUBST(CXX_FLAG_REORDER)
|
||||||
AC_SUBST(SHARED_LIBRARY_FLAGS)
|
|
||||||
AC_SUBST(SET_EXECUTABLE_ORIGIN)
|
AC_SUBST(SET_EXECUTABLE_ORIGIN)
|
||||||
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
||||||
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
||||||
@ -524,6 +523,10 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
|||||||
# CXXFLAGS_JDK - C++ Compiler flags
|
# CXXFLAGS_JDK - C++ Compiler flags
|
||||||
# COMMON_CCXXFLAGS_JDK - common to C and C++
|
# COMMON_CCXXFLAGS_JDK - common to C and C++
|
||||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||||
|
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||||
|
# Force compatibility with i586 on 32 bit intel platforms.
|
||||||
|
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
|
||||||
|
fi
|
||||||
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
|
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
|
||||||
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||||
case $OPENJDK_TARGET_CPU_ARCH in
|
case $OPENJDK_TARGET_CPU_ARCH in
|
||||||
@ -900,6 +903,24 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
|
|||||||
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
|
[COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
|
||||||
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
|
AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
|
||||||
|
[do not consider native warnings to be an error @<:@enabled@:>@])])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if native warnings are errors])
|
||||||
|
if test "x$enable_warnings_as_errors" = "xyes"; then
|
||||||
|
AC_MSG_RESULT([yes (explicitely set)])
|
||||||
|
WARNINGS_AS_ERRORS=true
|
||||||
|
elif test "x$enable_warnings_as_errors" = "xno"; then
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
WARNINGS_AS_ERRORS=false
|
||||||
|
elif test "x$enable_warnings_as_errors" = "x"; then
|
||||||
|
AC_MSG_RESULT([yes (default)])
|
||||||
|
WARNINGS_AS_ERRORS=true
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
|
||||||
|
fi
|
||||||
|
AC_SUBST(WARNINGS_AS_ERRORS)
|
||||||
|
|
||||||
case "${TOOLCHAIN_TYPE}" in
|
case "${TOOLCHAIN_TYPE}" in
|
||||||
microsoft)
|
microsoft)
|
||||||
DISABLE_WARNING_PREFIX="-wd"
|
DISABLE_WARNING_PREFIX="-wd"
|
||||||
|
@ -684,6 +684,7 @@ ZIP_DEBUGINFO_FILES
|
|||||||
ENABLE_DEBUG_SYMBOLS
|
ENABLE_DEBUG_SYMBOLS
|
||||||
CFLAGS_WARNINGS_ARE_ERRORS
|
CFLAGS_WARNINGS_ARE_ERRORS
|
||||||
DISABLE_WARNING_PREFIX
|
DISABLE_WARNING_PREFIX
|
||||||
|
WARNINGS_AS_ERRORS
|
||||||
COMPILER_SUPPORTS_TARGET_BITS_FLAG
|
COMPILER_SUPPORTS_TARGET_BITS_FLAG
|
||||||
ZERO_ARCHFLAG
|
ZERO_ARCHFLAG
|
||||||
LDFLAGS_TESTEXE_SUFFIX
|
LDFLAGS_TESTEXE_SUFFIX
|
||||||
@ -727,7 +728,6 @@ SET_SHARED_LIBRARY_MAPFILE
|
|||||||
SET_SHARED_LIBRARY_NAME
|
SET_SHARED_LIBRARY_NAME
|
||||||
SET_SHARED_LIBRARY_ORIGIN
|
SET_SHARED_LIBRARY_ORIGIN
|
||||||
SET_EXECUTABLE_ORIGIN
|
SET_EXECUTABLE_ORIGIN
|
||||||
SHARED_LIBRARY_FLAGS
|
|
||||||
CXX_FLAG_REORDER
|
CXX_FLAG_REORDER
|
||||||
C_FLAG_REORDER
|
C_FLAG_REORDER
|
||||||
SYSROOT_LDFLAGS
|
SYSROOT_LDFLAGS
|
||||||
@ -1086,6 +1086,7 @@ with_jtreg
|
|||||||
with_extra_cflags
|
with_extra_cflags
|
||||||
with_extra_cxxflags
|
with_extra_cxxflags
|
||||||
with_extra_ldflags
|
with_extra_ldflags
|
||||||
|
enable_warnings_as_errors
|
||||||
enable_debug_symbols
|
enable_debug_symbols
|
||||||
enable_zip_debug_info
|
enable_zip_debug_info
|
||||||
enable_native_coverage
|
enable_native_coverage
|
||||||
@ -1852,6 +1853,9 @@ Optional Features:
|
|||||||
--enable-rmiconnector-iiop
|
--enable-rmiconnector-iiop
|
||||||
enable the JMX RMIConnector iiop transport
|
enable the JMX RMIConnector iiop transport
|
||||||
[disabled]
|
[disabled]
|
||||||
|
--disable-warnings-as-errors
|
||||||
|
do not consider native warnings to be an error
|
||||||
|
[enabled]
|
||||||
--disable-debug-symbols disable generation of debug symbols [enabled]
|
--disable-debug-symbols disable generation of debug symbols [enabled]
|
||||||
--disable-zip-debug-info
|
--disable-zip-debug-info
|
||||||
disable zipping of debug-info files [enabled]
|
disable zipping of debug-info files [enabled]
|
||||||
@ -3496,6 +3500,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
|
|||||||
# Check for support for specific options in bash
|
# Check for support for specific options in bash
|
||||||
|
|
||||||
|
|
||||||
|
# Code to run after AC_OUTPUT
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
@ -4359,7 +4366,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
|||||||
#CUSTOM_AUTOCONF_INCLUDE
|
#CUSTOM_AUTOCONF_INCLUDE
|
||||||
|
|
||||||
# Do not change or remove the following line, it is needed for consistency checks:
|
# Do not change or remove the following line, it is needed for consistency checks:
|
||||||
DATE_WHEN_GENERATED=1430918902
|
DATE_WHEN_GENERATED=1431429776
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -15335,9 +15342,9 @@ $as_echo "in current directory" >&6; }
|
|||||||
# is performed.
|
# is performed.
|
||||||
filtered_files=`$ECHO "$files_present" \
|
filtered_files=`$ECHO "$files_present" \
|
||||||
| $SED -e 's/config.log//g' \
|
| $SED -e 's/config.log//g' \
|
||||||
-e 's/confdefs.h//g' \
|
-e 's/configure.log//g' \
|
||||||
-e 's/fixpath.exe//g' \
|
-e 's/confdefs.h//g' \
|
||||||
-e 's/ //g' \
|
-e 's/ //g' \
|
||||||
| $TR -d '\n'`
|
| $TR -d '\n'`
|
||||||
if test "x$filtered_files" != x; then
|
if test "x$filtered_files" != x; then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5
|
||||||
@ -41761,7 +41768,6 @@ $as_echo "$ac_cv_c_bigendian" >&6; }
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||||
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
|
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
|
||||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
|
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
|
||||||
@ -42029,6 +42035,10 @@ fi
|
|||||||
# CXXFLAGS_JDK - C++ Compiler flags
|
# CXXFLAGS_JDK - C++ Compiler flags
|
||||||
# COMMON_CCXXFLAGS_JDK - common to C and C++
|
# COMMON_CCXXFLAGS_JDK - common to C and C++
|
||||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||||
|
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||||
|
# Force compatibility with i586 on 32 bit intel platforms.
|
||||||
|
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
|
||||||
|
fi
|
||||||
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
|
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
|
||||||
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||||
case $OPENJDK_TARGET_CPU_ARCH in
|
case $OPENJDK_TARGET_CPU_ARCH in
|
||||||
@ -42471,6 +42481,31 @@ $as_echo "$supports" >&6; }
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether --enable-warnings-as-errors was given.
|
||||||
|
if test "${enable_warnings_as_errors+set}" = set; then :
|
||||||
|
enableval=$enable_warnings_as_errors;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if native warnings are errors" >&5
|
||||||
|
$as_echo_n "checking if native warnings are errors... " >&6; }
|
||||||
|
if test "x$enable_warnings_as_errors" = "xyes"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (explicitely set)" >&5
|
||||||
|
$as_echo "yes (explicitely set)" >&6; }
|
||||||
|
WARNINGS_AS_ERRORS=true
|
||||||
|
elif test "x$enable_warnings_as_errors" = "xno"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
WARNINGS_AS_ERRORS=false
|
||||||
|
elif test "x$enable_warnings_as_errors" = "x"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5
|
||||||
|
$as_echo "yes (default)" >&6; }
|
||||||
|
WARNINGS_AS_ERRORS=true
|
||||||
|
else
|
||||||
|
as_fn_error $? "--enable-warnings-as-errors accepts no argument" "$LINENO" 5
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
case "${TOOLCHAIN_TYPE}" in
|
case "${TOOLCHAIN_TYPE}" in
|
||||||
microsoft)
|
microsoft)
|
||||||
DISABLE_WARNING_PREFIX="-wd"
|
DISABLE_WARNING_PREFIX="-wd"
|
||||||
@ -54179,14 +54214,31 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# After AC_OUTPUT, we need to do final work
|
||||||
|
|
||||||
# Try to move the config.log file to the output directory.
|
|
||||||
if test -e ./config.log; then
|
|
||||||
$MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make the compare script executable
|
# Try to move config.log (generated by autoconf) to the configure-support directory.
|
||||||
$CHMOD +x $OUTPUT_ROOT/compare.sh
|
if test -e ./config.log; then
|
||||||
|
$MV -f ./config.log "$CONFIGURESUPPORT_OUTPUTDIR/config.log" 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Rotate our log file (configure.log)
|
||||||
|
if test -e "$OUTPUT_ROOT/configure.log.old"; then
|
||||||
|
$RM -f "$OUTPUT_ROOT/configure.log.old"
|
||||||
|
fi
|
||||||
|
if test -e "$OUTPUT_ROOT/configure.log"; then
|
||||||
|
$MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Move configure.log from current directory to the build output root
|
||||||
|
if test -e ./configure.log; then
|
||||||
|
echo found it
|
||||||
|
$MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make the compare script executable
|
||||||
|
$CHMOD +x $OUTPUT_ROOT/compare.sh
|
||||||
|
|
||||||
|
|
||||||
# Finally output some useful information to the user
|
# Finally output some useful information to the user
|
||||||
|
|
||||||
@ -54280,14 +54332,20 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test -e "$OUTPUT_ROOT/config.log"; then
|
# Locate config.log.
|
||||||
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
|
if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
|
||||||
if test $? -eq 0; then
|
CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
|
||||||
printf "The following warnings were produced. Repeated here for convenience:\n"
|
elif test -e "./config.log"; then
|
||||||
# We must quote sed expression (using []) to stop m4 from eating the [].
|
CONFIG_LOG_PATH="."
|
||||||
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e 's/^configure:[0-9]*: //'
|
|
||||||
printf "\n"
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
|
if test -e "$CONFIG_LOG_PATH/config.log"; then
|
||||||
|
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
|
||||||
|
if test $? -eq 0; then
|
||||||
|
printf "The following warnings were produced. Repeated here for convenience:\n"
|
||||||
|
# We must quote sed expression (using []) to stop m4 from eating the [].
|
||||||
|
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e 's/^configure:[0-9]*: //'
|
||||||
|
printf "\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
|||||||
if test "x$TOOLCHAIN_VERSION" != "x"; then
|
if test "x$TOOLCHAIN_VERSION" != "x"; then
|
||||||
print_version=" $TOOLCHAIN_VERSION"
|
print_version=" $TOOLCHAIN_VERSION"
|
||||||
fi
|
fi
|
||||||
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
|
printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION$print_version)\n"
|
||||||
printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n"
|
printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n"
|
||||||
printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n"
|
printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n"
|
||||||
|
|
||||||
@ -263,14 +263,20 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
|||||||
|
|
||||||
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
|
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
|
||||||
[
|
[
|
||||||
if test -e "$OUTPUT_ROOT/config.log"; then
|
# Locate config.log.
|
||||||
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
|
if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
|
||||||
if test $? -eq 0; then
|
CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
|
||||||
printf "The following warnings were produced. Repeated here for convenience:\n"
|
elif test -e "./config.log"; then
|
||||||
# We must quote sed expression (using []) to stop m4 from eating the [].
|
CONFIG_LOG_PATH="."
|
||||||
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
|
|
||||||
printf "\n"
|
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
|
if test -e "$CONFIG_LOG_PATH/config.log"; then
|
||||||
|
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
|
||||||
|
if test $? -eq 0; then
|
||||||
|
printf "The following warnings were produced. Repeated here for convenience:\n"
|
||||||
|
# We must quote sed expression (using []) to stop m4 from eating the [].
|
||||||
|
$GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
|
||||||
|
printf "\n"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
])
|
])
|
||||||
|
@ -321,6 +321,9 @@ CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
|
|||||||
DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
|
DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
|
||||||
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
|
CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
|
||||||
|
|
||||||
|
# A global flag (true or false) determining if native warnings are considered errors.
|
||||||
|
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
||||||
|
|
||||||
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
CFLAGS_CCACHE:=@CFLAGS_CCACHE@
|
||||||
|
|
||||||
# Tools that potentially need to be cross compilation aware.
|
# Tools that potentially need to be cross compilation aware.
|
||||||
@ -394,9 +397,6 @@ STRIP:=@STRIP@
|
|||||||
|
|
||||||
LIPO:=@LIPO@
|
LIPO:=@LIPO@
|
||||||
|
|
||||||
# Command to create a shared library
|
|
||||||
SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
|
|
||||||
|
|
||||||
# Options to linker to specify a mapfile.
|
# Options to linker to specify a mapfile.
|
||||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||||
SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
|
SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
|
||||||
|
@ -306,3 +306,4 @@ caa330b275f39282793466529f6864766b31d9fd jdk9-b60
|
|||||||
d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61
|
d690f489ca0bb95a6157d996da2fa72bcbcf02ea jdk9-b61
|
||||||
d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62
|
d27f7e0a7aca129969de23e9934408a31b4abf4c jdk9-b62
|
||||||
0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63
|
0acac6937de7a0868f8c6f88b7d036d780abeee6 jdk9-b63
|
||||||
|
0a5e5a7c3539e8bde73d9fe55750e49a49cb8dac jdk9-b64
|
||||||
|
@ -466,3 +466,4 @@ ee878f3d6732856f7725c590312bfbe2ffa52cc7 jdk9-b58
|
|||||||
715d2da5801c410746e92f08066d53bde1496286 jdk9-b61
|
715d2da5801c410746e92f08066d53bde1496286 jdk9-b61
|
||||||
1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62
|
1eab877142cce6ca06e556e2ad0af688f993f00b jdk9-b62
|
||||||
2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63
|
2ac9b6b36689b50d1562627067c92d51781b5684 jdk9-b63
|
||||||
|
bf92b8db249cdfa5651ef954b6c0743a7e0ea4cd jdk9-b64
|
||||||
|
@ -810,9 +810,6 @@ class HandlerImpl {
|
|||||||
bool unnecessary_volatile(const Node *barrier);
|
bool unnecessary_volatile(const Node *barrier);
|
||||||
bool needs_releasing_store(const Node *store);
|
bool needs_releasing_store(const Node *store);
|
||||||
|
|
||||||
// Use barrier instructions rather than load acquire / store
|
|
||||||
// release.
|
|
||||||
const bool UseBarriersForVolatile = false;
|
|
||||||
// Use barrier instructions for unsafe volatile gets rather than
|
// Use barrier instructions for unsafe volatile gets rather than
|
||||||
// trying to identify an exact signature for them
|
// trying to identify an exact signature for them
|
||||||
const bool UseBarriersForUnsafeVolatileGet = false;
|
const bool UseBarriersForUnsafeVolatileGet = false;
|
||||||
|
@ -98,8 +98,8 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
|||||||
product(bool, NearCpool, true, \
|
product(bool, NearCpool, true, \
|
||||||
"constant pool is close to instructions") \
|
"constant pool is close to instructions") \
|
||||||
\
|
\
|
||||||
notproduct(bool, UseAcqRelForVolatileFields, false, \
|
product(bool, UseBarriersForVolatile, false, \
|
||||||
"Use acquire and release insns for volatile fields") \
|
"Use memory barriers to implement volatile accesses") \
|
||||||
\
|
\
|
||||||
product(bool, UseCRC32, false, \
|
product(bool, UseCRC32, false, \
|
||||||
"Use CRC32 instructions for CRC32 computation") \
|
"Use CRC32 instructions for CRC32 computation") \
|
||||||
@ -117,8 +117,8 @@ define_pd_global(intx, InlineSmallCode, 1000);
|
|||||||
product(bool, NearCpool, true, \
|
product(bool, NearCpool, true, \
|
||||||
"constant pool is close to instructions") \
|
"constant pool is close to instructions") \
|
||||||
\
|
\
|
||||||
notproduct(bool, UseAcqRelForVolatileFields, false, \
|
product(bool, UseBarriersForVolatile, false, \
|
||||||
"Use acquire and release insns for volatile fields") \
|
"Use memory barriers to implement volatile accesses") \
|
||||||
product(bool, UseNeon, false, \
|
product(bool, UseNeon, false, \
|
||||||
"Use Neon for CRC32 computation") \
|
"Use Neon for CRC32 computation") \
|
||||||
product(bool, UseCRC32, false, \
|
product(bool, UseCRC32, false, \
|
||||||
|
@ -1314,7 +1314,7 @@ void InterpreterMacroAssembler::profile_switch_case(Register index,
|
|||||||
// case_array_offset_in_bytes()
|
// case_array_offset_in_bytes()
|
||||||
movw(reg2, in_bytes(MultiBranchData::per_case_size()));
|
movw(reg2, in_bytes(MultiBranchData::per_case_size()));
|
||||||
movw(rscratch1, in_bytes(MultiBranchData::case_array_offset()));
|
movw(rscratch1, in_bytes(MultiBranchData::case_array_offset()));
|
||||||
maddw(index, index, reg2, rscratch1);
|
Assembler::maddw(index, index, reg2, rscratch1);
|
||||||
|
|
||||||
// Update the case count
|
// Update the case count
|
||||||
increment_mdp_data_at(mdp,
|
increment_mdp_data_at(mdp,
|
||||||
|
@ -1625,7 +1625,7 @@ int MacroAssembler::corrected_idivl(Register result, Register ra, Register rb,
|
|||||||
sdivw(result, ra, rb);
|
sdivw(result, ra, rb);
|
||||||
} else {
|
} else {
|
||||||
sdivw(scratch, ra, rb);
|
sdivw(scratch, ra, rb);
|
||||||
msubw(result, scratch, rb, ra);
|
Assembler::msubw(result, scratch, rb, ra);
|
||||||
}
|
}
|
||||||
|
|
||||||
return idivl_offset;
|
return idivl_offset;
|
||||||
@ -1655,7 +1655,7 @@ int MacroAssembler::corrected_idivq(Register result, Register ra, Register rb,
|
|||||||
sdiv(result, ra, rb);
|
sdiv(result, ra, rb);
|
||||||
} else {
|
} else {
|
||||||
sdiv(scratch, ra, rb);
|
sdiv(scratch, ra, rb);
|
||||||
msub(result, scratch, rb, ra);
|
Assembler::msub(result, scratch, rb, ra);
|
||||||
}
|
}
|
||||||
|
|
||||||
return idivq_offset;
|
return idivq_offset;
|
||||||
@ -3787,14 +3787,6 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::use_acq_rel_for_volatile_fields() {
|
|
||||||
#ifdef PRODUCT
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
return UseAcqRelForVolatileFields;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroAssembler::build_frame(int framesize) {
|
void MacroAssembler::build_frame(int framesize) {
|
||||||
if (framesize == 0) {
|
if (framesize == 0) {
|
||||||
// Is this even possible?
|
// Is this even possible?
|
||||||
|
@ -405,6 +405,18 @@ class MacroAssembler: public Assembler {
|
|||||||
umaddl(Rd, Rn, Rm, zr);
|
umaddl(Rd, Rn, Rm, zr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define WRAP(INSN) \
|
||||||
|
void INSN(Register Rd, Register Rn, Register Rm, Register Ra) { \
|
||||||
|
if ((VM_Version::cpu_cpuFeatures() & VM_Version::CPU_A53MAC) && Ra != zr) \
|
||||||
|
nop(); \
|
||||||
|
Assembler::INSN(Rd, Rn, Rm, Ra); \
|
||||||
|
}
|
||||||
|
|
||||||
|
WRAP(madd) WRAP(msub) WRAP(maddw) WRAP(msubw)
|
||||||
|
WRAP(smaddl) WRAP(smsubl) WRAP(umaddl) WRAP(umsubl)
|
||||||
|
#undef WRAP
|
||||||
|
|
||||||
|
|
||||||
// macro assembly operations needed for aarch64
|
// macro assembly operations needed for aarch64
|
||||||
|
|
||||||
// first two private routines for loading 32 bit or 64 bit constants
|
// first two private routines for loading 32 bit or 64 bit constants
|
||||||
@ -1094,9 +1106,6 @@ public:
|
|||||||
address read_polling_page(Register r, address page, relocInfo::relocType rtype);
|
address read_polling_page(Register r, address page, relocInfo::relocType rtype);
|
||||||
address read_polling_page(Register r, relocInfo::relocType rtype);
|
address read_polling_page(Register r, relocInfo::relocType rtype);
|
||||||
|
|
||||||
// Used by aarch64.ad to control code generation
|
|
||||||
static bool use_acq_rel_for_volatile_fields();
|
|
||||||
|
|
||||||
// CRC32 code for java.util.zip.CRC32::updateBytes() instrinsic.
|
// CRC32 code for java.util.zip.CRC32::updateBytes() instrinsic.
|
||||||
void update_byte_crc32(Register crc, Register val, Register table);
|
void update_byte_crc32(Register crc, Register val, Register table);
|
||||||
void update_word_crc32(Register crc, Register v, Register tmp,
|
void update_word_crc32(Register crc, Register v, Register tmp,
|
||||||
@ -1150,10 +1159,6 @@ private:
|
|||||||
int offset, int size);
|
int offset, int size);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Used by aarch64.ad to control code generation
|
|
||||||
#define treat_as_volatile(MEM_NODE) \
|
|
||||||
(MacroAssembler::use_acq_rel_for_volatile_fields() ? (MEM_NODE)->is_volatile() : false)
|
|
||||||
|
|
||||||
#ifdef ASSERT
|
#ifdef ASSERT
|
||||||
inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
|
inline bool AbstractAssembler::pd_check_instruction_mark() { return false; }
|
||||||
#endif
|
#endif
|
||||||
|
@ -59,6 +59,9 @@
|
|||||||
|
|
||||||
int VM_Version::_cpu;
|
int VM_Version::_cpu;
|
||||||
int VM_Version::_model;
|
int VM_Version::_model;
|
||||||
|
int VM_Version::_model2;
|
||||||
|
int VM_Version::_variant;
|
||||||
|
int VM_Version::_revision;
|
||||||
int VM_Version::_stepping;
|
int VM_Version::_stepping;
|
||||||
int VM_Version::_cpuFeatures;
|
int VM_Version::_cpuFeatures;
|
||||||
const char* VM_Version::_features_str = "";
|
const char* VM_Version::_features_str = "";
|
||||||
@ -122,13 +125,47 @@ void VM_Version::get_processor_features() {
|
|||||||
|
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
|
||||||
strcpy(buf, "simd");
|
_cpuFeatures = auxv;
|
||||||
|
|
||||||
|
int cpu_lines = 0;
|
||||||
|
if (FILE *f = fopen("/proc/cpuinfo", "r")) {
|
||||||
|
char buf[128], *p;
|
||||||
|
while (fgets(buf, sizeof (buf), f) != NULL) {
|
||||||
|
if (p = strchr(buf, ':')) {
|
||||||
|
long v = strtol(p+1, NULL, 0);
|
||||||
|
if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) {
|
||||||
|
_cpu = v;
|
||||||
|
cpu_lines++;
|
||||||
|
} else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) {
|
||||||
|
_variant = v;
|
||||||
|
} else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) {
|
||||||
|
if (_model != v) _model2 = _model;
|
||||||
|
_model = v;
|
||||||
|
} else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) {
|
||||||
|
_revision = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable vendor specific features
|
||||||
|
if (_cpu == CPU_CAVIUM && _variant == 0) _cpuFeatures |= CPU_DMB_ATOMICS;
|
||||||
|
if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _cpuFeatures |= CPU_A53MAC;
|
||||||
|
// If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07)
|
||||||
|
// we assume the worst and assume we could be on a big little system and have
|
||||||
|
// undisclosed A53 cores which we could be swapped to at any stage
|
||||||
|
if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _cpuFeatures |= CPU_A53MAC;
|
||||||
|
|
||||||
|
sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision);
|
||||||
|
if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2);
|
||||||
|
if (auxv & HWCAP_ASIMD) strcat(buf, ", simd");
|
||||||
if (auxv & HWCAP_CRC32) strcat(buf, ", crc");
|
if (auxv & HWCAP_CRC32) strcat(buf, ", crc");
|
||||||
if (auxv & HWCAP_AES) strcat(buf, ", aes");
|
if (auxv & HWCAP_AES) strcat(buf, ", aes");
|
||||||
if (auxv & HWCAP_SHA1) strcat(buf, ", sha1");
|
if (auxv & HWCAP_SHA1) strcat(buf, ", sha1");
|
||||||
if (auxv & HWCAP_SHA2) strcat(buf, ", sha256");
|
if (auxv & HWCAP_SHA2) strcat(buf, ", sha256");
|
||||||
|
|
||||||
_features_str = strdup(buf);
|
_features_str = os::strdup(buf);
|
||||||
|
|
||||||
if (FLAG_IS_DEFAULT(UseCRC32)) {
|
if (FLAG_IS_DEFAULT(UseCRC32)) {
|
||||||
UseCRC32 = (auxv & HWCAP_CRC32) != 0;
|
UseCRC32 = (auxv & HWCAP_CRC32) != 0;
|
||||||
@ -202,6 +239,10 @@ void VM_Version::get_processor_features() {
|
|||||||
UseMultiplyToLenIntrinsic = true;
|
UseMultiplyToLenIntrinsic = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FLAG_IS_DEFAULT(UseBarriersForVolatile)) {
|
||||||
|
UseBarriersForVolatile = (_cpuFeatures & CPU_DMB_ATOMICS) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMPILER2
|
#ifdef COMPILER2
|
||||||
if (FLAG_IS_DEFAULT(OptoScheduling)) {
|
if (FLAG_IS_DEFAULT(OptoScheduling)) {
|
||||||
OptoScheduling = true;
|
OptoScheduling = true;
|
||||||
|
@ -34,6 +34,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
static int _cpu;
|
static int _cpu;
|
||||||
static int _model;
|
static int _model;
|
||||||
|
static int _model2;
|
||||||
|
static int _variant;
|
||||||
|
static int _revision;
|
||||||
static int _stepping;
|
static int _stepping;
|
||||||
static int _cpuFeatures; // features returned by the "cpuid" instruction
|
static int _cpuFeatures; // features returned by the "cpuid" instruction
|
||||||
// 0 if this instruction is not available
|
// 0 if this instruction is not available
|
||||||
@ -49,7 +52,40 @@ public:
|
|||||||
static void assert_is_initialized() {
|
static void assert_is_initialized() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CPU_ARM = 'A',
|
||||||
|
CPU_BROADCOM = 'B',
|
||||||
|
CPU_CAVIUM = 'C',
|
||||||
|
CPU_DEC = 'D',
|
||||||
|
CPU_INFINEON = 'I',
|
||||||
|
CPU_MOTOROLA = 'M',
|
||||||
|
CPU_NVIDIA = 'N',
|
||||||
|
CPU_AMCC = 'P',
|
||||||
|
CPU_QUALCOM = 'Q',
|
||||||
|
CPU_MARVELL = 'V',
|
||||||
|
CPU_INTEL = 'i',
|
||||||
|
} cpuFamily;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CPU_FP = (1<<0),
|
||||||
|
CPU_ASIMD = (1<<1),
|
||||||
|
CPU_EVTSTRM = (1<<2),
|
||||||
|
CPU_AES = (1<<3),
|
||||||
|
CPU_PMULL = (1<<4),
|
||||||
|
CPU_SHA1 = (1<<5),
|
||||||
|
CPU_SHA2 = (1<<6),
|
||||||
|
CPU_CRC32 = (1<<7),
|
||||||
|
CPU_A53MAC = (1 << 30),
|
||||||
|
CPU_DMB_ATOMICS = (1 << 31),
|
||||||
|
} cpuFeatureFlags;
|
||||||
|
|
||||||
static const char* cpu_features() { return _features_str; }
|
static const char* cpu_features() { return _features_str; }
|
||||||
|
static int cpu_family() { return _cpu; }
|
||||||
|
static int cpu_model() { return _model; }
|
||||||
|
static int cpu_model2() { return _model2; }
|
||||||
|
static int cpu_variant() { return _variant; }
|
||||||
|
static int cpu_revision() { return _revision; }
|
||||||
|
static int cpu_cpuFeatures() { return _cpuFeatures; }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -306,3 +306,4 @@ c12db18748dacfccd6581ead29228c2cb6e51b34 jdk9-b60
|
|||||||
f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61
|
f4a4a54620370f077c2e830a5561c8cfa811712b jdk9-b61
|
||||||
3bcf83c1bbc1b7663e930d72c133a9bd86c7618d jdk9-b62
|
3bcf83c1bbc1b7663e930d72c133a9bd86c7618d jdk9-b62
|
||||||
4a8f895f0317dcc90479cb7cc97014312e69edf7 jdk9-b63
|
4a8f895f0317dcc90479cb7cc97014312e69edf7 jdk9-b63
|
||||||
|
6f91749b5aaef1a171ec2254163233438d1071d1 jdk9-b64
|
||||||
|
@ -567,8 +567,12 @@ public final class MultiDOM implements DOM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public NodeList makeNodeList(DTMAxisIterator iter) {
|
public NodeList makeNodeList(DTMAxisIterator iter) {
|
||||||
// TODO: gather nodes from all DOMs ?
|
int index = iter.next();
|
||||||
return _main.makeNodeList(iter);
|
if (index == DTM.NULL) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
iter.reset();
|
||||||
|
return _adapters[getDTMId(index)].makeNodeList(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLanguage(int node) {
|
public String getLanguage(int node) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
*
|
*
|
||||||
* The contents of this file are subject to the terms of either the GNU
|
* The contents of this file are subject to the terms of either the GNU
|
||||||
* General Public License Version 2 only ("GPL") or the Common Development
|
* General Public License Version 2 only ("GPL") or the Common Development
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package javax.xml.transform;
|
||||||
|
|
||||||
|
import org.w3c.dom.Node;
|
||||||
|
import org.w3c.dom.NodeList;
|
||||||
|
|
||||||
|
public class DocumentExtFunc {
|
||||||
|
|
||||||
|
public static String test(NodeList list) {
|
||||||
|
Node node = list.item(0);
|
||||||
|
return "["+node.getNodeName() + ":" + node.getNodeValue()+"]";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package javax.xml.transform;
|
||||||
|
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
|
||||||
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
import javax.xml.transform.stream.StreamSource;
|
||||||
|
|
||||||
|
import org.testng.annotations.DataProvider;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
import static org.testng.Assert.assertEquals;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @summary This class contains tests for XSLT functions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class XSLTFunctionsTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @bug 8062518
|
||||||
|
* Verifies that a reference to the DTM created by XSLT document function is
|
||||||
|
* actually read from the DTM by an extension function.
|
||||||
|
* @param xml Content of xml file to process
|
||||||
|
* @param xsl stylesheet content that loads external document {@code externalDoc}
|
||||||
|
* with XSLT 'document' function and then reads it with
|
||||||
|
* DocumentExtFunc.test() function
|
||||||
|
* @param externalDoc Content of the external xml document
|
||||||
|
* @param expectedResult Expected transformation result
|
||||||
|
**/
|
||||||
|
@Test(dataProvider = "document")
|
||||||
|
public void testDocument(final String xml, final String xsl,
|
||||||
|
final String externalDoc, final String expectedResult) throws Exception {
|
||||||
|
// Prepare sources for transormation
|
||||||
|
Source src = new StreamSource(new StringReader(xml));
|
||||||
|
Source xslsrc = new StreamSource(new StringReader(xsl));
|
||||||
|
|
||||||
|
// Create factory and transformer
|
||||||
|
TransformerFactory tf = TransformerFactory.newInstance();
|
||||||
|
Transformer t = tf.newTransformer( xslsrc );
|
||||||
|
t.setErrorListener(tf.getErrorListener());
|
||||||
|
|
||||||
|
// Set URI Resolver to return the newly constructed xml
|
||||||
|
// stream source object from xml test string
|
||||||
|
t.setURIResolver(new URIResolver() {
|
||||||
|
@Override
|
||||||
|
public Source resolve(String href, String base)
|
||||||
|
throws TransformerException {
|
||||||
|
if (href.contains("externalDoc")) {
|
||||||
|
return new StreamSource(new StringReader(externalDoc));
|
||||||
|
} else {
|
||||||
|
return new StreamSource(new StringReader(xml));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Prepare output stream
|
||||||
|
StringWriter xmlResultString = new StringWriter();
|
||||||
|
StreamResult xmlResultStream = new StreamResult(xmlResultString);
|
||||||
|
|
||||||
|
//Transform the xml
|
||||||
|
t.transform(src, xmlResultStream);
|
||||||
|
|
||||||
|
// If the document can't be accessed and the bug is in place then
|
||||||
|
// reported exception will be thrown during transformation
|
||||||
|
System.out.println("Transformation result:"+xmlResultString.toString().trim());
|
||||||
|
|
||||||
|
// Check the result - it should contain two (node name, node values) entries -
|
||||||
|
// one for original document, another for a document created with
|
||||||
|
// call to 'document' function
|
||||||
|
assertEquals(xmlResultString.toString().trim(), expectedResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DataProvider(name = "document")
|
||||||
|
public static Object[][] documentTestData() {
|
||||||
|
return new Object[][] {
|
||||||
|
{documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static final String documentTestXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>Doc</Test>";
|
||||||
|
|
||||||
|
static final String documentTestExternalDoc = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>External Doc</Test>";
|
||||||
|
|
||||||
|
static final String documentTestXsl = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
+ "<xsl:transform version=\"1.0\""
|
||||||
|
+ " xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" "
|
||||||
|
+ " xmlns:cfunc=\"http://xml.apache.org/xalan/java/\">"
|
||||||
|
+ "<xsl:template match=\"/\">"
|
||||||
|
+ "<xsl:element name=\"root\">"
|
||||||
|
+ "<xsl:variable name=\"other_doc\" select=\"document('externalDoc')\"/>"
|
||||||
|
+ "<!-- Source -->"
|
||||||
|
+ "<xsl:value-of select=\"cfunc:javax.xml.transform.DocumentExtFunc.test(/Test)\"/>"
|
||||||
|
+ "<!-- document() -->"
|
||||||
|
+ "<xsl:value-of select=\"cfunc:javax.xml.transform.DocumentExtFunc.test($other_doc/Test)\"/>"
|
||||||
|
+ "</xsl:element></xsl:template></xsl:transform>";
|
||||||
|
|
||||||
|
static final String documentTesteExpectedResult = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
+ "<root>[Test:Doc][Test:External Doc]</root>";
|
||||||
|
}
|
@ -309,3 +309,4 @@ f31835b59035377a220efc5a248b90f090ee1689 jdk9-b60
|
|||||||
77f44848c44c003205490bf5ab88035233b65418 jdk9-b61
|
77f44848c44c003205490bf5ab88035233b65418 jdk9-b61
|
||||||
cd0cf72b2cbf4adb778a02505fb065bb2292688c jdk9-b62
|
cd0cf72b2cbf4adb778a02505fb065bb2292688c jdk9-b62
|
||||||
b5c22d09b1c91dd49b006f38d8ba9c4397517ccc jdk9-b63
|
b5c22d09b1c91dd49b006f38d8ba9c4397517ccc jdk9-b63
|
||||||
|
df100399ed27d0eaa57c137ca99819a0fee66178 jdk9-b64
|
||||||
|
@ -306,3 +306,4 @@ c76339e86ea7da5d9ac7856f3fae9ef73eef04a2 jdk9-b57
|
|||||||
da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
|
da84dcac1b0b12c5b836b05ac75ecbfadee0cd32 jdk9-b61
|
||||||
49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62
|
49118e68fbd4cc0044e718c47db681946d5efd69 jdk9-b62
|
||||||
fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63
|
fd3281c400347088b36aeb16273aa679d53a81a4 jdk9-b63
|
||||||
|
7de8d036ad0980d988d1b9b4b4e6be555d9fbf98 jdk9-b64
|
||||||
|
@ -30,6 +30,7 @@ include MakeBase.gmk
|
|||||||
include JavaCompilation.gmk
|
include JavaCompilation.gmk
|
||||||
include NativeCompilation.gmk
|
include NativeCompilation.gmk
|
||||||
include SetupJavaCompilers.gmk
|
include SetupJavaCompilers.gmk
|
||||||
|
include TextFileProcessing.gmk
|
||||||
|
|
||||||
# Prepare the find cache.
|
# Prepare the find cache.
|
||||||
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
|
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
|
||||||
@ -49,6 +50,15 @@ GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/commo
|
|||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
# This rule will be depended on due to the MANIFEST line
|
||||||
|
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
|
||||||
|
SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
||||||
|
OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
|
||||||
|
REPLACEMENTS := \
|
||||||
|
@@RELEASE@@ => $(RELEASE) ; \
|
||||||
|
@@COMPANY_NAME@@ => $(COMPANY_NAME) , \
|
||||||
|
))
|
||||||
|
|
||||||
define SetupAppletDemo
|
define SetupAppletDemo
|
||||||
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
|
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
|
||||||
SETUP := GENERATE_USINGJDKBYTECODE, \
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
||||||
@ -122,7 +132,7 @@ define SetupDemo
|
|||||||
COPY := $(PATTERNS_TO_COPY) $(10), \
|
COPY := $(PATTERNS_TO_COPY) $(10), \
|
||||||
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
|
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
|
||||||
JARMAIN := $4, \
|
JARMAIN := $4, \
|
||||||
MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
|
||||||
EXTRA_MANIFEST_ATTR := $(11), \
|
EXTRA_MANIFEST_ATTR := $(11), \
|
||||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
|
||||||
EXCLUDE_FILES := $9, \
|
EXCLUDE_FILES := $9, \
|
||||||
@ -290,7 +300,7 @@ define SetupJVMTIDemo
|
|||||||
COPY := $(PATTERNS_TO_COPY), \
|
COPY := $(PATTERNS_TO_COPY), \
|
||||||
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
|
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
|
||||||
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
|
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
|
||||||
MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
|
MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf))
|
||||||
|
|
||||||
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
|
||||||
endif
|
endif
|
||||||
@ -382,7 +392,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|||||||
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
||||||
HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
||||||
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
|
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
|
||||||
MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
MANIFEST := $(SUPPORT_OUTPUTDIR)/demo/java-main-manifest.mf, \
|
||||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
|
||||||
COPY := README.txt Poller.c, \
|
COPY := README.txt Poller.c, \
|
||||||
JARMAIN := Client))
|
JARMAIN := Client))
|
||||||
|
@ -56,8 +56,7 @@
|
|||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
<TD ALIGN=RIGHT COLSPAN="2"><!-- page headline --><!-------------------------------><!--EDIT THE PAGE HEADLINE HERE--><!------------BEGIN-HEADLINE-----><FONT SIZE=+2>JAVA</FONT><SUP><FONT SIZE=-2>TM</FONT></SUP><FONT SIZE=+2>
|
<TD ALIGN=RIGHT COLSPAN="2"><!-- page headline --><!-------------------------------><!--EDIT THE PAGE HEADLINE HERE--><!------------BEGIN-HEADLINE-----><FONT SIZE=+2>JAVA™ PLUG-IN</FONT>
|
||||||
PLUG-IN</FONT>
|
|
||||||
<BR><B>Demonstration Applets</B>
|
<BR><B>Demonstration Applets</B>
|
||||||
<BR><!-------------END-HEADLINE------><!-- END OF PAGE HEADLINE --><!-------------------------------></TD>
|
<BR><!-------------END-HEADLINE------><!-- END OF PAGE HEADLINE --><!-------------------------------></TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
The
|
The
|
||||||
Java<sup><font size=-2>TM</font></sup> Virtual Machine Tools Interface (JVM TI)
|
Java™ Virtual Machine Tools Interface (JVM TI)
|
||||||
is a native tool interface provided in JDK 5.0 and newer.
|
is a native tool interface provided in JDK 5.0 and newer.
|
||||||
Native libraries that use JVM TI and are loaded into the
|
Native libraries that use JVM TI and are loaded into the
|
||||||
Java Virtual Machine
|
Java Virtual Machine
|
||||||
|
@ -230,13 +230,12 @@ public final class Boolean implements java.io.Serializable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code true} if and only if the system property
|
* Returns {@code true} if and only if the system property named
|
||||||
* named by the argument exists and is equal to the string
|
* by the argument exists and is equal to the string {@code
|
||||||
* {@code "true"}. (Beginning with version 1.0.2 of the
|
* "true"}. (Beginning with version 1.0.2 of the Java™
|
||||||
* Java<small><sup>TM</sup></small> platform, the test of
|
* platform, the test of this string is case insensitive.) A
|
||||||
* this string is case insensitive.) A system property is accessible
|
* system property is accessible through {@code getProperty}, a
|
||||||
* through {@code getProperty}, a method defined by the
|
* method defined by the {@code System} class.
|
||||||
* {@code System} class.
|
|
||||||
* <p>
|
* <p>
|
||||||
* If there is no property with the specified name, or if the specified
|
* If there is no property with the specified name, or if the specified
|
||||||
* name is empty or null, then {@code false} is returned.
|
* name is empty or null, then {@code false} is returned.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -645,8 +645,14 @@ class Character implements java.io.Serializable, Comparable<Character> {
|
|||||||
* @since 1.2
|
* @since 1.2
|
||||||
*/
|
*/
|
||||||
public static final class UnicodeBlock extends Subset {
|
public static final class UnicodeBlock extends Subset {
|
||||||
|
/**
|
||||||
private static Map<String, UnicodeBlock> map = new HashMap<>(256);
|
* 510 - the expected number of enteties
|
||||||
|
* 0.75 - the default load factor of HashMap
|
||||||
|
*/
|
||||||
|
private static final int INITIAL_CAPACITY =
|
||||||
|
(int)(510 / 0.75f + 1.0f);
|
||||||
|
private static Map<String, UnicodeBlock> map =
|
||||||
|
new HashMap<>(INITIAL_CAPACITY);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a UnicodeBlock with the given identifier name.
|
* Creates a UnicodeBlock with the given identifier name.
|
||||||
|
@ -1708,7 +1708,7 @@ public final class Long extends Number implements Comparable<Long> {
|
|||||||
* @since 1.5
|
* @since 1.5
|
||||||
*/
|
*/
|
||||||
public static int bitCount(long i) {
|
public static int bitCount(long i) {
|
||||||
// HD, Figure 5-14
|
// HD, Figure 5-2
|
||||||
i = i - ((i >>> 1) & 0x5555555555555555L);
|
i = i - ((i >>> 1) & 0x5555555555555555L);
|
||||||
i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);
|
i = (i & 0x3333333333333333L) + ((i >>> 2) & 0x3333333333333333L);
|
||||||
i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
|
i = (i + (i >>> 4)) & 0x0f0f0f0f0f0f0f0fL;
|
||||||
|
@ -179,7 +179,7 @@ public final class String
|
|||||||
* not affect the newly created string.
|
* not affect the newly created string.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
* Array that is the source of characters
|
* Array that is the source of characters
|
||||||
*
|
*
|
||||||
* @param offset
|
* @param offset
|
||||||
* The initial offset
|
* The initial offset
|
||||||
@ -208,7 +208,7 @@ public final class String
|
|||||||
if (offset > value.length - count) {
|
if (offset > value.length - count) {
|
||||||
throw new StringIndexOutOfBoundsException(offset + count);
|
throw new StringIndexOutOfBoundsException(offset + count);
|
||||||
}
|
}
|
||||||
this.value = Arrays.copyOfRange(value, offset, offset+count);
|
this.value = Arrays.copyOfRange(value, offset, offset + count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -262,11 +262,11 @@ public final class String
|
|||||||
// Pass 1: Compute precise size of char[]
|
// Pass 1: Compute precise size of char[]
|
||||||
int n = count;
|
int n = count;
|
||||||
for (int i = offset; i < end; i++) {
|
for (int i = offset; i < end; i++) {
|
||||||
int c = codePoints[i];
|
int c = codePoints[i];
|
||||||
if (Character.isBmpCodePoint(c))
|
if (Character.isBmpCodePoint(c))
|
||||||
continue;
|
continue;
|
||||||
else if (Character.isValidCodePoint(c))
|
else if (Character.isValidCodePoint(c))
|
||||||
n++;
|
n++;
|
||||||
else throw new IllegalArgumentException(Integer.toString(c));
|
else throw new IllegalArgumentException(Integer.toString(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ public final class String
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public String(byte ascii[], int hibyte, int offset, int count) {
|
public String(byte ascii[], int hibyte, int offset, int count) {
|
||||||
checkBounds(ascii, offset, count);
|
checkBounds(ascii, offset, count);
|
||||||
char value[] = new char[count];
|
char[] value = new char[count];
|
||||||
|
|
||||||
if (hibyte == 0) {
|
if (hibyte == 0) {
|
||||||
for (int i = count; i-- > 0;) {
|
for (int i = count; i-- > 0;) {
|
||||||
@ -465,7 +465,7 @@ public final class String
|
|||||||
if (charset == null)
|
if (charset == null)
|
||||||
throw new NullPointerException("charset");
|
throw new NullPointerException("charset");
|
||||||
checkBounds(bytes, offset, length);
|
checkBounds(bytes, offset, length);
|
||||||
this.value = StringCoding.decode(charset, bytes, offset, length);
|
this.value = StringCoding.decode(charset, bytes, offset, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -567,7 +567,7 @@ public final class String
|
|||||||
*
|
*
|
||||||
* @since 1.1
|
* @since 1.1
|
||||||
*/
|
*/
|
||||||
public String(byte bytes[]) {
|
public String(byte[] bytes) {
|
||||||
this(bytes, 0, bytes.length);
|
this(bytes, 0, bytes.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -983,11 +983,10 @@ public final class String
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (anObject instanceof String) {
|
if (anObject instanceof String) {
|
||||||
String anotherString = (String)anObject;
|
char[] v1 = value;
|
||||||
int n = value.length;
|
char[] v2 = ((String)anObject).value;
|
||||||
if (n == anotherString.value.length) {
|
int n = v1.length;
|
||||||
char v1[] = value;
|
if (n == v2.length) {
|
||||||
char v2[] = anotherString.value;
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (n-- != 0) {
|
while (n-- != 0) {
|
||||||
if (v1[i] != v2[i])
|
if (v1[i] != v2[i])
|
||||||
@ -1020,8 +1019,8 @@ public final class String
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean nonSyncContentEquals(AbstractStringBuilder sb) {
|
private boolean nonSyncContentEquals(AbstractStringBuilder sb) {
|
||||||
char v1[] = value;
|
char[] v1 = value;
|
||||||
char v2[] = sb.getValue();
|
char[] v2 = sb.getValue();
|
||||||
int n = v1.length;
|
int n = v1.length;
|
||||||
if (n != sb.length()) {
|
if (n != sb.length()) {
|
||||||
return false;
|
return false;
|
||||||
@ -1066,7 +1065,7 @@ public final class String
|
|||||||
return equals(cs);
|
return equals(cs);
|
||||||
}
|
}
|
||||||
// Argument is a generic CharSequence
|
// Argument is a generic CharSequence
|
||||||
char v1[] = value;
|
char[] v1 = value;
|
||||||
int n = v1.length;
|
int n = v1.length;
|
||||||
if (n != cs.length()) {
|
if (n != cs.length()) {
|
||||||
return false;
|
return false;
|
||||||
@ -1156,20 +1155,18 @@ public final class String
|
|||||||
* lexicographically greater than the string argument.
|
* lexicographically greater than the string argument.
|
||||||
*/
|
*/
|
||||||
public int compareTo(String anotherString) {
|
public int compareTo(String anotherString) {
|
||||||
int len1 = value.length;
|
char[] v1 = value;
|
||||||
int len2 = anotherString.value.length;
|
char[] v2 = anotherString.value;
|
||||||
|
int len1 = v1.length;
|
||||||
|
int len2 = v2.length;
|
||||||
int lim = Math.min(len1, len2);
|
int lim = Math.min(len1, len2);
|
||||||
char v1[] = value;
|
|
||||||
char v2[] = anotherString.value;
|
|
||||||
|
|
||||||
int k = 0;
|
for (int k = 0; k < lim; k++) {
|
||||||
while (k < lim) {
|
|
||||||
char c1 = v1[k];
|
char c1 = v1[k];
|
||||||
char c2 = v2[k];
|
char c2 = v2[k];
|
||||||
if (c1 != c2) {
|
if (c1 != c2) {
|
||||||
return c1 - c2;
|
return c1 - c2;
|
||||||
}
|
}
|
||||||
k++;
|
|
||||||
}
|
}
|
||||||
return len1 - len2;
|
return len1 - len2;
|
||||||
}
|
}
|
||||||
@ -1278,14 +1275,14 @@ public final class String
|
|||||||
*/
|
*/
|
||||||
public boolean regionMatches(int toffset, String other, int ooffset,
|
public boolean regionMatches(int toffset, String other, int ooffset,
|
||||||
int len) {
|
int len) {
|
||||||
char ta[] = value;
|
char[] ta = value;
|
||||||
int to = toffset;
|
int to = toffset;
|
||||||
char pa[] = other.value;
|
char[] pa = other.value;
|
||||||
int po = ooffset;
|
int po = ooffset;
|
||||||
// Note: toffset, ooffset, or len might be near -1>>>1.
|
// Note: toffset, ooffset, or len might be near -1>>>1.
|
||||||
if ((ooffset < 0) || (toffset < 0)
|
if ((ooffset < 0) || (toffset < 0)
|
||||||
|| (toffset > (long)value.length - len)
|
|| (toffset > (long)ta.length - len)
|
||||||
|| (ooffset > (long)other.value.length - len)) {
|
|| (ooffset > (long)pa.length - len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
while (len-- > 0) {
|
while (len-- > 0) {
|
||||||
@ -1348,14 +1345,14 @@ public final class String
|
|||||||
*/
|
*/
|
||||||
public boolean regionMatches(boolean ignoreCase, int toffset,
|
public boolean regionMatches(boolean ignoreCase, int toffset,
|
||||||
String other, int ooffset, int len) {
|
String other, int ooffset, int len) {
|
||||||
char ta[] = value;
|
char[] ta = value;
|
||||||
int to = toffset;
|
int to = toffset;
|
||||||
char pa[] = other.value;
|
char[] pa = other.value;
|
||||||
int po = ooffset;
|
int po = ooffset;
|
||||||
// Note: toffset, ooffset, or len might be near -1>>>1.
|
// Note: toffset, ooffset, or len might be near -1>>>1.
|
||||||
if ((ooffset < 0) || (toffset < 0)
|
if ((ooffset < 0) || (toffset < 0)
|
||||||
|| (toffset > (long)value.length - len)
|
|| (toffset > (long)ta.length - len)
|
||||||
|| (ooffset > (long)other.value.length - len)) {
|
|| (ooffset > (long)pa.length - len)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
while (len-- > 0) {
|
while (len-- > 0) {
|
||||||
@ -1405,13 +1402,13 @@ public final class String
|
|||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public boolean startsWith(String prefix, int toffset) {
|
public boolean startsWith(String prefix, int toffset) {
|
||||||
char ta[] = value;
|
char[] ta = value;
|
||||||
int to = toffset;
|
int to = toffset;
|
||||||
char pa[] = prefix.value;
|
char[] pa = prefix.value;
|
||||||
int po = 0;
|
int po = 0;
|
||||||
int pc = prefix.value.length;
|
int pc = pa.length;
|
||||||
// Note: toffset might be near -1>>>1.
|
// Note: toffset might be near -1>>>1.
|
||||||
if ((toffset < 0) || (toffset > value.length - pc)) {
|
if ((toffset < 0) || (toffset > ta.length - pc)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
while (--pc >= 0) {
|
while (--pc >= 0) {
|
||||||
@ -1473,7 +1470,9 @@ public final class String
|
|||||||
for (char v : value) {
|
for (char v : value) {
|
||||||
h = 31 * h + v;
|
h = 31 * h + v;
|
||||||
}
|
}
|
||||||
hash = h;
|
if (h != 0) {
|
||||||
|
hash = h;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
@ -1928,14 +1927,17 @@ public final class String
|
|||||||
* length of this {@code String} object.
|
* length of this {@code String} object.
|
||||||
*/
|
*/
|
||||||
public String substring(int beginIndex) {
|
public String substring(int beginIndex) {
|
||||||
if (beginIndex < 0) {
|
if (beginIndex <= 0) {
|
||||||
throw new StringIndexOutOfBoundsException(beginIndex);
|
if (beginIndex < 0) {
|
||||||
|
throw new StringIndexOutOfBoundsException(beginIndex);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
int subLen = value.length - beginIndex;
|
int subLen = value.length - beginIndex;
|
||||||
if (subLen < 0) {
|
if (subLen < 0) {
|
||||||
throw new StringIndexOutOfBoundsException(subLen);
|
throw new StringIndexOutOfBoundsException(subLen);
|
||||||
}
|
}
|
||||||
return (beginIndex == 0) ? this : new String(value, beginIndex, subLen);
|
return new String(value, beginIndex, subLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1961,8 +1963,13 @@ public final class String
|
|||||||
* {@code endIndex}.
|
* {@code endIndex}.
|
||||||
*/
|
*/
|
||||||
public String substring(int beginIndex, int endIndex) {
|
public String substring(int beginIndex, int endIndex) {
|
||||||
if (beginIndex < 0) {
|
if (beginIndex <= 0) {
|
||||||
throw new StringIndexOutOfBoundsException(beginIndex);
|
if (beginIndex < 0) {
|
||||||
|
throw new StringIndexOutOfBoundsException(beginIndex);
|
||||||
|
}
|
||||||
|
if (endIndex == value.length) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (endIndex > value.length) {
|
if (endIndex > value.length) {
|
||||||
throw new StringIndexOutOfBoundsException(endIndex);
|
throw new StringIndexOutOfBoundsException(endIndex);
|
||||||
@ -1971,8 +1978,7 @@ public final class String
|
|||||||
if (subLen < 0) {
|
if (subLen < 0) {
|
||||||
throw new StringIndexOutOfBoundsException(subLen);
|
throw new StringIndexOutOfBoundsException(subLen);
|
||||||
}
|
}
|
||||||
return ((beginIndex == 0) && (endIndex == value.length)) ? this
|
return new String(value, beginIndex, subLen);
|
||||||
: new String(value, beginIndex, subLen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2034,7 +2040,7 @@ public final class String
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
int len = value.length;
|
int len = value.length;
|
||||||
char buf[] = Arrays.copyOf(value, len + otherLen);
|
char[] buf = Arrays.copyOf(value, len + otherLen);
|
||||||
str.getChars(buf, len);
|
str.getChars(buf, len);
|
||||||
return new String(buf, true);
|
return new String(buf, true);
|
||||||
}
|
}
|
||||||
@ -2070,9 +2076,9 @@ public final class String
|
|||||||
*/
|
*/
|
||||||
public String replace(char oldChar, char newChar) {
|
public String replace(char oldChar, char newChar) {
|
||||||
if (oldChar != newChar) {
|
if (oldChar != newChar) {
|
||||||
int len = value.length;
|
|
||||||
int i = -1;
|
|
||||||
char[] val = value; /* avoid getfield opcode */
|
char[] val = value; /* avoid getfield opcode */
|
||||||
|
int len = val.length;
|
||||||
|
int i = -1;
|
||||||
|
|
||||||
while (++i < len) {
|
while (++i < len) {
|
||||||
if (val[i] == oldChar) {
|
if (val[i] == oldChar) {
|
||||||
@ -2080,7 +2086,7 @@ public final class String
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i < len) {
|
if (i < len) {
|
||||||
char buf[] = new char[len];
|
char[] buf = new char[len];
|
||||||
for (int j = 0; j < i; j++) {
|
for (int j = 0; j < i; j++) {
|
||||||
buf[j] = val[j];
|
buf[j] = val[j];
|
||||||
}
|
}
|
||||||
@ -2876,17 +2882,17 @@ public final class String
|
|||||||
* trailing white space.
|
* trailing white space.
|
||||||
*/
|
*/
|
||||||
public String trim() {
|
public String trim() {
|
||||||
int len = value.length;
|
|
||||||
int st = 0;
|
|
||||||
char[] val = value; /* avoid getfield opcode */
|
char[] val = value; /* avoid getfield opcode */
|
||||||
|
int end = val.length;
|
||||||
|
int beg = 0;
|
||||||
|
|
||||||
while ((st < len) && (val[st] <= ' ')) {
|
while ((beg < end) && (val[beg] <= ' ')) {
|
||||||
st++;
|
beg++;
|
||||||
}
|
}
|
||||||
while ((st < len) && (val[len - 1] <= ' ')) {
|
while ((beg < end) && (val[end - 1] <= ' ')) {
|
||||||
len--;
|
end--;
|
||||||
}
|
}
|
||||||
return ((st > 0) || (len < value.length)) ? substring(st, len) : this;
|
return substring(beg, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3081,7 +3087,7 @@ public final class String
|
|||||||
*/
|
*/
|
||||||
public char[] toCharArray() {
|
public char[] toCharArray() {
|
||||||
// Cannot use Arrays.copyOf because of class initialization order issues
|
// Cannot use Arrays.copyOf because of class initialization order issues
|
||||||
char result[] = new char[value.length];
|
char[] result = new char[value.length];
|
||||||
System.arraycopy(value, 0, result, 0, value.length);
|
System.arraycopy(value, 0, result, 0, value.length);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -3266,8 +3272,7 @@ public final class String
|
|||||||
* as its single character the argument {@code c}.
|
* as its single character the argument {@code c}.
|
||||||
*/
|
*/
|
||||||
public static String valueOf(char c) {
|
public static String valueOf(char c) {
|
||||||
char data[] = {c};
|
return new String(new char[]{c}, true);
|
||||||
return new String(data, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,23 +25,24 @@
|
|||||||
|
|
||||||
package java.security;
|
package java.security;
|
||||||
|
|
||||||
|
import java.lang.ref.Reference;
|
||||||
|
import java.lang.ref.ReferenceQueue;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import sun.misc.JavaSecurityAccess;
|
||||||
import sun.misc.JavaSecurityProtectionDomainAccess;
|
import sun.misc.JavaSecurityProtectionDomainAccess;
|
||||||
import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
|
import static sun.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache;
|
||||||
|
import sun.misc.SharedSecrets;
|
||||||
import sun.security.util.Debug;
|
import sun.security.util.Debug;
|
||||||
import sun.security.util.SecurityConstants;
|
import sun.security.util.SecurityConstants;
|
||||||
import sun.misc.JavaSecurityAccess;
|
|
||||||
import sun.misc.SharedSecrets;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The ProtectionDomain class encapsulates the characteristics of a domain,
|
||||||
*<p>
|
|
||||||
* This ProtectionDomain class encapsulates the characteristics of a domain,
|
|
||||||
* which encloses a set of classes whose instances are granted a set
|
* which encloses a set of classes whose instances are granted a set
|
||||||
* of permissions when being executed on behalf of a given set of Principals.
|
* of permissions when being executed on behalf of a given set of Principals.
|
||||||
* <p>
|
* <p>
|
||||||
@ -58,6 +59,7 @@ import sun.misc.SharedSecrets;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public class ProtectionDomain {
|
public class ProtectionDomain {
|
||||||
|
|
||||||
private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
|
private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
|
||||||
|
|
||||||
private JavaSecurityAccessImpl() {
|
private JavaSecurityAccessImpl() {
|
||||||
@ -86,18 +88,33 @@ public class ProtectionDomain {
|
|||||||
AccessController.getContext(), context);
|
AccessController.getContext(), context);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
|
private static AccessControlContext getCombinedACC(
|
||||||
AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
|
AccessControlContext context, AccessControlContext stack) {
|
||||||
|
AccessControlContext acc =
|
||||||
|
new AccessControlContext(context, stack.getCombiner(), true);
|
||||||
|
|
||||||
return new AccessControlContext(stack.getContext(), acc).optimize();
|
return new AccessControlContext(stack.getContext(), acc).optimize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Set up JavaSecurityAccess in SharedSecrets
|
// setup SharedSecrets to allow access to doIntersectionPrivilege
|
||||||
|
// methods and ProtectionDomain cache
|
||||||
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
|
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
|
||||||
|
SharedSecrets.setJavaSecurityProtectionDomainAccess(
|
||||||
|
new JavaSecurityProtectionDomainAccess() {
|
||||||
|
@Override
|
||||||
|
public ProtectionDomainCache getProtectionDomainCache() {
|
||||||
|
return new PDCache();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for storing ProtectionDomains as keys in a Map.
|
||||||
|
*/
|
||||||
|
static final class Key {}
|
||||||
|
|
||||||
/* CodeSource */
|
/* CodeSource */
|
||||||
private CodeSource codesource ;
|
private CodeSource codesource ;
|
||||||
|
|
||||||
@ -451,40 +468,104 @@ public class ProtectionDomain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for storing ProtectionDomains as keys in a Map.
|
* A cache of ProtectionDomains and their Permissions.
|
||||||
|
*
|
||||||
|
* This class stores ProtectionDomains as weak keys in a ConcurrentHashMap
|
||||||
|
* with additional support for checking and removing weak keys that are no
|
||||||
|
* longer in use.
|
||||||
*/
|
*/
|
||||||
final static class Key {}
|
|
||||||
|
|
||||||
// A cache of ProtectionDomains and their Permissions
|
|
||||||
private static class PDCache implements ProtectionDomainCache {
|
private static class PDCache implements ProtectionDomainCache {
|
||||||
// We must wrap the PermissionCollection in a WeakReference as there
|
private final ConcurrentHashMap<WeakProtectionDomainKey,
|
||||||
// are some PermissionCollections which contain strong references
|
PermissionCollection>
|
||||||
// back to a ProtectionDomain and otherwise would never be removed
|
pdMap = new ConcurrentHashMap<>();
|
||||||
// from the WeakHashMap
|
private final ReferenceQueue<Key> queue = new ReferenceQueue<>();
|
||||||
private final Map<Key, WeakReference<PermissionCollection>>
|
|
||||||
map = new WeakHashMap<>();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void put(ProtectionDomain pd,
|
public void put(ProtectionDomain pd, PermissionCollection pc) {
|
||||||
PermissionCollection pc) {
|
processQueue(queue, pdMap);
|
||||||
map.put(pd == null ? null : pd.key, new WeakReference<>(pc));
|
WeakProtectionDomainKey weakPd =
|
||||||
|
new WeakProtectionDomainKey(pd, queue);
|
||||||
|
pdMap.putIfAbsent(weakPd, pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized PermissionCollection get(ProtectionDomain pd) {
|
public PermissionCollection get(ProtectionDomain pd) {
|
||||||
WeakReference<PermissionCollection> ref =
|
processQueue(queue, pdMap);
|
||||||
map.get(pd == null ? null : pd.key);
|
WeakProtectionDomainKey weakPd =
|
||||||
return ref == null ? null : ref.get();
|
new WeakProtectionDomainKey(pd, queue);
|
||||||
|
return pdMap.get(weakPd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes weak keys from the map that have been enqueued
|
||||||
|
* on the reference queue and are no longer in use.
|
||||||
|
*/
|
||||||
|
private static void processQueue(ReferenceQueue<Key> queue,
|
||||||
|
ConcurrentHashMap<? extends
|
||||||
|
WeakReference<Key>, ?> pdMap) {
|
||||||
|
Reference<? extends Key> ref;
|
||||||
|
while ((ref = queue.poll()) != null) {
|
||||||
|
pdMap.remove(ref);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
/**
|
||||||
SharedSecrets.setJavaSecurityProtectionDomainAccess(
|
* A weak key for a ProtectionDomain.
|
||||||
new JavaSecurityProtectionDomainAccess() {
|
*/
|
||||||
@Override
|
private static class WeakProtectionDomainKey extends WeakReference<Key> {
|
||||||
public ProtectionDomainCache getProtectionDomainCache() {
|
/**
|
||||||
return new PDCache();
|
* Saved value of the referent's identity hash code, to maintain
|
||||||
}
|
* a consistent hash code after the referent has been cleared
|
||||||
});
|
*/
|
||||||
|
private final int hash;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A key representing a null ProtectionDomain.
|
||||||
|
*/
|
||||||
|
private static final Key NULL_KEY = new Key();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new WeakProtectionDomain with the specified domain and
|
||||||
|
* registered with a queue.
|
||||||
|
*/
|
||||||
|
WeakProtectionDomainKey(ProtectionDomain pd, ReferenceQueue<Key> rq) {
|
||||||
|
this((pd == null ? NULL_KEY : pd.key), rq);
|
||||||
|
}
|
||||||
|
|
||||||
|
private WeakProtectionDomainKey(Key key, ReferenceQueue<Key> rq) {
|
||||||
|
super(key, rq);
|
||||||
|
hash = key.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the identity hash code of the original referent.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the given object is an identical
|
||||||
|
* WeakProtectionDomainKey instance, or, if this object's referent
|
||||||
|
* has not been cleared and the given object is another
|
||||||
|
* WeakProtectionDomainKey instance with an identical non-null
|
||||||
|
* referent as this one.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (obj == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj instanceof WeakProtectionDomainKey) {
|
||||||
|
Object referent = get();
|
||||||
|
return (referent != null) &&
|
||||||
|
(referent == ((WeakProtectionDomainKey)obj).get());
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -30,7 +30,12 @@ package java.security.cert;
|
|||||||
* <p>
|
* <p>
|
||||||
* This class is used to provide necessary configuration parameters (server
|
* This class is used to provide necessary configuration parameters (server
|
||||||
* name and port number) to implementations of the LDAP {@code CertStore}
|
* name and port number) to implementations of the LDAP {@code CertStore}
|
||||||
* algorithm.
|
* algorithm. However, if you are retrieving certificates or CRLs from
|
||||||
|
* an ldap URI as specified by RFC 5280, use the
|
||||||
|
* {@link java.security.cert.URICertStoreParameters URICertStoreParameters}
|
||||||
|
* instead as the URI may contain additional information such as the
|
||||||
|
* distinguished name that will help the LDAP CertStore find the specific
|
||||||
|
* certificates and CRLs.
|
||||||
* <p>
|
* <p>
|
||||||
* <b>Concurrent Access</b>
|
* <b>Concurrent Access</b>
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package java.security.cert;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parameters used as input for {@code CertStore} algorithms which use
|
||||||
|
* information contained in a URI to retrieve certificates and CRLs.
|
||||||
|
* <p>
|
||||||
|
* This class is used to provide necessary configuration parameters
|
||||||
|
* through a URI as defined in RFC 5280 to implementations of
|
||||||
|
* {@code CertStore} algorithms.
|
||||||
|
* <p>
|
||||||
|
* <b>Concurrent Access</b>
|
||||||
|
* <p>
|
||||||
|
* Unless otherwise specified, the methods defined in this class are not
|
||||||
|
* thread-safe. Multiple threads that need to access a single
|
||||||
|
* object concurrently should synchronize amongst themselves and
|
||||||
|
* provide the necessary locking. Multiple threads each manipulating
|
||||||
|
* separate objects need not synchronize.
|
||||||
|
*
|
||||||
|
* @since 1.9
|
||||||
|
* @see CertStore
|
||||||
|
* @see java.net.URI
|
||||||
|
*/
|
||||||
|
public final class URICertStoreParameters implements CertStoreParameters {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The uri, cannot be null
|
||||||
|
*/
|
||||||
|
private final URI uri;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Hash code for this parameters.
|
||||||
|
*/
|
||||||
|
private int myhash = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of {@code URICertStoreParameters} with the
|
||||||
|
* specified URI.
|
||||||
|
*
|
||||||
|
* @param uri the URI which contains configuration information.
|
||||||
|
* @throws NullPointerException if {@code uri} is null
|
||||||
|
*/
|
||||||
|
public URICertStoreParameters(URI uri) {
|
||||||
|
if (uri == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
this.uri = uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the URI used to construct this
|
||||||
|
* {@code URICertStoreParameters} object.
|
||||||
|
*
|
||||||
|
* @return the URI.
|
||||||
|
*/
|
||||||
|
public URI getURI() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a copy of this object. Changes to the copy will not affect
|
||||||
|
* the original and vice versa.
|
||||||
|
*
|
||||||
|
* @return the copy
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public URICertStoreParameters clone() {
|
||||||
|
try {
|
||||||
|
return new URICertStoreParameters(uri);
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
/* Cannot happen */
|
||||||
|
throw new InternalError(e.toString(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a hash code value for this parameters object.
|
||||||
|
* The hash code is generated using the URI supplied at construction.
|
||||||
|
*
|
||||||
|
* @return a hash code value for this parameters.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
if (myhash == -1) {
|
||||||
|
myhash = uri.hashCode()*7;
|
||||||
|
}
|
||||||
|
return myhash;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares the specified object with this parameters object for equality.
|
||||||
|
* Two URICertStoreParameters are considered equal if the URIs used
|
||||||
|
* to construct them are equal.
|
||||||
|
*
|
||||||
|
* @param p the object to test for equality with this parameters.
|
||||||
|
*
|
||||||
|
* @return true if the specified object is equal to this parameters object.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object p) {
|
||||||
|
if (p == null || (!(p instanceof URICertStoreParameters))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p == this) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
URICertStoreParameters other = (URICertStoreParameters)p;
|
||||||
|
return uri.equals(other.getURI());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a formatted string describing the parameters
|
||||||
|
* including the URI used to construct this object.
|
||||||
|
*
|
||||||
|
* @return a formatted string describing the parameters
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "URICertStoreParameters: " + uri.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -490,7 +490,7 @@ public class ChoiceFormat extends NumberFormat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Equality comparision between two
|
* Equality comparison between two
|
||||||
*/
|
*/
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj == null) return false;
|
if (obj == null) return false;
|
||||||
|
@ -85,7 +85,7 @@ class ArrayPrefixHelpers {
|
|||||||
*
|
*
|
||||||
* As usual for this sort of utility, there are 4 versions, that
|
* As usual for this sort of utility, there are 4 versions, that
|
||||||
* are simple copy/paste/adapt variants of each other. (The
|
* are simple copy/paste/adapt variants of each other. (The
|
||||||
* double and int versions differ from long version soley by
|
* double and int versions differ from long version solely by
|
||||||
* replacing "long" (with case-matching)).
|
* replacing "long" (with case-matching)).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1172,7 +1172,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||||||
* {@code fieldValuePairs} that are pairs of a field and its value.
|
* {@code fieldValuePairs} that are pairs of a field and its value.
|
||||||
* For example,
|
* For example,
|
||||||
* <pre>
|
* <pre>
|
||||||
* setFeilds(Calendar.YEAR, 2013,
|
* setFields(Calendar.YEAR, 2013,
|
||||||
* Calendar.MONTH, Calendar.DECEMBER,
|
* Calendar.MONTH, Calendar.DECEMBER,
|
||||||
* Calendar.DAY_OF_MONTH, 23);</pre>
|
* Calendar.DAY_OF_MONTH, 23);</pre>
|
||||||
* is equivalent to the sequence of the following
|
* is equivalent to the sequence of the following
|
||||||
@ -1298,7 +1298,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the time zone parameter to the given {@code zone}. If no time
|
* Sets the time zone parameter to the given {@code zone}. If no time
|
||||||
* zone parameter is given to this {@code Caledar.Builder}, the
|
* zone parameter is given to this {@code Calendar.Builder}, the
|
||||||
* {@linkplain TimeZone#getDefault() default
|
* {@linkplain TimeZone#getDefault() default
|
||||||
* <code>TimeZone</code>} will be used in the {@link #build() build}
|
* <code>TimeZone</code>} will be used in the {@link #build() build}
|
||||||
* method.
|
* method.
|
||||||
@ -3316,7 +3316,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
|||||||
* @param field the calendar field
|
* @param field the calendar field
|
||||||
* @return the calendar field name
|
* @return the calendar field name
|
||||||
* @exception IndexOutOfBoundsException if <code>field</code> is negative,
|
* @exception IndexOutOfBoundsException if <code>field</code> is negative,
|
||||||
* equal to or greater then <code>FIELD_COUNT</code>.
|
* equal to or greater than {@code FIELD_COUNT}.
|
||||||
*/
|
*/
|
||||||
static String getFieldName(int field) {
|
static String getFieldName(int field) {
|
||||||
return FIELD_NAME[field];
|
return FIELD_NAME[field];
|
||||||
|
@ -537,7 +537,7 @@ public interface Collection<E> extends Iterable<E> {
|
|||||||
* @implSpec
|
* @implSpec
|
||||||
* The default implementation creates a
|
* The default implementation creates a
|
||||||
* <em><a href="Spliterator.html#binding">late-binding</a></em> spliterator
|
* <em><a href="Spliterator.html#binding">late-binding</a></em> spliterator
|
||||||
* from the collections's {@code Iterator}. The spliterator inherits the
|
* from the collection's {@code Iterator}. The spliterator inherits the
|
||||||
* <em>fail-fast</em> properties of the collection's iterator.
|
* <em>fail-fast</em> properties of the collection's iterator.
|
||||||
* <p>
|
* <p>
|
||||||
* The created {@code Spliterator} reports {@link Spliterator#SIZED}.
|
* The created {@code Spliterator} reports {@link Spliterator#SIZED}.
|
||||||
|
@ -719,7 +719,7 @@ public final class Locale implements Cloneable, Serializable {
|
|||||||
* created and cached.
|
* created and cached.
|
||||||
*
|
*
|
||||||
* @param language lowercase 2 to 8 language code.
|
* @param language lowercase 2 to 8 language code.
|
||||||
* @param country uppercase two-letter ISO-3166 code and numric-3 UN M.49 area code.
|
* @param country uppercase two-letter ISO-3166 code and numeric-3 UN M.49 area code.
|
||||||
* @param variant vendor and browser specific code. See class description.
|
* @param variant vendor and browser specific code. See class description.
|
||||||
* @return the <code>Locale</code> instance requested
|
* @return the <code>Locale</code> instance requested
|
||||||
* @exception NullPointerException if any argument is null.
|
* @exception NullPointerException if any argument is null.
|
||||||
@ -1236,7 +1236,7 @@ public final class Locale implements Cloneable, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Package private method returning the Locale's LocaleExtensions,
|
* Package private method returning the Locale's LocaleExtensions,
|
||||||
* used by ResourceBundle.
|
* used by ResourceBundle.
|
||||||
* @return locale exnteions of this Locale,
|
* @return locale extensions of this Locale,
|
||||||
* or {@code null} if no extensions are defined
|
* or {@code null} if no extensions are defined
|
||||||
*/
|
*/
|
||||||
LocaleExtensions getLocaleExtensions() {
|
LocaleExtensions getLocaleExtensions() {
|
||||||
@ -2609,7 +2609,7 @@ public final class Locale implements Cloneable, Serializable {
|
|||||||
* href="./Locale.html#def_locale_extension">well-formed</a> or an exception
|
* href="./Locale.html#def_locale_extension">well-formed</a> or an exception
|
||||||
* is thrown.
|
* is thrown.
|
||||||
*
|
*
|
||||||
* <p>Attribute comparision for removal is case-insensitive.
|
* <p>Attribute comparison for removal is case-insensitive.
|
||||||
*
|
*
|
||||||
* @param attribute the attribute
|
* @param attribute the attribute
|
||||||
* @return This builder.
|
* @return This builder.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -293,6 +293,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
|||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
}
|
}
|
||||||
this.ID = ID;
|
this.ID = ID;
|
||||||
|
this.zoneId = null; // invalidate cache
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -544,7 +545,23 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
|||||||
* @since 1.8
|
* @since 1.8
|
||||||
*/
|
*/
|
||||||
public ZoneId toZoneId() {
|
public ZoneId toZoneId() {
|
||||||
|
ZoneId zId = zoneId;
|
||||||
|
if (zId == null) {
|
||||||
|
zoneId = zId = toZoneId0();
|
||||||
|
}
|
||||||
|
return zId;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ZoneId toZoneId0() {
|
||||||
String id = getID();
|
String id = getID();
|
||||||
|
TimeZone defaultZone = defaultTimeZone;
|
||||||
|
// are we not defaultTimeZone but our id is equal to default's?
|
||||||
|
if (defaultZone != this &&
|
||||||
|
defaultZone != null && id.equals(defaultZone.getID())) {
|
||||||
|
// delegate to default TZ which is effectively immutable
|
||||||
|
return defaultZone.toZoneId();
|
||||||
|
}
|
||||||
|
// derive it ourselves
|
||||||
if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
|
if (ZoneInfoFile.useOldMapping() && id.length() == 3) {
|
||||||
if ("EST".equals(id))
|
if ("EST".equals(id))
|
||||||
return ZoneId.of("America/New_York");
|
return ZoneId.of("America/New_York");
|
||||||
@ -710,7 +727,12 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
|||||||
sm.checkPermission(new PropertyPermission
|
sm.checkPermission(new PropertyPermission
|
||||||
("user.timezone", "write"));
|
("user.timezone", "write"));
|
||||||
}
|
}
|
||||||
defaultTimeZone = zone;
|
// by saving a defensive clone and returning a clone in getDefault() too,
|
||||||
|
// the defaultTimeZone instance is isolated from user code which makes it
|
||||||
|
// effectively immutable. This is important to avoid races when the
|
||||||
|
// following is evaluated in ZoneId.systemDefault():
|
||||||
|
// TimeZone.getDefault().toZoneId().
|
||||||
|
defaultTimeZone = (zone == null) ? null : (TimeZone) zone.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -735,9 +757,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
|||||||
public Object clone()
|
public Object clone()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
TimeZone other = (TimeZone) super.clone();
|
return super.clone();
|
||||||
other.ID = ID;
|
|
||||||
return other;
|
|
||||||
} catch (CloneNotSupportedException e) {
|
} catch (CloneNotSupportedException e) {
|
||||||
throw new InternalError(e);
|
throw new InternalError(e);
|
||||||
}
|
}
|
||||||
@ -759,6 +779,12 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
|||||||
* @serial
|
* @serial
|
||||||
*/
|
*/
|
||||||
private String ID;
|
private String ID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cached {@link ZoneId} for this TimeZone
|
||||||
|
*/
|
||||||
|
private transient ZoneId zoneId;
|
||||||
|
|
||||||
private static volatile TimeZone defaultTimeZone;
|
private static volatile TimeZone defaultTimeZone;
|
||||||
|
|
||||||
static final String GMT_ID = "GMT";
|
static final String GMT_ID = "GMT";
|
||||||
|
@ -859,7 +859,7 @@ public class TreeMap<K,V>
|
|||||||
* Returns a {@link Set} view of the mappings contained in this map.
|
* Returns a {@link Set} view of the mappings contained in this map.
|
||||||
*
|
*
|
||||||
* <p>The set's iterator returns the entries in ascending key order. The
|
* <p>The set's iterator returns the entries in ascending key order. The
|
||||||
* sets's spliterator is
|
* set's spliterator is
|
||||||
* <em><a href="Spliterator.html#binding">late-binding</a></em>,
|
* <em><a href="Spliterator.html#binding">late-binding</a></em>,
|
||||||
* <em>fail-fast</em>, and additionally reports {@link Spliterator#SORTED} and
|
* <em>fail-fast</em>, and additionally reports {@link Spliterator#SORTED} and
|
||||||
* {@link Spliterator#ORDERED} with an encounter order that is ascending key
|
* {@link Spliterator#ORDERED} with an encounter order that is ascending key
|
||||||
@ -2643,7 +2643,7 @@ public class TreeMap<K,V>
|
|||||||
* child, also serving as origin for the split-off spliterator.
|
* child, also serving as origin for the split-off spliterator.
|
||||||
* Left-hands are symmetric. Descending versions place the origin
|
* Left-hands are symmetric. Descending versions place the origin
|
||||||
* at the end and invert ascending split rules. This base class
|
* at the end and invert ascending split rules. This base class
|
||||||
* is non-commital about directionality, or whether the top-level
|
* is non-committal about directionality, or whether the top-level
|
||||||
* spliterator covers the whole tree. This means that the actual
|
* spliterator covers the whole tree. This means that the actual
|
||||||
* split mechanics are located in subclasses. Some of the subclass
|
* split mechanics are located in subclasses. Some of the subclass
|
||||||
* trySplit methods are identical (except for return types), but
|
* trySplit methods are identical (except for return types), but
|
||||||
|
@ -481,7 +481,7 @@ public class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
|
|||||||
*
|
*
|
||||||
* Maintaining API and serialization compatibility with previous
|
* Maintaining API and serialization compatibility with previous
|
||||||
* versions of this class introduces several oddities. Mainly: We
|
* versions of this class introduces several oddities. Mainly: We
|
||||||
* leave untouched but unused constructor arguments refering to
|
* leave untouched but unused constructor arguments referring to
|
||||||
* concurrencyLevel. We accept a loadFactor constructor argument,
|
* concurrencyLevel. We accept a loadFactor constructor argument,
|
||||||
* but apply it only to initial table capacity (which is the only
|
* but apply it only to initial table capacity (which is the only
|
||||||
* time that we can guarantee to honor it.) We also declare an
|
* time that we can guarantee to honor it.) We also declare an
|
||||||
|
@ -2710,7 +2710,7 @@ public class ConcurrentSkipListMap<K,V> extends AbstractMap<K,V>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns lowest absolute key (ignoring directonality).
|
* Returns lowest absolute key (ignoring directionality).
|
||||||
*/
|
*/
|
||||||
K lowestKey() {
|
K lowestKey() {
|
||||||
Comparator<? super K> cmp = m.comparator;
|
Comparator<? super K> cmp = m.comparator;
|
||||||
@ -2722,7 +2722,7 @@ public class ConcurrentSkipListMap<K,V> extends AbstractMap<K,V>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns highest absolute key (ignoring directonality).
|
* Returns highest absolute key (ignoring directionality).
|
||||||
*/
|
*/
|
||||||
K highestKey() {
|
K highestKey() {
|
||||||
Comparator<? super K> cmp = m.comparator;
|
Comparator<? super K> cmp = m.comparator;
|
||||||
|
@ -1328,13 +1328,16 @@ public class ForkJoinPool extends AbstractExecutorService {
|
|||||||
/**
|
/**
|
||||||
* Number of times to spin-wait before blocking. The spins (in
|
* Number of times to spin-wait before blocking. The spins (in
|
||||||
* awaitRunStateLock and awaitWork) currently use randomized
|
* awaitRunStateLock and awaitWork) currently use randomized
|
||||||
* spins. If/when MWAIT-like intrinsics becomes available, they
|
* spins. Currently set to zero to reduce CPU usage.
|
||||||
* may allow quieter spinning. The value of SPINS must be a power
|
*
|
||||||
* of two, at least 4. The current value causes spinning for a
|
* If greater than zero the value of SPINS must be a power
|
||||||
* small fraction of typical context-switch times, well worthwhile
|
* of two, at least 4. A value of 2048 causes spinning for a
|
||||||
* given the typical likelihoods that blocking is not necessary.
|
* small fraction of typical context-switch times.
|
||||||
|
*
|
||||||
|
* If/when MWAIT-like intrinsics becomes available, they
|
||||||
|
* may allow quieter spinning.
|
||||||
*/
|
*/
|
||||||
private static final int SPINS = 1 << 11;
|
private static final int SPINS = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Increment for seed generators. See class ThreadLocal for
|
* Increment for seed generators. See class ThreadLocal for
|
||||||
|
@ -47,8 +47,7 @@ cryptographic provider developer guide:
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href=
|
<li><a href=
|
||||||
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||||
<b>How to Implement a Provider for the
|
<b>How to Implement a Provider for the Java™ Cryptography Architecture
|
||||||
Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
|
|
||||||
</b></a></li>
|
</b></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@ -66,8 +65,7 @@ For further documentation, please see:
|
|||||||
<li>
|
<li>
|
||||||
<a href=
|
<a href=
|
||||||
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||||
<b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
|
<b>Java™ Cryptography Architecture API Specification and Reference
|
||||||
Cryptography Architecture API Specification and Reference
|
|
||||||
</b></a></li>
|
</b></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -62,14 +62,13 @@ and key specifications, please see:
|
|||||||
<li>
|
<li>
|
||||||
<a href=
|
<a href=
|
||||||
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
"{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html">
|
||||||
<b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
|
<b>Java™ Cryptography Architecture API Specification and Reference
|
||||||
Cryptography Architecture API Specification and Reference
|
|
||||||
</b></a></li>
|
</b></a></li>
|
||||||
<li>
|
<li>
|
||||||
<a href=
|
<a href=
|
||||||
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
"{@docRoot}/../technotes/guides/security/crypto/HowToImplAProvider.html">
|
||||||
<b>How to Implement a Provider for the
|
<b>How to Implement a Provider for the
|
||||||
Java<FONT SIZE=-2><SUP>TM</SUP></FONT> Cryptography Architecture
|
Java™ Cryptography Architecture
|
||||||
</b></a></li>
|
</b></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -38,8 +38,7 @@ and to optionally encrypt the data and/or authenticate the communicating peers.
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
|
<li><a href="{@docRoot}/../technotes/guides/security/StandardNames.html">
|
||||||
<b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
|
<b>Java™ Cryptography Architecture Standard Algorithm Name
|
||||||
Cryptography Architecture Standard Algorithm Name
|
|
||||||
Documentation</b></a></li>
|
Documentation</b></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -145,12 +145,12 @@ public abstract class Parser {
|
|||||||
/**
|
/**
|
||||||
* ASCII character type array.
|
* ASCII character type array.
|
||||||
*
|
*
|
||||||
* This array maps an ASCII (7 bit) character to the character type.<br />
|
* This array maps an ASCII (7 bit) character to the character type.<br>
|
||||||
* Possible character type values are:<br /> - ' ' for any kind of white
|
* Possible character type values are:<br> - ' ' for any kind of white
|
||||||
* space character;<br /> - 'a' for any lower case alphabetical character
|
* space character;<br> - 'a' for any lower case alphabetical character
|
||||||
* value;<br /> - 'A' for any upper case alphabetical character value;<br />
|
* value;<br> - 'A' for any upper case alphabetical character value;<br>
|
||||||
* - 'd' for any decimal digit character value;<br /> - 'z' for any
|
* - 'd' for any decimal digit character value;<br> - 'z' for any
|
||||||
* character less then ' ' except '\t', '\n', '\r';<br /> An ASCII (7 bit)
|
* character less than ' ' except '\t', '\n', '\r';<br> An ASCII (7 bit)
|
||||||
* character which does not fall in any category listed above is mapped to
|
* character which does not fall in any category listed above is mapped to
|
||||||
* it self.
|
* it self.
|
||||||
*/
|
*/
|
||||||
@ -158,11 +158,11 @@ public abstract class Parser {
|
|||||||
/**
|
/**
|
||||||
* NMTOKEN character type array.
|
* NMTOKEN character type array.
|
||||||
*
|
*
|
||||||
* This array maps an ASCII (7 bit) character to the character type.<br />
|
* This array maps an ASCII (7 bit) character to the character type.<br>
|
||||||
* Possible character type values are:<br /> - 0 for underscore ('_') or any
|
* Possible character type values are:<br> - 0 for underscore ('_') or any
|
||||||
* lower and upper case alphabetical character value;<br /> - 1 for colon
|
* lower and upper case alphabetical character value;<br> - 1 for colon
|
||||||
* (':') character;<br /> - 2 for dash ('-') and dot ('.') or any decimal
|
* (':') character;<br> - 2 for dash ('-') and dot ('.') or any decimal
|
||||||
* digit character value;<br /> - 3 for any kind of white space character<br
|
* digit character value;<br> - 3 for any kind of white space character<br
|
||||||
* /> An ASCII (7 bit) character which does not fall in any category listed
|
* /> An ASCII (7 bit) character which does not fall in any category listed
|
||||||
* above is mapped to 0xff.
|
* above is mapped to 0xff.
|
||||||
*/
|
*/
|
||||||
@ -1841,10 +1841,12 @@ public abstract class Parser {
|
|||||||
/**
|
/**
|
||||||
* Reads an attribute value.
|
* Reads an attribute value.
|
||||||
*
|
*
|
||||||
* The grammar which this method can read is:<br />
|
* The grammar this method can read is:
|
||||||
* <code>eqstr := S "=" qstr</code><br />
|
* <pre>{@code
|
||||||
* <code>qstr := S ("'" string "'") |
|
* eqstr := S "=" qstr
|
||||||
* ('"' string '"')</code><br /> This method resolves entities
|
* qstr := S ("'" string "'") | ('"' string '"')
|
||||||
|
* }</pre>
|
||||||
|
* This method resolves entities
|
||||||
* inside a string unless the parser parses DTD.
|
* inside a string unless the parser parses DTD.
|
||||||
*
|
*
|
||||||
* @param flag The '=' character forces the method to accept the '='
|
* @param flag The '=' character forces the method to accept the '='
|
||||||
@ -2633,7 +2635,7 @@ public abstract class Parser {
|
|||||||
* Reports characters and empties the parser's buffer. This method is called
|
* Reports characters and empties the parser's buffer. This method is called
|
||||||
* only if parser is going to return control to the main loop. This means
|
* only if parser is going to return control to the main loop. This means
|
||||||
* that this method may use parser buffer to report white space without
|
* that this method may use parser buffer to report white space without
|
||||||
* copeing characters to temporary buffer.
|
* copying characters to temporary buffer.
|
||||||
*/
|
*/
|
||||||
protected abstract void bflash()
|
protected abstract void bflash()
|
||||||
throws Exception;
|
throws Exception;
|
||||||
@ -2642,7 +2644,7 @@ public abstract class Parser {
|
|||||||
* Reports white space characters and empties the parser's buffer. This
|
* Reports white space characters and empties the parser's buffer. This
|
||||||
* method is called only if parser is going to return control to the main
|
* method is called only if parser is going to return control to the main
|
||||||
* loop. This means that this method may use parser buffer to report white
|
* loop. This means that this method may use parser buffer to report white
|
||||||
* space without copeing characters to temporary buffer.
|
* space without copying characters to temporary buffer.
|
||||||
*/
|
*/
|
||||||
protected abstract void bflash_ws()
|
protected abstract void bflash_ws()
|
||||||
throws Exception;
|
throws Exception;
|
||||||
@ -3290,16 +3292,20 @@ public abstract class Parser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps a character to it's type.
|
* Maps a character to its type.
|
||||||
*
|
*
|
||||||
* Possible character type values are:<br /> - ' ' for any kind of white
|
* Possible character type values are:
|
||||||
* space character;<br /> - 'a' for any lower case alphabetical character
|
* <ul>
|
||||||
* value;<br /> - 'A' for any upper case alphabetical character value;<br />
|
* <li>' ' - for any kind of whitespace character;</li>
|
||||||
* - 'd' for any decimal digit character value;<br /> - 'z' for any
|
* <li>'a' - for any lower case alphabetical character value;</li>
|
||||||
* character less then ' ' except '\t', '\n', '\r';<br /> - 'X' for any not
|
* <li>'A' - for any upper case alphabetical character value;</li>
|
||||||
* ASCII character;<br /> - 'Z' for EOS character.<br /> An ASCII (7 bit)
|
* <li>'d' - for any decimal digit character value;</li>
|
||||||
* character which does not fall in any category listed above is mapped to
|
* <li>'z' - for any character less than ' ' except '\t', '\n', '\r';</li>
|
||||||
* it self.
|
* <li>'X' - for any not ASCII character;</li>
|
||||||
|
* <li>'Z' - for EOS character.</li>
|
||||||
|
* </ul>
|
||||||
|
* An ASCII (7 bit) character which does not fall in any category
|
||||||
|
* listed above is mapped to itself.
|
||||||
*
|
*
|
||||||
* @param ch The character to map.
|
* @param ch The character to map.
|
||||||
* @return The type of character.
|
* @return The type of character.
|
||||||
|
@ -649,7 +649,7 @@ final class ParserSAX
|
|||||||
* Reports characters and empties the parser's buffer. This method is called
|
* Reports characters and empties the parser's buffer. This method is called
|
||||||
* only if parser is going to return control to the main loop. This means
|
* only if parser is going to return control to the main loop. This means
|
||||||
* that this method may use parser buffer to report white space without
|
* that this method may use parser buffer to report white space without
|
||||||
* copeing characters to temporary buffer.
|
* copying characters to temporary buffer.
|
||||||
*/
|
*/
|
||||||
protected void bflash() throws SAXException {
|
protected void bflash() throws SAXException {
|
||||||
if (mBuffIdx >= 0) {
|
if (mBuffIdx >= 0) {
|
||||||
@ -663,7 +663,7 @@ final class ParserSAX
|
|||||||
* Reports white space characters and empties the parser's buffer. This
|
* Reports white space characters and empties the parser's buffer. This
|
||||||
* method is called only if parser is going to return control to the main
|
* method is called only if parser is going to return control to the main
|
||||||
* loop. This means that this method may use parser buffer to report white
|
* loop. This means that this method may use parser buffer to report white
|
||||||
* space without copeing characters to temporary buffer.
|
* space without copying characters to temporary buffer.
|
||||||
*/
|
*/
|
||||||
protected void bflash_ws() throws SAXException {
|
protected void bflash_ws() throws SAXException {
|
||||||
if (mBuffIdx >= 0) {
|
if (mBuffIdx >= 0) {
|
||||||
|
@ -196,8 +196,8 @@ public
|
|||||||
/**
|
/**
|
||||||
* Gets the object associated with the specified key in the Cache.
|
* Gets the object associated with the specified key in the Cache.
|
||||||
* @param key the key in the hash table
|
* @param key the key in the hash table
|
||||||
* @returns the element for the key or null if the key
|
* @return the element for the key or null if the key
|
||||||
* is not defined in the hash table.
|
* is not defined in the hash table.
|
||||||
* @see Cache#put
|
* @see Cache#put
|
||||||
*/
|
*/
|
||||||
public synchronized Object get(Object key) {
|
public synchronized Object get(Object key) {
|
||||||
|
@ -120,7 +120,7 @@ public abstract class CharacterDecoder {
|
|||||||
/**
|
/**
|
||||||
* This method does an actual decode. It takes the decoded bytes and
|
* This method does an actual decode. It takes the decoded bytes and
|
||||||
* writes them to the OutputStream. The integer <i>l</i> tells the
|
* writes them to the OutputStream. The integer <i>l</i> tells the
|
||||||
* method how many bytes are required. This is always <= bytesPerAtom().
|
* method how many bytes are required. This is always {@literal <=} bytesPerAtom().
|
||||||
*/
|
*/
|
||||||
protected void decodeAtom(PushbackInputStream aStream, OutputStream bStream, int l) throws IOException {
|
protected void decodeAtom(PushbackInputStream aStream, OutputStream bStream, int l) throws IOException {
|
||||||
throw new CEStreamExhausted();
|
throw new CEStreamExhausted();
|
||||||
|
@ -68,7 +68,7 @@ import java.nio.ByteBuffer;
|
|||||||
* referenced in the See Also list below.
|
* referenced in the See Also list below.
|
||||||
*
|
*
|
||||||
* @author Chuck McManis
|
* @author Chuck McManis
|
||||||
* @see CharacterDecoder;
|
* @see CharacterDecoder
|
||||||
* @see UCEncoder
|
* @see UCEncoder
|
||||||
* @see UUEncoder
|
* @see UUEncoder
|
||||||
* @see BASE64Encoder
|
* @see BASE64Encoder
|
||||||
@ -107,7 +107,7 @@ public abstract class CharacterEncoder {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode the suffix that ends every output line. By default
|
* Encode the suffix that ends every output line. By default
|
||||||
* this method just prints a <newline> into the output stream.
|
* this method just prints a newline into the output stream.
|
||||||
*/
|
*/
|
||||||
protected void encodeLineSuffix(OutputStream aStream) throws IOException {
|
protected void encodeLineSuffix(OutputStream aStream) throws IOException {
|
||||||
pStream.println();
|
pStream.println();
|
||||||
|
@ -34,7 +34,7 @@ package sun.misc;
|
|||||||
* with the lock() and unlock() methods. However if there is a thread
|
* with the lock() and unlock() methods. However if there is a thread
|
||||||
* waiting for the state variable to become a particular value and you
|
* waiting for the state variable to become a particular value and you
|
||||||
* simply call Unlock(), that thread will not be able to acquire the
|
* simply call Unlock(), that thread will not be able to acquire the
|
||||||
* lock until the state variable equals its desired value. <p>
|
* lock until the state variable equals its desired value.
|
||||||
*
|
*
|
||||||
* @author Peter King
|
* @author Peter King
|
||||||
*/
|
*/
|
||||||
|
@ -45,26 +45,26 @@ import java.net.MalformedURLException;
|
|||||||
import sun.net.www.ParseUtil;
|
import sun.net.www.ParseUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* This class checks dependent extensions a particular jar file may have
|
* This class checks dependent extensions a particular jar file may have
|
||||||
* declared through its manifest attributes.
|
* declared through its manifest attributes.
|
||||||
* </p>
|
* <p>
|
||||||
* Jar file declared dependent extensions through the extension-list
|
* Jar file declared dependent extensions through the extension-list
|
||||||
* attribute. The extension-list contains a list of keys used to
|
* attribute. The extension-list contains a list of keys used to
|
||||||
* fetch the other attributes describing the required extension.
|
* fetch the other attributes describing the required extension.
|
||||||
* If key is the extension key declared in the extension-list
|
* If key is the extension key declared in the extension-list
|
||||||
* attribute, the following describing attribute can be found in
|
* attribute, the following describing attribute can be found in
|
||||||
* the manifest :
|
* the manifest:
|
||||||
* key-Extension-Name: (Specification package name)
|
* <ul>
|
||||||
* key-Specification-Version: (Specification-Version)
|
* <li>key-Extension-Name: (Specification package name)</li>
|
||||||
* key-Implementation-Version: (Implementation-Version)
|
* <li>key-Specification-Version: (Specification-Version)</li>
|
||||||
* key-Implementation-Vendor-Id: (Imlementation-Vendor-Id)
|
* <li>key-Implementation-Version: (Implementation-Version)</li>
|
||||||
* key-Implementation-Version: (Implementation version)
|
* <li>key-Implementation-Vendor-Id: (Imlementation-Vendor-Id)</li>
|
||||||
* key-Implementation-URL: (URL to download the requested extension)
|
* <li>key-Implementation-Version: (Implementation version)</li>
|
||||||
|
* <li>key-Implementation-URL: (URL to download the requested extension)</li>
|
||||||
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* This class also maintain versioning consistency of installed
|
* This class also maintain versioning consistency of installed
|
||||||
* extensions dependencies declared in jar file manifest.
|
* extensions dependencies declared in jar file manifest.
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @deprecated this class will be removed in a future release.
|
* @deprecated this class will be removed in a future release.
|
||||||
* @author Jerome Dochez
|
* @author Jerome Dochez
|
||||||
@ -76,10 +76,9 @@ public class ExtensionDependency {
|
|||||||
private static Vector<ExtensionInstallationProvider> providers;
|
private static Vector<ExtensionInstallationProvider> providers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Register an ExtensionInstallationProvider. The provider is responsible
|
* Register an ExtensionInstallationProvider. The provider is responsible
|
||||||
* for handling the installation (upgrade) of any missing extensions.
|
* for handling the installation (upgrade) of any missing extensions.
|
||||||
* </p>
|
*
|
||||||
* @param eip ExtensionInstallationProvider implementation
|
* @param eip ExtensionInstallationProvider implementation
|
||||||
*/
|
*/
|
||||||
public synchronized static void addExtensionInstallationProvider
|
public synchronized static void addExtensionInstallationProvider
|
||||||
@ -92,9 +91,7 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Unregister a previously installed installation provider
|
* Unregister a previously installed installation provider
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public synchronized static void removeExtensionInstallationProvider
|
public synchronized static void removeExtensionInstallationProvider
|
||||||
(ExtensionInstallationProvider eip)
|
(ExtensionInstallationProvider eip)
|
||||||
@ -103,10 +100,9 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Checks the dependencies of the jar file on installed extension.
|
* Checks the dependencies of the jar file on installed extension.
|
||||||
* </p>
|
*
|
||||||
* @param jarFile containing the attriutes declaring the dependencies
|
* @param jar containing the attributes declaring the dependencies
|
||||||
*/
|
*/
|
||||||
public static boolean checkExtensionsDependencies(JarFile jar)
|
public static boolean checkExtensionsDependencies(JarFile jar)
|
||||||
{
|
{
|
||||||
@ -182,9 +178,8 @@ public class ExtensionDependency {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* Check that a particular dependency on an extension is satisfied.
|
* Check that a particular dependency on an extension is satisfied.
|
||||||
* </p>
|
*
|
||||||
* @param extensionName is the key used for the attributes in the manifest
|
* @param extensionName is the key used for the attributes in the manifest
|
||||||
* @param attr is the attributes of the manifest file
|
* @param attr is the attributes of the manifest file
|
||||||
*
|
*
|
||||||
@ -204,10 +199,9 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* Check if a particular extension is part of the currently installed
|
* Check if a particular extension is part of the currently installed
|
||||||
* extensions.
|
* extensions.
|
||||||
* </p>
|
*
|
||||||
* @param extensionName is the key for the attributes in the manifest
|
* @param extensionName is the key for the attributes in the manifest
|
||||||
* @param attr is the attributes of the manifest
|
* @param attr is the attributes of the manifest
|
||||||
*
|
*
|
||||||
@ -262,11 +256,9 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* Check if the requested extension described by the attributes
|
* Check if the requested extension described by the attributes
|
||||||
* in the manifest under the key extensionName is compatible with
|
* in the manifest under the key extensionName is compatible with
|
||||||
* the jar file.
|
* the jar file.
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param extensionName key in the attribute list
|
* @param extensionName key in the attribute list
|
||||||
* @param attr manifest file attributes
|
* @param attr manifest file attributes
|
||||||
@ -337,10 +329,8 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* An required extension is missing, if an ExtensionInstallationProvider is
|
* An required extension is missing, if an ExtensionInstallationProvider is
|
||||||
* registered, delegate the installation of that particular extension to it.
|
* registered, delegate the installation of that particular extension to it.
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param reqInfo Missing extension information
|
* @param reqInfo Missing extension information
|
||||||
* @param instInfo Older installed version information
|
* @param instInfo Older installed version information
|
||||||
@ -380,11 +370,9 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Checks if the extension, that is specified in the extension-list in
|
* Checks if the extension, that is specified in the extension-list in
|
||||||
* the applet jar manifest, is already installed (i.e. exists in the
|
* the applet jar manifest, is already installed (i.e. exists in the
|
||||||
* extension directory).
|
* extension directory).
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param extensionName extension name in the extension-list
|
* @param extensionName extension name in the extension-list
|
||||||
*
|
*
|
||||||
@ -428,9 +416,7 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* @return the java.ext.dirs property as a list of directory
|
* @return the java.ext.dirs property as a list of directory
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
private static File[] getExtDirs() {
|
private static File[] getExtDirs() {
|
||||||
String s = java.security.AccessController.doPrivileged(
|
String s = java.security.AccessController.doPrivileged(
|
||||||
@ -456,9 +442,8 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* Scan the directories and return all files installed in those
|
* Scan the directories and return all files installed in those
|
||||||
* </p>
|
*
|
||||||
* @param dirs list of directories to scan
|
* @param dirs list of directories to scan
|
||||||
*
|
*
|
||||||
* @return the list of files installed in all the directories
|
* @return the list of files installed in all the directories
|
||||||
@ -483,9 +468,7 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* @return the list of installed extensions jar files
|
* @return the list of installed extensions jar files
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
private File[] getInstalledExtensions() throws IOException {
|
private File[] getInstalledExtensions() throws IOException {
|
||||||
return AccessController.doPrivileged(
|
return AccessController.doPrivileged(
|
||||||
@ -503,9 +486,7 @@ public class ExtensionDependency {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* Add the newly installed jar file to the extension class loader.
|
* Add the newly installed jar file to the extension class loader.
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param cl the current installed extension class loader
|
* @param cl the current installed extension class loader
|
||||||
*
|
*
|
||||||
|
@ -45,9 +45,7 @@ import java.lang.Character.*;
|
|||||||
public class ExtensionInfo {
|
public class ExtensionInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* public static values returned by the isCompatible method
|
* public static values returned by the isCompatible method
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public static final int COMPATIBLE = 0;
|
public static final int COMPATIBLE = 0;
|
||||||
public static final int REQUIRE_SPECIFICATION_UPGRADE = 1;
|
public static final int REQUIRE_SPECIFICATION_UPGRADE = 1;
|
||||||
@ -56,10 +54,8 @@ public class ExtensionInfo {
|
|||||||
public static final int INCOMPATIBLE = 4;
|
public static final int INCOMPATIBLE = 4;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* attributes fully describer an extension. The underlying described
|
* attributes fully describer an extension. The underlying described
|
||||||
* extension may be installed and requested.
|
* extension may be installed and requested.
|
||||||
* <p>
|
|
||||||
*/
|
*/
|
||||||
public String title;
|
public String title;
|
||||||
public String name;
|
public String name;
|
||||||
@ -76,15 +72,12 @@ public class ExtensionInfo {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Create a new uninitialized extension information object
|
* Create a new uninitialized extension information object
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public ExtensionInfo() {
|
public ExtensionInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* Create and initialize an extension information object.
|
* Create and initialize an extension information object.
|
||||||
* The initialization uses the attributes passed as being
|
* The initialization uses the attributes passed as being
|
||||||
* the content of a manifest file to load the extension
|
* the content of a manifest file to load the extension
|
||||||
@ -93,7 +86,7 @@ public class ExtensionInfo {
|
|||||||
* extension they may depend on, the extension key parameter
|
* extension they may depend on, the extension key parameter
|
||||||
* is prepanded to the attribute name to make the key used
|
* is prepanded to the attribute name to make the key used
|
||||||
* to retrieve the attribute from the manifest file
|
* to retrieve the attribute from the manifest file
|
||||||
* <p>
|
*
|
||||||
* @param extensionKey unique extension key in the manifest
|
* @param extensionKey unique extension key in the manifest
|
||||||
* @param attr Attributes of a manifest file
|
* @param attr Attributes of a manifest file
|
||||||
*/
|
*/
|
||||||
@ -149,13 +142,11 @@ public class ExtensionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* @return true if the extension described by this extension information
|
* @return true if the extension described by this extension information
|
||||||
* is compatible with the extension described by the extension
|
* is compatible with the extension described by the extension
|
||||||
* information passed as a parameter
|
* information passed as a parameter
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
* @param the requested extension information to compare to
|
* @param ei the requested extension information to compare to
|
||||||
*/
|
*/
|
||||||
public int isCompatibleWith(ExtensionInfo ei) {
|
public int isCompatibleWith(ExtensionInfo ei) {
|
||||||
|
|
||||||
@ -204,10 +195,8 @@ public class ExtensionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* helper method to print sensible information on the undelying described
|
* helper method to print sensible information on the undelying described
|
||||||
* extension
|
* extension
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Extension : title(" + title + "), name(" + name + "), spec vendor(" +
|
return "Extension : title(" + title + "), name(" + name + "), spec vendor(" +
|
||||||
@ -217,15 +206,15 @@ public class ExtensionInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* helper method to compare two versions.
|
* helper method to compare two versions.
|
||||||
* version are in the x.y.z.t pattern.
|
* version are in the x.y.z.t pattern.
|
||||||
* </p>
|
*
|
||||||
* @param source version to compare to
|
* @param source version to compare to
|
||||||
* @param target version used to compare against
|
* @param target version used to compare against
|
||||||
* @return < 0 if source < version
|
* @return <pre>{@code
|
||||||
* > 0 if source > version
|
* < 0 if source < version
|
||||||
* = 0 if source = version
|
* > 0 if source > version
|
||||||
|
* = 0 if source = version}</pre>
|
||||||
*/
|
*/
|
||||||
private int compareExtensionVersion(String source, String target)
|
private int compareExtensionVersion(String source, String target)
|
||||||
throws NumberFormatException
|
throws NumberFormatException
|
||||||
@ -238,15 +227,15 @@ public class ExtensionInfo {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <p>
|
|
||||||
* helper method to compare two versions.
|
* helper method to compare two versions.
|
||||||
* version are in the x.y.z.t pattern.
|
* version are in the x.y.z.t pattern.
|
||||||
* </p>
|
*
|
||||||
* @param source version to compare to
|
* @param source version to compare to
|
||||||
* @param target version used to compare against
|
* @param target version used to compare against
|
||||||
* @return < 0 if source < version
|
* @return <pre>{@code
|
||||||
* > 0 if source > version
|
* < 0 if source < version
|
||||||
* = 0 if source = version
|
* > 0 if source > version
|
||||||
|
* = 0 if source = version}</pre>
|
||||||
*/
|
*/
|
||||||
private int strictCompareExtensionVersion(String source, String target)
|
private int strictCompareExtensionVersion(String source, String target)
|
||||||
throws NumberFormatException
|
throws NumberFormatException
|
||||||
|
@ -384,8 +384,8 @@ public /*@ spec_bigint_math @*/ class FDBigInteger {
|
|||||||
* Retrieves the normalization bias of the <code>FDBigIntger</code>. The
|
* Retrieves the normalization bias of the <code>FDBigIntger</code>. The
|
||||||
* normalization bias is a left shift such that after it the highest word
|
* normalization bias is a left shift such that after it the highest word
|
||||||
* of the value will have the 4 highest bits equal to zero:
|
* of the value will have the 4 highest bits equal to zero:
|
||||||
* <code>(highestWord & 0xf0000000) == 0</code>, but the next bit should be 1
|
* {@code (highestWord & 0xf0000000) == 0}, but the next bit should be 1
|
||||||
* <code>(highestWord & 0x08000000) != 0</code>.
|
* {@code (highestWord & 0x08000000) != 0}.
|
||||||
*
|
*
|
||||||
* @return The normalization bias.
|
* @return The normalization bias.
|
||||||
*/
|
*/
|
||||||
@ -546,9 +546,9 @@ public /*@ spec_bigint_math @*/ class FDBigInteger {
|
|||||||
* We assume that S has been normalized, as above, and that
|
* We assume that S has been normalized, as above, and that
|
||||||
* "this" has been left-shifted accordingly.
|
* "this" has been left-shifted accordingly.
|
||||||
* Also assumed, of course, is that the result, q, can be expressed
|
* Also assumed, of course, is that the result, q, can be expressed
|
||||||
* as an integer, 0 <= q < 10.
|
* as an integer, {@code 0 <= q < 10}.
|
||||||
*
|
*
|
||||||
* @param The divisor of this <code>FDBigInteger</code>.
|
* @param S The divisor of this <code>FDBigInteger</code>.
|
||||||
* @return <code>q = (int)(this / S)</code>.
|
* @return <code>q = (int)(this / S)</code>.
|
||||||
*/
|
*/
|
||||||
/*@
|
/*@
|
||||||
@ -685,7 +685,7 @@ public /*@ spec_bigint_math @*/ class FDBigInteger {
|
|||||||
*
|
*
|
||||||
* @param p5 The exponent of the power-of-five factor.
|
* @param p5 The exponent of the power-of-five factor.
|
||||||
* @param p2 The exponent of the power-of-two factor.
|
* @param p2 The exponent of the power-of-two factor.
|
||||||
* @return
|
* @return The multiplication result.
|
||||||
*/
|
*/
|
||||||
/*@
|
/*@
|
||||||
@ requires this.value() == 0 || p5 == 0 && p2 == 0;
|
@ requires this.value() == 0 || p5 == 0 && p2 == 0;
|
||||||
@ -931,11 +931,11 @@ public /*@ spec_bigint_math @*/ class FDBigInteger {
|
|||||||
/**
|
/**
|
||||||
* Compares the parameter with this <code>FDBigInteger</code>. Returns an
|
* Compares the parameter with this <code>FDBigInteger</code>. Returns an
|
||||||
* integer accordingly as:
|
* integer accordingly as:
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* >0: this > other
|
* > 0: this > other
|
||||||
* 0: this == other
|
* 0: this == other
|
||||||
* <0: this < other
|
* < 0: this < other
|
||||||
* </pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* @param other The <code>FDBigInteger</code> to compare.
|
* @param other The <code>FDBigInteger</code> to compare.
|
||||||
* @return A negative value, zero, or a positive value according to the
|
* @return A negative value, zero, or a positive value according to the
|
||||||
@ -974,11 +974,11 @@ public /*@ spec_bigint_math @*/ class FDBigInteger {
|
|||||||
* Compares this <code>FDBigInteger</code> with
|
* Compares this <code>FDBigInteger</code> with
|
||||||
* <code>5<sup>p5</sup> * 2<sup>p2</sup></code>.
|
* <code>5<sup>p5</sup> * 2<sup>p2</sup></code>.
|
||||||
* Returns an integer accordingly as:
|
* Returns an integer accordingly as:
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* >0: this > other
|
* > 0: this > other
|
||||||
* 0: this == other
|
* 0: this == other
|
||||||
* <0: this < other
|
* < 0: this < other
|
||||||
* </pre>
|
* }</pre>
|
||||||
* @param p5 The exponent of the power-of-five factor.
|
* @param p5 The exponent of the power-of-five factor.
|
||||||
* @param p2 The exponent of the power-of-two factor.
|
* @param p2 The exponent of the power-of-two factor.
|
||||||
* @return A negative value, zero, or a positive value according to the
|
* @return A negative value, zero, or a positive value according to the
|
||||||
@ -1011,11 +1011,11 @@ public /*@ spec_bigint_math @*/ class FDBigInteger {
|
|||||||
/**
|
/**
|
||||||
* Compares this <code>FDBigInteger</code> with <code>x + y</code>. Returns a
|
* Compares this <code>FDBigInteger</code> with <code>x + y</code>. Returns a
|
||||||
* value according to the comparison as:
|
* value according to the comparison as:
|
||||||
* <pre>
|
* <pre>{@code
|
||||||
* -1: this < x + y
|
* -1: this < x + y
|
||||||
* 0: this == x + y
|
* 0: this == x + y
|
||||||
* 1: this > x + y
|
* 1: this > x + y
|
||||||
* </pre>
|
* }</pre>
|
||||||
* @param x The first addend of the sum to compare.
|
* @param x The first addend of the sum to compare.
|
||||||
* @param y The second addend of the sum to compare.
|
* @param y The second addend of the sum to compare.
|
||||||
* @return -1, 0, or 1 according to the result of the comparison.
|
* @return -1, 0, or 1 according to the result of the comparison.
|
||||||
|
@ -154,7 +154,7 @@ public class FloatingDecimal{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates the sign of the value.
|
* Indicates the sign of the value.
|
||||||
* @return <code>value < 0.0</code>.
|
* @return {@code value < 0.0}.
|
||||||
*/
|
*/
|
||||||
public boolean isNegative();
|
public boolean isNegative();
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public class IOUtils {
|
|||||||
/**
|
/**
|
||||||
* Read up to <code>length</code> of bytes from <code>in</code>
|
* Read up to <code>length</code> of bytes from <code>in</code>
|
||||||
* until EOF is detected.
|
* until EOF is detected.
|
||||||
* @param in input stream, must not be null
|
* @param is input stream, must not be null
|
||||||
* @param length number of bytes to read, -1 or Integer.MAX_VALUE means
|
* @param length number of bytes to read, -1 or Integer.MAX_VALUE means
|
||||||
* read as much as possible
|
* read as much as possible
|
||||||
* @param readAll if true, an EOFException will be thrown if not enough
|
* @param readAll if true, an EOFException will be thrown if not enough
|
||||||
|
@ -29,10 +29,8 @@ import java.io.File;
|
|||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* This class checks that only jar and zip files are included in the file list.
|
* This class checks that only jar and zip files are included in the file list.
|
||||||
* This class is used in extension installation support (ExtensionDependency).
|
* This class is used in extension installation support (ExtensionDependency).
|
||||||
* <p>
|
|
||||||
*
|
*
|
||||||
* @deprecated this class will be removed in a future release.
|
* @deprecated this class will be removed in a future release.
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
|
@ -91,14 +91,14 @@ public interface JavaLangAccess {
|
|||||||
* may be added to the delete on exit list by the application shutdown
|
* may be added to the delete on exit list by the application shutdown
|
||||||
* hooks.
|
* hooks.
|
||||||
*
|
*
|
||||||
* @params slot the slot in the shutdown hook array, whose element
|
* @param slot the slot in the shutdown hook array, whose element
|
||||||
* will be invoked in order during shutdown
|
* will be invoked in order during shutdown
|
||||||
* @params registerShutdownInProgress true to allow the hook
|
* @param registerShutdownInProgress true to allow the hook
|
||||||
* to be registered even if the shutdown is in progress.
|
* to be registered even if the shutdown is in progress.
|
||||||
* @params hook the hook to be registered
|
* @param hook the hook to be registered
|
||||||
*
|
*
|
||||||
* @throw IllegalStateException if shutdown is in progress and
|
* @throws IllegalStateException if shutdown is in progress and
|
||||||
* the slot is not valid to register.
|
* the slot is not valid to register.
|
||||||
*/
|
*/
|
||||||
void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
|
void registerShutdownHook(int slot, boolean registerShutdownInProgress, Runnable hook);
|
||||||
|
|
||||||
|
@ -67,13 +67,13 @@ public final class Perf {
|
|||||||
* <code>AccessController.doPrivileged(PrivilegedAction)</code>.
|
* <code>AccessController.doPrivileged(PrivilegedAction)</code>.
|
||||||
* <p> Here is a suggested idiom for use of this class:
|
* <p> Here is a suggested idiom for use of this class:
|
||||||
*
|
*
|
||||||
* <blockquote><pre>
|
* <blockquote><pre>{@code
|
||||||
* class MyTrustedClass {
|
* class MyTrustedClass {
|
||||||
* private static final Perf perf =
|
* private static final Perf perf =
|
||||||
* AccessController.doPrivileged(new Perf.GetPerfAction<Perf>());
|
* AccessController.doPrivileged(new Perf.GetPerfAction<Perf>());
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
* </pre></blockquote>
|
* }</pre></blockquote>
|
||||||
* <p>
|
* <p>
|
||||||
* In the presence of a security manager, the <code>MyTrustedClass</code>
|
* In the presence of a security manager, the <code>MyTrustedClass</code>
|
||||||
* class in the above example will need to be granted the
|
* class in the above example will need to be granted the
|
||||||
@ -171,8 +171,7 @@ public final class Perf {
|
|||||||
* The attach mode specifies the access permissions requested for the
|
* The attach mode specifies the access permissions requested for the
|
||||||
* instrumentation buffer of the target virtual machine. The permitted
|
* instrumentation buffer of the target virtual machine. The permitted
|
||||||
* access permissions are:
|
* access permissions are:
|
||||||
* <p>
|
* <ul>
|
||||||
* <bl>
|
|
||||||
* <li>"r" - Read only access. This Java virtual machine has only
|
* <li>"r" - Read only access. This Java virtual machine has only
|
||||||
* read access to the instrumentation buffer for the target Java
|
* read access to the instrumentation buffer for the target Java
|
||||||
* virtual machine.
|
* virtual machine.
|
||||||
@ -180,7 +179,7 @@ public final class Perf {
|
|||||||
* write access to the instrumentation buffer for the target Java virtual
|
* write access to the instrumentation buffer for the target Java virtual
|
||||||
* machine. This mode is currently not supported and is reserved for
|
* machine. This mode is currently not supported and is reserved for
|
||||||
* future enhancements.
|
* future enhancements.
|
||||||
* </bl>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param lvmid an integer that uniquely identifies the
|
* @param lvmid an integer that uniquely identifies the
|
||||||
* target local Java virtual machine.
|
* target local Java virtual machine.
|
||||||
|
@ -37,7 +37,7 @@ import java.security.AccessController;
|
|||||||
* The perf counters will be created in the jvmstat perf buffer
|
* The perf counters will be created in the jvmstat perf buffer
|
||||||
* that the HotSpot VM creates. The default size is 32K and thus
|
* that the HotSpot VM creates. The default size is 32K and thus
|
||||||
* the number of counters is bounded. You can alter the size
|
* the number of counters is bounded. You can alter the size
|
||||||
* with -XX:PerfDataMemorySize=<bytes> option. If there is
|
* with {@code -XX:PerfDataMemorySize=<bytes>} option. If there is
|
||||||
* insufficient memory in the jvmstat perf buffer, the C heap memory
|
* insufficient memory in the jvmstat perf buffer, the C heap memory
|
||||||
* will be used and thus the application will continue to run if
|
* will be used and thus the application will continue to run if
|
||||||
* the counters added exceeds the buffer size but the counters
|
* the counters added exceeds the buffer size but the counters
|
||||||
|
@ -51,10 +51,12 @@ import java.io.Writer;
|
|||||||
* <P>
|
* <P>
|
||||||
* To automatically track startup performance in an app or applet,
|
* To automatically track startup performance in an app or applet,
|
||||||
* use the command-line parameter sun.perflog as follows:<BR>
|
* use the command-line parameter sun.perflog as follows:<BR>
|
||||||
|
* <pre>{@code
|
||||||
* -Dsun.perflog[=file:<filename>]
|
* -Dsun.perflog[=file:<filename>]
|
||||||
|
* }</pre>
|
||||||
* <BR>
|
* <BR>
|
||||||
* where simply using the parameter with no value will enable output
|
* where simply using the parameter with no value will enable output
|
||||||
* to the console and a value of "file:<filename>" will cause
|
* to the console and a value of "{@code file:<filename>}" will cause
|
||||||
* that given filename to be created and used for all output.
|
* that given filename to be created and used for all output.
|
||||||
* <P>
|
* <P>
|
||||||
* By default, times are measured using System.currentTimeMillis(). To use
|
* By default, times are measured using System.currentTimeMillis(). To use
|
||||||
|
@ -154,7 +154,8 @@ public abstract class Resource {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Resource data as a ByteBuffer, but only if the input stream
|
* Returns the Resource data as a ByteBuffer, but only if the input stream
|
||||||
* was implemented on top of a ByteBuffer. Return <tt>null</tt> otherwise.
|
* was implemented on top of a ByteBuffer. Return {@code null} otherwise.
|
||||||
|
* @return Resource data or null.
|
||||||
*/
|
*/
|
||||||
public ByteBuffer getByteBuffer() throws IOException {
|
public ByteBuffer getByteBuffer() throws IOException {
|
||||||
InputStream in = cachedInputStream();
|
InputStream in = cachedInputStream();
|
||||||
|
@ -50,7 +50,7 @@ import java.util.Hashtable;
|
|||||||
* Signal objects are created based on their names. For example:
|
* Signal objects are created based on their names. For example:
|
||||||
* <blockquote><pre>
|
* <blockquote><pre>
|
||||||
* new Signal("INT");
|
* new Signal("INT");
|
||||||
* </blockquote></pre>
|
* </pre></blockquote>
|
||||||
* constructs a signal object corresponding to <code>SIGINT</code>, which is
|
* constructs a signal object corresponding to <code>SIGINT</code>, which is
|
||||||
* typically produced when the user presses <code>Ctrl-C</code> at the command line.
|
* typically produced when the user presses <code>Ctrl-C</code> at the command line.
|
||||||
* The <code>Signal</code> constructor throws <code>IllegalArgumentException</code>
|
* The <code>Signal</code> constructor throws <code>IllegalArgumentException</code>
|
||||||
@ -64,7 +64,7 @@ import java.util.Hashtable;
|
|||||||
* }
|
* }
|
||||||
* };
|
* };
|
||||||
* Signal.handle(new Signal("INT"), handler);
|
* Signal.handle(new Signal("INT"), handler);
|
||||||
* </blockquote></pre>
|
* </pre></blockquote>
|
||||||
*
|
*
|
||||||
* @author Sheng Liang
|
* @author Sheng Liang
|
||||||
* @author Bill Shannon
|
* @author Bill Shannon
|
||||||
@ -149,7 +149,7 @@ public final class Signal {
|
|||||||
*
|
*
|
||||||
* @param sig a signal
|
* @param sig a signal
|
||||||
* @param handler the handler to be registered with the given signal.
|
* @param handler the handler to be registered with the given signal.
|
||||||
* @result the old handler
|
* @return the old handler
|
||||||
* @exception IllegalArgumentException the signal is in use by the VM
|
* @exception IllegalArgumentException the signal is in use by the VM
|
||||||
* @see sun.misc.Signal#raise(Signal sig)
|
* @see sun.misc.Signal#raise(Signal sig)
|
||||||
* @see sun.misc.SignalHandler
|
* @see sun.misc.SignalHandler
|
||||||
|
@ -641,9 +641,9 @@ public final class Unsafe {
|
|||||||
* <li>String: any object (not just a java.lang.String)
|
* <li>String: any object (not just a java.lang.String)
|
||||||
* <li>InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
|
* <li>InterfaceMethodRef: (NYI) a method handle to invoke on that call site's arguments
|
||||||
* </ul>
|
* </ul>
|
||||||
* @params hostClass context for linkage, access control, protection domain, and class loader
|
* @param hostClass context for linkage, access control, protection domain, and class loader
|
||||||
* @params data bytes of a class file
|
* @param data bytes of a class file
|
||||||
* @params cpPatches where non-null entries exist, they replace corresponding CP entries in data
|
* @param cpPatches where non-null entries exist, they replace corresponding CP entries in data
|
||||||
*/
|
*/
|
||||||
public native Class<?> defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches);
|
public native Class<?> defineAnonymousClass(Class<?> hostClass, byte[] data, Object[] cpPatches);
|
||||||
|
|
||||||
@ -808,9 +808,9 @@ public final class Unsafe {
|
|||||||
* The system imposes a maximum of 3 samples, representing
|
* The system imposes a maximum of 3 samples, representing
|
||||||
* averages over the last 1, 5, and 15 minutes, respectively.
|
* averages over the last 1, 5, and 15 minutes, respectively.
|
||||||
*
|
*
|
||||||
* @params loadavg an array of double of size nelems
|
* @param loadavg an array of double of size nelems
|
||||||
* @params nelems the number of samples to be retrieved and
|
* @param nelems the number of samples to be retrieved and
|
||||||
* must be 1 to 3.
|
* must be 1 to 3.
|
||||||
*
|
*
|
||||||
* @return the number of samples actually retrieved; or -1
|
* @return the number of samples actually retrieved; or -1
|
||||||
* if the load average is unobtainable.
|
* if the load average is unobtainable.
|
||||||
@ -1108,7 +1108,6 @@ public final class Unsafe {
|
|||||||
* <p>
|
* <p>
|
||||||
* 8-byte atomicity is only guaranteed on platforms on which
|
* 8-byte atomicity is only guaranteed on platforms on which
|
||||||
* support atomic accesses to longs.
|
* support atomic accesses to longs.
|
||||||
* <p>
|
|
||||||
*
|
*
|
||||||
* @param o Java heap object in which the value resides, if any, else
|
* @param o Java heap object in which the value resides, if any, else
|
||||||
* null
|
* null
|
||||||
|
@ -315,7 +315,7 @@ public class VM {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add <tt>n</tt> to the objects pending for finalization count.
|
* Add {@code n} to the objects pending for finalization count.
|
||||||
*
|
*
|
||||||
* @param n an integer value to be added to the objects pending
|
* @param n an integer value to be added to the objects pending
|
||||||
* for finalization count
|
* for finalization count
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages extends java.util.ListResourceBundle {
|
public class Messages extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_de extends java.util.ListResourceBundle {
|
public class Messages_de extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_es extends java.util.ListResourceBundle {
|
public class Messages_es extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_fr extends java.util.ListResourceBundle {
|
public class Messages_fr extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_it extends java.util.ListResourceBundle {
|
public class Messages_it extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_ja extends java.util.ListResourceBundle {
|
public class Messages_ja extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_ko extends java.util.ListResourceBundle {
|
public class Messages_ko extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_pt_BR extends java.util.ListResourceBundle {
|
public class Messages_pt_BR extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_sv extends java.util.ListResourceBundle {
|
public class Messages_sv extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_zh_CN extends java.util.ListResourceBundle {
|
public class Messages_zh_CN extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
package sun.misc.resources;
|
package sun.misc.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> This class represents the <code>ResourceBundle</code>
|
* This class represents the {@code ResourceBundle}
|
||||||
* for sun.misc.
|
* for sun.misc.
|
||||||
*
|
*
|
||||||
* @author Michael Colburn
|
* @author Michael Colburn
|
||||||
@ -35,9 +35,9 @@ package sun.misc.resources;
|
|||||||
public class Messages_zh_TW extends java.util.ListResourceBundle {
|
public class Messages_zh_TW extends java.util.ListResourceBundle {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the contents of this <code>ResourceBundle</code>.
|
* Returns the contents of this {@code ResourceBundle}.
|
||||||
* <p>
|
*
|
||||||
* @return the contents of this <code>ResourceBundle</code>.
|
* @return the contents of this {@code ResourceBundle}.
|
||||||
*/
|
*/
|
||||||
public Object[][] getContents() {
|
public Object[][] getContents() {
|
||||||
return contents;
|
return contents;
|
||||||
|
@ -983,7 +983,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||||||
SocketPermission p = URLtoSocketPermission(this.url);
|
SocketPermission p = URLtoSocketPermission(this.url);
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
try {
|
try {
|
||||||
AccessController.doPrivileged(
|
AccessController.doPrivilegedWithCombiner(
|
||||||
new PrivilegedExceptionAction<>() {
|
new PrivilegedExceptionAction<>() {
|
||||||
public Void run() throws IOException {
|
public Void run() throws IOException {
|
||||||
plainConnect0();
|
plainConnect0();
|
||||||
@ -1244,7 +1244,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||||||
|
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
try {
|
try {
|
||||||
return AccessController.doPrivileged(
|
return AccessController.doPrivilegedWithCombiner(
|
||||||
new PrivilegedExceptionAction<>() {
|
new PrivilegedExceptionAction<>() {
|
||||||
public OutputStream run() throws IOException {
|
public OutputStream run() throws IOException {
|
||||||
return getOutputStream0();
|
return getOutputStream0();
|
||||||
@ -1422,7 +1422,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||||||
|
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
try {
|
try {
|
||||||
return AccessController.doPrivileged(
|
return AccessController.doPrivilegedWithCombiner(
|
||||||
new PrivilegedExceptionAction<>() {
|
new PrivilegedExceptionAction<>() {
|
||||||
public InputStream run() throws IOException {
|
public InputStream run() throws IOException {
|
||||||
return getInputStream0();
|
return getInputStream0();
|
||||||
@ -2565,7 +2565,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||||||
|
|
||||||
if (p != null) {
|
if (p != null) {
|
||||||
try {
|
try {
|
||||||
return AccessController.doPrivileged(
|
return AccessController.doPrivilegedWithCombiner(
|
||||||
new PrivilegedExceptionAction<>() {
|
new PrivilegedExceptionAction<>() {
|
||||||
public Boolean run() throws IOException {
|
public Boolean run() throws IOException {
|
||||||
return followRedirect0(loc, stat, locUrl0);
|
return followRedirect0(loc, stat, locUrl0);
|
||||||
|
@ -378,7 +378,6 @@ public class HKSCS {
|
|||||||
dst[dp++] = repl[1];
|
dst[dp++] = repl[1];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sp++;
|
|
||||||
}
|
}
|
||||||
if (bb > MAX_SINGLEBYTE) { // DoubleByte
|
if (bb > MAX_SINGLEBYTE) { // DoubleByte
|
||||||
dst[dp++] = (byte)(bb >> 8);
|
dst[dp++] = (byte)(bb >> 8);
|
||||||
|
@ -175,10 +175,10 @@ public class Surrogate {
|
|||||||
* @param in The source buffer, from which one more character
|
* @param in The source buffer, from which one more character
|
||||||
* will be consumed if c is a high surrogate
|
* will be consumed if c is a high surrogate
|
||||||
*
|
*
|
||||||
* @returns Either a parsed UCS-4 character, in which case the isPair()
|
* @return Either a parsed UCS-4 character, in which case the isPair()
|
||||||
* and increment() methods will return meaningful values, or
|
* and increment() methods will return meaningful values, or
|
||||||
* -1, in which case error() will return a descriptive result
|
* -1, in which case error() will return a descriptive result
|
||||||
* object
|
* object
|
||||||
*/
|
*/
|
||||||
public int parse(char c, CharBuffer in) {
|
public int parse(char c, CharBuffer in) {
|
||||||
if (Character.isHighSurrogate(c)) {
|
if (Character.isHighSurrogate(c)) {
|
||||||
@ -216,10 +216,10 @@ public class Surrogate {
|
|||||||
* @param ip The input index
|
* @param ip The input index
|
||||||
* @param il The input limit
|
* @param il The input limit
|
||||||
*
|
*
|
||||||
* @returns Either a parsed UCS-4 character, in which case the isPair()
|
* @return Either a parsed UCS-4 character, in which case the isPair()
|
||||||
* and increment() methods will return meaningful values, or
|
* and increment() methods will return meaningful values, or
|
||||||
* -1, in which case error() will return a descriptive result
|
* -1, in which case error() will return a descriptive result
|
||||||
* object
|
* object
|
||||||
*/
|
*/
|
||||||
public int parse(char c, char[] ia, int ip, int il) {
|
public int parse(char c, char[] ia, int ip, int il) {
|
||||||
assert (ia[ip] == c);
|
assert (ia[ip] == c);
|
||||||
@ -280,9 +280,9 @@ public class Surrogate {
|
|||||||
* @param dst The destination buffer, to which one or two UTF-16
|
* @param dst The destination buffer, to which one or two UTF-16
|
||||||
* characters will be written
|
* characters will be written
|
||||||
*
|
*
|
||||||
* @returns Either a positive count of the number of UTF-16 characters
|
* @return Either a positive count of the number of UTF-16 characters
|
||||||
* written to the destination buffer, or -1, in which case
|
* written to the destination buffer, or -1, in which case
|
||||||
* error() will return a descriptive result object
|
* error() will return a descriptive result object
|
||||||
*/
|
*/
|
||||||
public int generate(int uc, int len, CharBuffer dst) {
|
public int generate(int uc, int len, CharBuffer dst) {
|
||||||
if (Character.isBmpCodePoint(uc)) {
|
if (Character.isBmpCodePoint(uc)) {
|
||||||
@ -325,9 +325,9 @@ public class Surrogate {
|
|||||||
* @param dp The destination position
|
* @param dp The destination position
|
||||||
* @param dl The destination limit
|
* @param dl The destination limit
|
||||||
*
|
*
|
||||||
* @returns Either a positive count of the number of UTF-16 characters
|
* @return Either a positive count of the number of UTF-16 characters
|
||||||
* written to the destination buffer, or -1, in which case
|
* written to the destination buffer, or -1, in which case
|
||||||
* error() will return a descriptive result object
|
* error() will return a descriptive result object
|
||||||
*/
|
*/
|
||||||
public int generate(int uc, int len, char[] da, int dp, int dl) {
|
public int generate(int uc, int len, char[] da, int dp, int dl) {
|
||||||
if (Character.isBmpCodePoint(uc)) {
|
if (Character.isBmpCodePoint(uc)) {
|
||||||
|
@ -67,10 +67,6 @@ import java.security.*;
|
|||||||
* in RFC 5280. The ValidationAlgorithm attribute notes the
|
* in RFC 5280. The ValidationAlgorithm attribute notes the
|
||||||
* specification that this provider implements.
|
* specification that this provider implements.
|
||||||
*
|
*
|
||||||
* - LDAP is the CertStore type for LDAP repositories. The
|
|
||||||
* LDAPSchema attribute notes the specification defining the
|
|
||||||
* schema that this provider uses to find certificates and CRLs.
|
|
||||||
*
|
|
||||||
* - JavaPolicy is the default file-based Policy type.
|
* - JavaPolicy is the default file-based Policy type.
|
||||||
*
|
*
|
||||||
* - JavaLoginConfig is the default file-based LoginModule Configuration type.
|
* - JavaLoginConfig is the default file-based LoginModule Configuration type.
|
||||||
@ -275,9 +271,6 @@ final class SunEntries {
|
|||||||
/*
|
/*
|
||||||
* CertStores
|
* CertStores
|
||||||
*/
|
*/
|
||||||
map.put("CertStore.LDAP",
|
|
||||||
"sun.security.provider.certpath.ldap.LDAPCertStore");
|
|
||||||
map.put("CertStore.LDAP LDAPSchema", "RFC2587");
|
|
||||||
map.put("CertStore.Collection",
|
map.put("CertStore.Collection",
|
||||||
"sun.security.provider.certpath.CollectionCertStore");
|
"sun.security.provider.certpath.CollectionCertStore");
|
||||||
map.put("CertStore.com.sun.security.IndexedCollection",
|
map.put("CertStore.com.sun.security.IndexedCollection",
|
||||||
@ -310,7 +303,6 @@ final class SunEntries {
|
|||||||
map.put("KeyStore.JKS ImplementedIn", "Software");
|
map.put("KeyStore.JKS ImplementedIn", "Software");
|
||||||
map.put("CertPathValidator.PKIX ImplementedIn", "Software");
|
map.put("CertPathValidator.PKIX ImplementedIn", "Software");
|
||||||
map.put("CertPathBuilder.PKIX ImplementedIn", "Software");
|
map.put("CertPathBuilder.PKIX ImplementedIn", "Software");
|
||||||
map.put("CertStore.LDAP ImplementedIn", "Software");
|
|
||||||
map.put("CertStore.Collection ImplementedIn", "Software");
|
map.put("CertStore.Collection ImplementedIn", "Software");
|
||||||
map.put("CertStore.com.sun.security.IndexedCollection ImplementedIn",
|
map.put("CertStore.com.sun.security.IndexedCollection ImplementedIn",
|
||||||
"Software");
|
"Software");
|
||||||
|
@ -1,148 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2009, 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.security.provider.certpath;
|
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.security.AccessController;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
|
||||||
import java.security.PrivilegedActionException;
|
|
||||||
import java.security.PrivilegedExceptionAction;
|
|
||||||
import java.security.cert.CertStore;
|
|
||||||
import java.security.cert.CertStoreException;
|
|
||||||
import java.security.cert.X509CertSelector;
|
|
||||||
import java.security.cert.X509CRLSelector;
|
|
||||||
import javax.security.auth.x500.X500Principal;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import sun.security.util.Cache;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper used by URICertStore and others when delegating to another CertStore
|
|
||||||
* to fetch certs and CRLs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public abstract class CertStoreHelper {
|
|
||||||
|
|
||||||
private static final int NUM_TYPES = 2;
|
|
||||||
private final static Map<String,String> classMap = new HashMap<>(NUM_TYPES);
|
|
||||||
static {
|
|
||||||
classMap.put(
|
|
||||||
"LDAP",
|
|
||||||
"sun.security.provider.certpath.ldap.LDAPCertStoreHelper");
|
|
||||||
classMap.put(
|
|
||||||
"SSLServer",
|
|
||||||
"sun.security.provider.certpath.ssl.SSLServerCertStoreHelper");
|
|
||||||
};
|
|
||||||
private static Cache<String, CertStoreHelper> cache
|
|
||||||
= Cache.newSoftMemoryCache(NUM_TYPES);
|
|
||||||
|
|
||||||
public static CertStoreHelper getInstance(final String type)
|
|
||||||
throws NoSuchAlgorithmException
|
|
||||||
{
|
|
||||||
CertStoreHelper helper = cache.get(type);
|
|
||||||
if (helper != null) {
|
|
||||||
return helper;
|
|
||||||
}
|
|
||||||
final String cl = classMap.get(type);
|
|
||||||
if (cl == null) {
|
|
||||||
throw new NoSuchAlgorithmException(type + " not available");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
helper = AccessController.doPrivileged(
|
|
||||||
new PrivilegedExceptionAction<CertStoreHelper>() {
|
|
||||||
public CertStoreHelper run() throws ClassNotFoundException {
|
|
||||||
try {
|
|
||||||
Class<?> c = Class.forName(cl, true, null);
|
|
||||||
CertStoreHelper csh
|
|
||||||
= (CertStoreHelper)c.newInstance();
|
|
||||||
cache.put(type, csh);
|
|
||||||
return csh;
|
|
||||||
} catch (InstantiationException |
|
|
||||||
IllegalAccessException e) {
|
|
||||||
throw new AssertionError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return helper;
|
|
||||||
} catch (PrivilegedActionException e) {
|
|
||||||
throw new NoSuchAlgorithmException(type + " not available",
|
|
||||||
e.getException());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
|
|
||||||
switch (type) {
|
|
||||||
case "LDAP":
|
|
||||||
case "SSLServer":
|
|
||||||
try {
|
|
||||||
CertStoreHelper csh = CertStoreHelper.getInstance(type);
|
|
||||||
return csh.isCausedByNetworkIssue(cse);
|
|
||||||
} catch (NoSuchAlgorithmException nsae) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
case "URI":
|
|
||||||
Throwable t = cse.getCause();
|
|
||||||
return (t != null && t instanceof IOException);
|
|
||||||
default:
|
|
||||||
// we don't know about any other remote CertStore types
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a CertStore using the given URI as parameters.
|
|
||||||
*/
|
|
||||||
public abstract CertStore getCertStore(URI uri)
|
|
||||||
throws NoSuchAlgorithmException, InvalidAlgorithmParameterException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps an existing X509CertSelector when needing to avoid DN matching
|
|
||||||
* issues.
|
|
||||||
*/
|
|
||||||
public abstract X509CertSelector wrap(X509CertSelector selector,
|
|
||||||
X500Principal certSubject,
|
|
||||||
String dn)
|
|
||||||
throws IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps an existing X509CRLSelector when needing to avoid DN matching
|
|
||||||
* issues.
|
|
||||||
*/
|
|
||||||
public abstract X509CRLSelector wrap(X509CRLSelector selector,
|
|
||||||
Collection<X500Principal> certIssuers,
|
|
||||||
String dn)
|
|
||||||
throws IOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the cause of the CertStoreException is a network
|
|
||||||
* related issue.
|
|
||||||
*/
|
|
||||||
public abstract boolean isCausedByNetworkIssue(CertStoreException e);
|
|
||||||
}
|
|
@ -466,6 +466,34 @@ class RevocationChecker extends PKIXRevocationChecker {
|
|||||||
stackedCerts, params.trustAnchors());
|
stackedCerts, params.trustAnchors());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean isCausedByNetworkIssue(String type, CertStoreException cse) {
|
||||||
|
boolean result;
|
||||||
|
Throwable t = cse.getCause();
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case "LDAP":
|
||||||
|
if (t != null) {
|
||||||
|
// These two exception classes are inside java.naming module
|
||||||
|
String cn = t.getClass().getName();
|
||||||
|
result = (cn.equals("javax.naming.ServiceUnavailableException") ||
|
||||||
|
cn.equals("javax.naming.CommunicationException"));
|
||||||
|
} else {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "SSLServer":
|
||||||
|
result = (t != null && t instanceof IOException);
|
||||||
|
break;
|
||||||
|
case "URI":
|
||||||
|
result = (t != null && t instanceof IOException);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// we don't know about any other remote CertStore types
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private void checkCRLs(X509Certificate cert, PublicKey prevKey,
|
private void checkCRLs(X509Certificate cert, PublicKey prevKey,
|
||||||
X509Certificate prevCert, boolean signFlag,
|
X509Certificate prevCert, boolean signFlag,
|
||||||
boolean allowSeparateKey,
|
boolean allowSeparateKey,
|
||||||
@ -510,7 +538,7 @@ class RevocationChecker extends PKIXRevocationChecker {
|
|||||||
"CertStoreException: " + e.getMessage());
|
"CertStoreException: " + e.getMessage());
|
||||||
}
|
}
|
||||||
if (networkFailureException == null &&
|
if (networkFailureException == null &&
|
||||||
CertStoreHelper.isCausedByNetworkIssue(store.getType(),e)) {
|
isCausedByNetworkIssue(store.getType(),e)) {
|
||||||
// save this exception, we may need to throw it later
|
// save this exception, we may need to throw it later
|
||||||
networkFailureException = new CertPathValidatorException(
|
networkFailureException = new CertPathValidatorException(
|
||||||
"Unable to determine revocation status due to " +
|
"Unable to determine revocation status due to " +
|
||||||
@ -557,8 +585,7 @@ class RevocationChecker extends PKIXRevocationChecker {
|
|||||||
} catch (CertStoreException e) {
|
} catch (CertStoreException e) {
|
||||||
if (e instanceof CertStoreTypeException) {
|
if (e instanceof CertStoreTypeException) {
|
||||||
CertStoreTypeException cste = (CertStoreTypeException)e;
|
CertStoreTypeException cste = (CertStoreTypeException)e;
|
||||||
if (CertStoreHelper.isCausedByNetworkIssue(cste.getType(),
|
if (isCausedByNetworkIssue(cste.getType(), e)) {
|
||||||
e)) {
|
|
||||||
throw new CertPathValidatorException(
|
throw new CertPathValidatorException(
|
||||||
"Unable to determine revocation status due to " +
|
"Unable to determine revocation status due to " +
|
||||||
"network error", e, null, -1,
|
"network error", e, null, -1,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -42,6 +42,7 @@ import java.security.cert.CertStoreParameters;
|
|||||||
import java.security.cert.CertStoreSpi;
|
import java.security.cert.CertStoreSpi;
|
||||||
import java.security.cert.CRLException;
|
import java.security.cert.CRLException;
|
||||||
import java.security.cert.CRLSelector;
|
import java.security.cert.CRLSelector;
|
||||||
|
import java.security.cert.URICertStoreParameters;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.security.cert.X509CertSelector;
|
import java.security.cert.X509CertSelector;
|
||||||
import java.security.cert.X509CRL;
|
import java.security.cert.X509CRL;
|
||||||
@ -118,9 +119,7 @@ class URICertStore extends CertStoreSpi {
|
|||||||
|
|
||||||
// true if URI is ldap
|
// true if URI is ldap
|
||||||
private boolean ldap = false;
|
private boolean ldap = false;
|
||||||
private CertStoreHelper ldapHelper;
|
|
||||||
private CertStore ldapCertStore;
|
private CertStore ldapCertStore;
|
||||||
private String ldapPath;
|
|
||||||
|
|
||||||
// Default maximum connect timeout in milliseconds (15 seconds)
|
// Default maximum connect timeout in milliseconds (15 seconds)
|
||||||
// allowed when downloading CRLs
|
// allowed when downloading CRLs
|
||||||
@ -165,13 +164,8 @@ class URICertStore extends CertStoreSpi {
|
|||||||
// if ldap URI, use an LDAPCertStore to fetch certs and CRLs
|
// if ldap URI, use an LDAPCertStore to fetch certs and CRLs
|
||||||
if (uri.getScheme().toLowerCase(Locale.ENGLISH).equals("ldap")) {
|
if (uri.getScheme().toLowerCase(Locale.ENGLISH).equals("ldap")) {
|
||||||
ldap = true;
|
ldap = true;
|
||||||
ldapHelper = CertStoreHelper.getInstance("LDAP");
|
URICertStoreParameters lparams = new URICertStoreParameters(uri);
|
||||||
ldapCertStore = ldapHelper.getCertStore(uri);
|
ldapCertStore = CertStore.getInstance("LDAP", lparams);
|
||||||
ldapPath = uri.getPath();
|
|
||||||
// strip off leading '/'
|
|
||||||
if (ldapPath.charAt(0) == '/') {
|
|
||||||
ldapPath = ldapPath.substring(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
factory = CertificateFactory.getInstance("X.509");
|
factory = CertificateFactory.getInstance("X.509");
|
||||||
@ -246,20 +240,10 @@ class URICertStore extends CertStoreSpi {
|
|||||||
public synchronized Collection<X509Certificate> engineGetCertificates
|
public synchronized Collection<X509Certificate> engineGetCertificates
|
||||||
(CertSelector selector) throws CertStoreException {
|
(CertSelector selector) throws CertStoreException {
|
||||||
|
|
||||||
// if ldap URI we wrap the CertSelector in an LDAPCertSelector to
|
|
||||||
// avoid LDAP DN matching issues (see LDAPCertSelector for more info)
|
|
||||||
if (ldap) {
|
if (ldap) {
|
||||||
X509CertSelector xsel = (X509CertSelector) selector;
|
|
||||||
try {
|
|
||||||
xsel = ldapHelper.wrap(xsel, xsel.getSubject(), ldapPath);
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
throw new CertStoreException(ioe);
|
|
||||||
}
|
|
||||||
// Fetch the certificates via LDAP. LDAPCertStore has its own
|
|
||||||
// caching mechanism, see the class description for more info.
|
// caching mechanism, see the class description for more info.
|
||||||
// Safe cast since xsel is an X509 certificate selector.
|
|
||||||
return (Collection<X509Certificate>)
|
return (Collection<X509Certificate>)
|
||||||
ldapCertStore.getCertificates(xsel);
|
ldapCertStore.getCertificates(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the Certificates for this entry. It returns the cached value
|
// Return the Certificates for this entry. It returns the cached value
|
||||||
@ -356,20 +340,11 @@ class URICertStore extends CertStoreSpi {
|
|||||||
public synchronized Collection<X509CRL> engineGetCRLs(CRLSelector selector)
|
public synchronized Collection<X509CRL> engineGetCRLs(CRLSelector selector)
|
||||||
throws CertStoreException {
|
throws CertStoreException {
|
||||||
|
|
||||||
// if ldap URI we wrap the CRLSelector in an LDAPCRLSelector to
|
|
||||||
// avoid LDAP DN matching issues (see LDAPCRLSelector for more info)
|
|
||||||
if (ldap) {
|
if (ldap) {
|
||||||
X509CRLSelector xsel = (X509CRLSelector) selector;
|
|
||||||
try {
|
|
||||||
xsel = ldapHelper.wrap(xsel, null, ldapPath);
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
throw new CertStoreException(ioe);
|
|
||||||
}
|
|
||||||
// Fetch the CRLs via LDAP. LDAPCertStore has its own
|
// Fetch the CRLs via LDAP. LDAPCertStore has its own
|
||||||
// caching mechanism, see the class description for more info.
|
// caching mechanism, see the class description for more info.
|
||||||
// Safe cast since xsel is an X509 certificate selector.
|
|
||||||
try {
|
try {
|
||||||
return (Collection<X509CRL>) ldapCertStore.getCRLs(xsel);
|
return (Collection<X509CRL>) ldapCertStore.getCRLs(selector);
|
||||||
} catch (CertStoreException cse) {
|
} catch (CertStoreException cse) {
|
||||||
throw new PKIX.CertStoreTypeException("LDAP", cse);
|
throw new PKIX.CertStoreTypeException("LDAP", cse);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -153,7 +153,7 @@ public final class SSLServerCertStore extends CertStoreSpi {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
static CertStore getInstance(URI uri)
|
public static CertStore getInstance(URI uri)
|
||||||
throws InvalidAlgorithmParameterException
|
throws InvalidAlgorithmParameterException
|
||||||
{
|
{
|
||||||
return new CS(new SSLServerCertStore(uri), null, "SSLServer", null);
|
return new CS(new SSLServerCertStore(uri), null, "SSLServer", null);
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2011, 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.security.provider.certpath.ssl;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URI;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
|
||||||
import java.security.cert.CertStore;
|
|
||||||
import java.security.cert.CertStoreException;
|
|
||||||
import java.security.cert.X509CertSelector;
|
|
||||||
import java.security.cert.X509CRLSelector;
|
|
||||||
import java.util.Collection;
|
|
||||||
import javax.security.auth.x500.X500Principal;
|
|
||||||
|
|
||||||
import sun.security.provider.certpath.CertStoreHelper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SSL implementation of CertStoreHelper.
|
|
||||||
*/
|
|
||||||
public final class SSLServerCertStoreHelper extends CertStoreHelper {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CertStore getCertStore(URI uri)
|
|
||||||
throws NoSuchAlgorithmException, InvalidAlgorithmParameterException
|
|
||||||
{
|
|
||||||
return SSLServerCertStore.getInstance(uri);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public X509CertSelector wrap(X509CertSelector selector,
|
|
||||||
X500Principal certSubject,
|
|
||||||
String ldapDN)
|
|
||||||
throws IOException
|
|
||||||
{
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public X509CRLSelector wrap(X509CRLSelector selector,
|
|
||||||
Collection<X500Principal> certIssuers,
|
|
||||||
String ldapDN)
|
|
||||||
throws IOException
|
|
||||||
{
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isCausedByNetworkIssue(CertStoreException e) {
|
|
||||||
Throwable t = e.getCause();
|
|
||||||
return (t != null && t instanceof IOException);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -46,6 +46,9 @@ import java.security.cert.CertStoreException;
|
|||||||
import java.security.cert.CRL;
|
import java.security.cert.CRL;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
|
import java.security.cert.URICertStoreParameters;
|
||||||
|
|
||||||
|
|
||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -69,7 +72,7 @@ import sun.security.util.ObjectIdentifier;
|
|||||||
import sun.security.pkcs10.PKCS10;
|
import sun.security.pkcs10.PKCS10;
|
||||||
import sun.security.pkcs10.PKCS10Attribute;
|
import sun.security.pkcs10.PKCS10Attribute;
|
||||||
import sun.security.provider.X509Factory;
|
import sun.security.provider.X509Factory;
|
||||||
import sun.security.provider.certpath.CertStoreHelper;
|
import sun.security.provider.certpath.ssl.SSLServerCertStore;
|
||||||
import sun.security.util.Password;
|
import sun.security.util.Password;
|
||||||
import javax.crypto.KeyGenerator;
|
import javax.crypto.KeyGenerator;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
@ -2208,14 +2211,10 @@ public final class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // must be LDAP, and uri is not null
|
} else { // must be LDAP, and uri is not null
|
||||||
// Lazily load LDAPCertStoreHelper if present
|
URICertStoreParameters params =
|
||||||
CertStoreHelper helper = CertStoreHelper.getInstance("LDAP");
|
new URICertStoreParameters(uri);
|
||||||
String path = uri.getPath();
|
CertStore s = CertStore.getInstance("LDAP", params);
|
||||||
if (path.charAt(0) == '/') path = path.substring(1);
|
return s.getCRLs(new X509CRLSelector());
|
||||||
CertStore s = helper.getCertStore(uri);
|
|
||||||
X509CRLSelector sel =
|
|
||||||
helper.wrap(new X509CRLSelector(), null, path);
|
|
||||||
return s.getCRLs(sel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2463,9 +2462,7 @@ public final class Main {
|
|||||||
out.println(rb.getString("Not.a.signed.jar.file"));
|
out.println(rb.getString("Not.a.signed.jar.file"));
|
||||||
}
|
}
|
||||||
} else if (sslserver != null) {
|
} else if (sslserver != null) {
|
||||||
// Lazily load SSLCertStoreHelper if present
|
CertStore cs = SSLServerCertStore.getInstance(new URI("https://" + sslserver));
|
||||||
CertStoreHelper helper = CertStoreHelper.getInstance("SSLServer");
|
|
||||||
CertStore cs = helper.getCertStore(new URI("https://" + sslserver));
|
|
||||||
Collection<? extends Certificate> chain;
|
Collection<? extends Certificate> chain;
|
||||||
try {
|
try {
|
||||||
chain = cs.getCertificates(null);
|
chain = cs.getCertificates(null);
|
||||||
|
@ -454,7 +454,7 @@ public class AVA implements DerEncoder {
|
|||||||
if (embeddedHex.size() > 0) {
|
if (embeddedHex.size() > 0) {
|
||||||
// add space(s) before embedded hex bytes
|
// add space(s) before embedded hex bytes
|
||||||
for (int i = 0; i < spaceCount; i++) {
|
for (int i = 0; i < spaceCount; i++) {
|
||||||
temp.append(" ");
|
temp.append(' ');
|
||||||
}
|
}
|
||||||
spaceCount = 0;
|
spaceCount = 0;
|
||||||
|
|
||||||
@ -472,7 +472,7 @@ public class AVA implements DerEncoder {
|
|||||||
} else {
|
} else {
|
||||||
// add space(s)
|
// add space(s)
|
||||||
for (int i = 0; i < spaceCount; i++) {
|
for (int i = 0; i < spaceCount; i++) {
|
||||||
temp.append(" ");
|
temp.append(' ');
|
||||||
}
|
}
|
||||||
spaceCount = 0;
|
spaceCount = 0;
|
||||||
temp.append((char)c);
|
temp.append((char)c);
|
||||||
@ -853,7 +853,7 @@ public class AVA implements DerEncoder {
|
|||||||
}
|
}
|
||||||
sbuffer.append(c);
|
sbuffer.append(c);
|
||||||
}
|
}
|
||||||
typeAndValue.append(sbuffer.toString());
|
typeAndValue.append(sbuffer);
|
||||||
}
|
}
|
||||||
return typeAndValue.toString();
|
return typeAndValue.toString();
|
||||||
}
|
}
|
||||||
@ -1039,7 +1039,7 @@ public class AVA implements DerEncoder {
|
|||||||
StringBuilder retval = new StringBuilder(40);
|
StringBuilder retval = new StringBuilder(40);
|
||||||
|
|
||||||
retval.append(keyword);
|
retval.append(keyword);
|
||||||
retval.append("=");
|
retval.append('=');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String valStr = value.getAsString();
|
String valStr = value.getAsString();
|
||||||
@ -1147,9 +1147,11 @@ public class AVA implements DerEncoder {
|
|||||||
// Emit the string ... quote it if needed
|
// Emit the string ... quote it if needed
|
||||||
// if string is already quoted, don't re-quote
|
// if string is already quoted, don't re-quote
|
||||||
if (!alreadyQuoted && quoteNeeded) {
|
if (!alreadyQuoted && quoteNeeded) {
|
||||||
retval.append("\"" + sbuffer.toString() + "\"");
|
retval.append('\"')
|
||||||
|
.append(sbuffer)
|
||||||
|
.append('\"');
|
||||||
} else {
|
} else {
|
||||||
retval.append(sbuffer.toString());
|
retval.append(sbuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -196,17 +196,20 @@ implements CertAttrSet<String> {
|
|||||||
* Return the object as a string.
|
* Return the object as a string.
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String s = super.toString() + "AuthorityKeyIdentifier [\n";
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(super.toString())
|
||||||
|
.append("AuthorityKeyIdentifier [\n");
|
||||||
if (id != null) {
|
if (id != null) {
|
||||||
s += id.toString(); // id already has a newline
|
sb.append(id); // id already has a newline
|
||||||
}
|
}
|
||||||
if (names != null) {
|
if (names != null) {
|
||||||
s += names.toString() + "\n";
|
sb.append(names).append('\n');
|
||||||
}
|
}
|
||||||
if (serialNum != null) {
|
if (serialNum != null) {
|
||||||
s += serialNum.toString() + "\n";
|
sb.append(serialNum).append('\n');
|
||||||
}
|
}
|
||||||
return (s + "]\n");
|
sb.append("]\n");
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,15 +171,11 @@ implements CertAttrSet<String> {
|
|||||||
* Return user readable form of extension.
|
* Return user readable form of extension.
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String s = super.toString() + "BasicConstraints:[\n";
|
return super.toString() +
|
||||||
|
"BasicConstraints:[\n CA:" + ca +
|
||||||
s += ((ca) ? (" CA:true") : (" CA:false")) + "\n";
|
"\n PathLen:" +
|
||||||
if (pathLen >= 0) {
|
((pathLen >= 0) ? String.valueOf(pathLen) : " undefined") +
|
||||||
s += " PathLen:" + pathLen + "\n";
|
"\n]\n";
|
||||||
} else {
|
|
||||||
s += " PathLen: undefined\n";
|
|
||||||
}
|
|
||||||
return (s + "]\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -231,8 +231,8 @@ public class CRLDistributionPointsExtension extends Extension
|
|||||||
distributionPoints = (List<DistributionPoint>)obj;
|
distributionPoints = (List<DistributionPoint>)obj;
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Attribute name [" + name +
|
throw new IOException("Attribute name [" + name +
|
||||||
"] not recognized by " +
|
"] not recognized by " +
|
||||||
"CertAttrSet:" + extensionName + ".");
|
"CertAttrSet:" + extensionName + '.');
|
||||||
}
|
}
|
||||||
encodeThis();
|
encodeThis();
|
||||||
}
|
}
|
||||||
@ -245,8 +245,8 @@ public class CRLDistributionPointsExtension extends Extension
|
|||||||
return distributionPoints;
|
return distributionPoints;
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Attribute name [" + name +
|
throw new IOException("Attribute name [" + name +
|
||||||
"] not recognized by " +
|
"] not recognized by " +
|
||||||
"CertAttrSet:" + extensionName + ".");
|
"CertAttrSet:" + extensionName + '.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,8 +146,8 @@ implements CertAttrSet<String> {
|
|||||||
}
|
}
|
||||||
crlNumber = (BigInteger)obj;
|
crlNumber = (BigInteger)obj;
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Attribute name not recognized by"
|
throw new IOException("Attribute name not recognized by" +
|
||||||
+ " CertAttrSet:" + extensionName + ".");
|
" CertAttrSet:" + extensionName + '.');
|
||||||
}
|
}
|
||||||
encodeThis();
|
encodeThis();
|
||||||
}
|
}
|
||||||
@ -172,8 +172,8 @@ implements CertAttrSet<String> {
|
|||||||
if (name.equalsIgnoreCase(NUMBER)) {
|
if (name.equalsIgnoreCase(NUMBER)) {
|
||||||
crlNumber = null;
|
crlNumber = null;
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Attribute name not recognized by"
|
throw new IOException("Attribute name not recognized by" +
|
||||||
+ " CertAttrSet:" + extensionName + ".");
|
" CertAttrSet:" + extensionName + '.');
|
||||||
}
|
}
|
||||||
encodeThis();
|
encodeThis();
|
||||||
}
|
}
|
||||||
@ -182,10 +182,15 @@ implements CertAttrSet<String> {
|
|||||||
* Returns a printable representation of the CRLNumberExtension.
|
* Returns a printable representation of the CRLNumberExtension.
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String s = super.toString() + extensionLabel + ": " +
|
StringBuilder sb = new StringBuilder();
|
||||||
((crlNumber == null) ? "" : Debug.toHexString(crlNumber))
|
sb.append(super.toString())
|
||||||
+ "\n";
|
.append(extensionLabel)
|
||||||
return (s);
|
.append(": ");
|
||||||
|
if (crlNumber != null) {
|
||||||
|
sb.append(Debug.toHexString(crlNumber));
|
||||||
|
}
|
||||||
|
sb.append('\n');
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -195,7 +200,7 @@ implements CertAttrSet<String> {
|
|||||||
* @exception IOException on encoding errors.
|
* @exception IOException on encoding errors.
|
||||||
*/
|
*/
|
||||||
public void encode(OutputStream out) throws IOException {
|
public void encode(OutputStream out) throws IOException {
|
||||||
DerOutputStream tmp = new DerOutputStream();
|
DerOutputStream tmp = new DerOutputStream();
|
||||||
encode(out, PKIXExtensions.CRLNumber_Id, true);
|
encode(out, PKIXExtensions.CRLNumber_Id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ public class CertException extends SecurityException {
|
|||||||
*/
|
*/
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
return "[Certificate Exception: " + getMessage() + "]";
|
return "[Certificate Exception: " + getMessage() + ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -168,6 +168,6 @@ public class CertException extends SecurityException {
|
|||||||
{
|
{
|
||||||
return getVerfDescription()
|
return getVerfDescription()
|
||||||
+ ( (moreData != null)
|
+ ( (moreData != null)
|
||||||
? ( "\n (" + moreData + ")" ) : "" );
|
? ( "\n (" + moreData + ')' ) : "" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,10 +160,12 @@ implements CertAttrSet<String> {
|
|||||||
if (certPolicies == null) {
|
if (certPolicies == null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
StringBuilder sb = new StringBuilder(super.toString());
|
|
||||||
sb.append("CertificatePolicies [\n");
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(super.toString())
|
||||||
|
.append("CertificatePolicies [\n");
|
||||||
for (PolicyInformation info : certPolicies) {
|
for (PolicyInformation info : certPolicies) {
|
||||||
sb.append(info.toString());
|
sb.append(info);
|
||||||
}
|
}
|
||||||
sb.append("]\n");
|
sb.append("]\n");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user