Merge
This commit is contained in:
commit
febe9cf80c
1
.hgtags
1
.hgtags
@ -386,3 +386,4 @@ d273dfe9a126d3bffe92072547fef2cd1361b0eb jdk-9+138
|
||||
9aadd2163b568d76f8969ad2fb404a63733da359 jdk-9+141
|
||||
df0e03e3ca0ed1307793017dfc1a054c8726131c jdk-9+142
|
||||
d62173b931bf5b6bffc6e80a9060bb2e8b8efc75 jdk-9+143
|
||||
31f5023200d42185b70c4c00ba5672391e4642d0 jdk-9+144
|
||||
|
@ -387,3 +387,4 @@ f64afae7f1a5608e438585bbf0bc23785e69cba0 jdk-9+141
|
||||
2b3e5caafe3594ea507c37675c4d3086f415dc64 jdk-9+142
|
||||
1fc62b1c629fb80fdaa639d3b59452a184f0d705 jdk-9+143
|
||||
8d337fd6333e28c48aa87880144b840aad82baaf jdk-9+144
|
||||
ff98aa9ec9fae991e426ce5926fc9036d25f5562 jdk-9+145
|
||||
|
@ -1048,7 +1048,9 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
# These tools might not be installed by default,
|
||||
# need hint on how to install them.
|
||||
BASIC_REQUIRE_PROGS(UNZIP, unzip)
|
||||
BASIC_REQUIRE_PROGS(ZIP, zip)
|
||||
# Since zip uses "ZIP" as a environment variable for passing options, we need
|
||||
# to name our variable differently, hence ZIPEXE.
|
||||
BASIC_REQUIRE_PROGS(ZIPEXE, zip)
|
||||
|
||||
# Non-required basic tools
|
||||
|
||||
|
@ -945,7 +945,7 @@ HG
|
||||
READELF
|
||||
OTOOL
|
||||
LDD
|
||||
ZIP
|
||||
ZIPEXE
|
||||
UNZIP
|
||||
TAR_SUPPORTS_TRANSFORM
|
||||
TAR_INCLUDE_PARAM
|
||||
@ -1292,7 +1292,7 @@ CPIO
|
||||
NICE
|
||||
MAKE
|
||||
UNZIP
|
||||
ZIP
|
||||
ZIPEXE
|
||||
LDD
|
||||
OTOOL
|
||||
READELF
|
||||
@ -2236,7 +2236,7 @@ Some influential environment variables:
|
||||
NICE Override default value for NICE
|
||||
MAKE Override default value for MAKE
|
||||
UNZIP Override default value for UNZIP
|
||||
ZIP Override default value for ZIP
|
||||
ZIPEXE Override default value for ZIPEXE
|
||||
LDD Override default value for LDD
|
||||
OTOOL Override default value for OTOOL
|
||||
READELF Override default value for READELF
|
||||
@ -5093,7 +5093,7 @@ VS_SDK_PLATFORM_NAME_2013=
|
||||
#CUSTOM_AUTOCONF_INCLUDE
|
||||
|
||||
# Do not change or remove the following line, it is needed for consistency checks:
|
||||
DATE_WHEN_GENERATED=1479120453
|
||||
DATE_WHEN_GENERATED=1479822431
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@ -21373,13 +21373,15 @@ $as_echo "$tool_specified" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
# Since zip uses "ZIP" as a environment variable for passing options, we need
|
||||
# to name our variable differently, hence ZIPEXE.
|
||||
|
||||
|
||||
|
||||
# Publish this variable in the help.
|
||||
|
||||
|
||||
if [ -z "${ZIP+x}" ]; then
|
||||
if [ -z "${ZIPEXE+x}" ]; then
|
||||
# The variable is not set by user, try to locate tool using the code snippet
|
||||
for ac_prog in zip
|
||||
do
|
||||
@ -21387,12 +21389,12 @@ do
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ZIP+:} false; then :
|
||||
if ${ac_cv_path_ZIPEXE+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ZIP in
|
||||
case $ZIPEXE in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
|
||||
ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
@ -21402,7 +21404,7 @@ do
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
|
||||
ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
@ -21413,30 +21415,30 @@ IFS=$as_save_IFS
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ZIP=$ac_cv_path_ZIP
|
||||
if test -n "$ZIP"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
|
||||
$as_echo "$ZIP" >&6; }
|
||||
ZIPEXE=$ac_cv_path_ZIPEXE
|
||||
if test -n "$ZIPEXE"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5
|
||||
$as_echo "$ZIPEXE" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
test -n "$ZIP" && break
|
||||
test -n "$ZIPEXE" && break
|
||||
done
|
||||
|
||||
else
|
||||
# The variable is set, but is it from the command line or the environment?
|
||||
|
||||
# Try to remove the string !ZIP! from our list.
|
||||
try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ZIP!/}
|
||||
# Try to remove the string !ZIPEXE! from our list.
|
||||
try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!ZIPEXE!/}
|
||||
if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then
|
||||
# If it failed, the variable was not from the command line. Ignore it,
|
||||
# but warn the user (except for BASH, which is always set by the calling BASH).
|
||||
if test "xZIP" != xBASH; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ZIP from the environment. Use command line variables instead." >&5
|
||||
$as_echo "$as_me: WARNING: Ignoring value of ZIP from the environment. Use command line variables instead." >&2;}
|
||||
if test "xZIPEXE" != xBASH; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of ZIPEXE from the environment. Use command line variables instead." >&5
|
||||
$as_echo "$as_me: WARNING: Ignoring value of ZIPEXE from the environment. Use command line variables instead." >&2;}
|
||||
fi
|
||||
# Try to locate tool using the code snippet
|
||||
for ac_prog in zip
|
||||
@ -21445,12 +21447,12 @@ do
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ZIP+:} false; then :
|
||||
if ${ac_cv_path_ZIPEXE+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ZIP in
|
||||
case $ZIPEXE in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
|
||||
ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
@ -21460,7 +21462,7 @@ do
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
|
||||
ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
@ -21471,17 +21473,17 @@ IFS=$as_save_IFS
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ZIP=$ac_cv_path_ZIP
|
||||
if test -n "$ZIP"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
|
||||
$as_echo "$ZIP" >&6; }
|
||||
ZIPEXE=$ac_cv_path_ZIPEXE
|
||||
if test -n "$ZIPEXE"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5
|
||||
$as_echo "$ZIPEXE" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
test -n "$ZIP" && break
|
||||
test -n "$ZIPEXE" && break
|
||||
done
|
||||
|
||||
else
|
||||
@ -21493,31 +21495,31 @@ done
|
||||
CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var"
|
||||
|
||||
# Check if we try to supply an empty value
|
||||
if test "x$ZIP" = x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ZIP= (no value)" >&5
|
||||
$as_echo "$as_me: Setting user supplied tool ZIP= (no value)" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIP" >&5
|
||||
$as_echo_n "checking for ZIP... " >&6; }
|
||||
if test "x$ZIPEXE" = x; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool ZIPEXE= (no value)" >&5
|
||||
$as_echo "$as_me: Setting user supplied tool ZIPEXE= (no value)" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIPEXE" >&5
|
||||
$as_echo_n "checking for ZIPEXE... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
|
||||
$as_echo "disabled" >&6; }
|
||||
else
|
||||
# Check if the provided tool contains a complete path.
|
||||
tool_specified="$ZIP"
|
||||
tool_specified="$ZIPEXE"
|
||||
tool_basename="${tool_specified##*/}"
|
||||
if test "x$tool_basename" = "x$tool_specified"; then
|
||||
# A command without a complete path is provided, search $PATH.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ZIP=$tool_basename" >&5
|
||||
$as_echo "$as_me: Will search for user supplied tool ZIP=$tool_basename" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool ZIPEXE=$tool_basename" >&5
|
||||
$as_echo "$as_me: Will search for user supplied tool ZIPEXE=$tool_basename" >&6;}
|
||||
# Extract the first word of "$tool_basename", so it can be a program name with args.
|
||||
set dummy $tool_basename; ac_word=$2
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
$as_echo_n "checking for $ac_word... " >&6; }
|
||||
if ${ac_cv_path_ZIP+:} false; then :
|
||||
if ${ac_cv_path_ZIPEXE+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
case $ZIP in
|
||||
case $ZIPEXE in
|
||||
[\\/]* | ?:[\\/]*)
|
||||
ac_cv_path_ZIP="$ZIP" # Let the user override the test with a path.
|
||||
ac_cv_path_ZIPEXE="$ZIPEXE" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
@ -21527,7 +21529,7 @@ do
|
||||
test -z "$as_dir" && as_dir=.
|
||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||
ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
|
||||
ac_cv_path_ZIPEXE="$as_dir/$ac_word$ac_exec_ext"
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
break 2
|
||||
fi
|
||||
@ -21538,29 +21540,29 @@ IFS=$as_save_IFS
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ZIP=$ac_cv_path_ZIP
|
||||
if test -n "$ZIP"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
|
||||
$as_echo "$ZIP" >&6; }
|
||||
ZIPEXE=$ac_cv_path_ZIPEXE
|
||||
if test -n "$ZIPEXE"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIPEXE" >&5
|
||||
$as_echo "$ZIPEXE" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
if test "x$ZIP" = x; then
|
||||
if test "x$ZIPEXE" = x; then
|
||||
as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5
|
||||
fi
|
||||
else
|
||||
# Otherwise we believe it is a complete path. Use it as it is.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ZIP=$tool_specified" >&5
|
||||
$as_echo "$as_me: Will use user supplied tool ZIP=$tool_specified" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIP" >&5
|
||||
$as_echo_n "checking for ZIP... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool ZIPEXE=$tool_specified" >&5
|
||||
$as_echo "$as_me: Will use user supplied tool ZIPEXE=$tool_specified" >&6;}
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZIPEXE" >&5
|
||||
$as_echo_n "checking for ZIPEXE... " >&6; }
|
||||
if test ! -x "$tool_specified"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
|
||||
$as_echo "not found" >&6; }
|
||||
as_fn_error $? "User supplied tool ZIP=$tool_specified does not exist or is not executable" "$LINENO" 5
|
||||
as_fn_error $? "User supplied tool ZIPEXE=$tool_specified does not exist or is not executable" "$LINENO" 5
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5
|
||||
$as_echo "$tool_specified" >&6; }
|
||||
@ -21572,8 +21574,8 @@ $as_echo "$tool_specified" >&6; }
|
||||
|
||||
|
||||
|
||||
if test "x$ZIP" = x; then
|
||||
as_fn_error $? "Could not find required tool for ZIP" "$LINENO" 5
|
||||
if test "x$ZIPEXE" = x; then
|
||||
as_fn_error $? "Could not find required tool for ZIPEXE" "$LINENO" 5
|
||||
fi
|
||||
|
||||
|
||||
|
@ -657,8 +657,7 @@ TOUCH:=@TOUCH@
|
||||
UNIQ:=@UNIQ@
|
||||
WC:=@WC@
|
||||
XARGS:=@XARGS@
|
||||
ZIPEXE:=@ZIP@
|
||||
ZIP:=@ZIP@
|
||||
ZIPEXE:=@ZIPEXE@
|
||||
UNZIP:=@UNZIP@
|
||||
MT:=@FIXPATH@ @MT@
|
||||
RC:=@FIXPATH@ @RC@
|
||||
|
@ -372,7 +372,7 @@ compare_general_files() {
|
||||
$CAT $OTHER_DIR/$f | eval "$HTML_FILTER" > $OTHER_FILE &
|
||||
$CAT $THIS_DIR/$f | eval "$HTML_FILTER" > $THIS_FILE &
|
||||
wait
|
||||
elif [ "$f" = "./lib/classlist" ]; then
|
||||
elif [[ "$f" = *"/lib/classlist" ]]; then
|
||||
# The classlist files may have some lines in random order
|
||||
OTHER_FILE=$WORK_DIR/$f.other
|
||||
THIS_FILE=$WORK_DIR/$f.this
|
||||
@ -642,69 +642,18 @@ compare_bin_file() {
|
||||
|
||||
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
unset _NT_SYMBOL_PATH
|
||||
# On windows we need to unzip the debug symbols, if present
|
||||
OTHER_FILE_BASE=${OTHER_FILE/.dll/}
|
||||
OTHER_FILE_BASE=${OTHER_FILE_BASE/.exe/}
|
||||
OTHER_FILE_BASE=${OTHER_FILE_BASE/.cpl/}
|
||||
DIZ_NAME=$(basename $OTHER_FILE_BASE).diz
|
||||
# Some .exe files have the same name as a .dll file. Make sure the exe
|
||||
# files get the right debug symbols.
|
||||
if [ "$NAME" = "java.exe" ] \
|
||||
&& [ -f "$OTHER/support/native/java.base/java_objs/java.diz" ]; then
|
||||
OTHER_DIZ_FILE="$OTHER/support/native/java.base/java_objs/java.diz"
|
||||
elif [ "$NAME" = "jimage.exe" ] \
|
||||
&& [ -f "$OTHER/support/native/jdk.jlink/jimage_objs/jimage.diz" ]; then
|
||||
OTHER_DIZ_FILE="$OTHER/support/modules_cmds/jdk.jlink/jimage.diz"
|
||||
elif [ "$NAME" = "javacpl.exe" ] \
|
||||
&& [ -f "$OTHER/support/native/jdk.plugin/javacpl/javacpl.diz" ]; then
|
||||
OTHER_DIZ_FILE="$OTHER/support/modules_cmds/jdk.deploy.controlpanel/javacpl.diz"
|
||||
elif [ -f "${OTHER_FILE_BASE}.diz" ]; then
|
||||
OTHER_DIZ_FILE=${OTHER_FILE_BASE}.diz
|
||||
else
|
||||
# Some files, jli.dll, appears twice in the image but only one of
|
||||
# them has a diz file next to it.
|
||||
OTHER_DIZ_FILE="$($FIND $OTHER_DIR -name $DIZ_NAME | $SED 1q)"
|
||||
if [ ! -f "$OTHER_DIZ_FILE" ]; then
|
||||
# As a last resort, look for diz file in the whole build output
|
||||
# dir.
|
||||
OTHER_DIZ_FILE="$($FIND $OTHER -name $DIZ_NAME | $SED 1q)"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$OTHER_DIZ_FILE" ]; then
|
||||
$MKDIR -p $FILE_WORK_DIR/other
|
||||
(cd $FILE_WORK_DIR/other ; $UNARCHIVE -o $OTHER_DIZ_FILE)
|
||||
export _NT_SYMBOL_PATH="$FILE_WORK_DIR/other"
|
||||
fi
|
||||
|
||||
THIS_FILE_BASE=${THIS_FILE/.dll/}
|
||||
THIS_FILE_BASE=${THIS_FILE_BASE/.exe/}
|
||||
THIS_FILE_BASE=${THIS_FILE_BASE/.cpl/}
|
||||
# Some .exe files have the same name as a .dll file. Make sure the exe
|
||||
# files get the right debug symbols.
|
||||
if [ "$NAME" = "java.exe" ] \
|
||||
&& [ -f "$THIS/support/native/java.base/java_objs/java.diz" ]; then
|
||||
THIS_DIZ_FILE="$THIS/support/native/java.base/java_objs/java.diz"
|
||||
elif [ "$NAME" = "jimage.exe" ] \
|
||||
&& [ -f "$THIS/support/native/jdk.jlink/jimage_objs/jimage.diz" ]; then
|
||||
THIS_DIZ_FILE="$THIS/support/modules_cmds/jdk.jlink/jimage.diz"
|
||||
elif [ "$NAME" = "javacpl.exe" ] \
|
||||
&& [ -f "$THIS/support/native/jdk.plugin/javacpl/javacpl.diz" ]; then
|
||||
THIS_DIZ_FILE="$THIS/support/modules_cmds/jdk.deploy.controlpanel/javacpl.diz"
|
||||
elif [ -f "${THIS_FILE_BASE}.diz" ]; then
|
||||
THIS_DIZ_FILE=${THIS_FILE/.dll/}.diz
|
||||
else
|
||||
THIS_DIZ_FILE="$($FIND $THIS_DIR -name $DIZ_NAME | $SED 1q)"
|
||||
if [ ! -f "$THIS_DIZ_FILE" ]; then
|
||||
# As a last resort, look for diz file in the whole build output
|
||||
# dir.
|
||||
THIS_DIZ_FILE="$($FIND $THIS -name $DIZ_NAME | $SED 1q)"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$THIS_DIZ_FILE" ]; then
|
||||
$MKDIR -p $FILE_WORK_DIR/this
|
||||
(cd $FILE_WORK_DIR/this ; $UNARCHIVE -o $THIS_DIZ_FILE)
|
||||
export _NT_SYMBOL_PATH="$_NT_SYMBOL_PATH;$FILE_WORK_DIR/this"
|
||||
if [ "$(uname -o)" = "Cygwin" ]; then
|
||||
THIS=$(cygpath -msa $THIS)
|
||||
OTHER=$(cygpath -msa $OTHER)
|
||||
fi
|
||||
# Build an _NT_SYMBOL_PATH that contains all known locations for
|
||||
# pdb files.
|
||||
PDB_DIRS="$(ls -d \
|
||||
{$OTHER,$THIS}/support/modules_{cmds,libs}/{*,*/*} \
|
||||
{$OTHER,$THIS}/support/demos/image/jvmti/*/lib \
|
||||
{$OTHER,$THIS}/support/native/java.base/java_objs \
|
||||
)"
|
||||
export _NT_SYMBOL_PATH="$(echo $PDB_DIRS | tr ' ' ';')"
|
||||
fi
|
||||
|
||||
if [ -z "$SKIP_BIN_DIFF" ]; then
|
||||
|
@ -431,6 +431,8 @@ if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
|
||||
ACCEPTED_JARZIP_CONTENTS="
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.diz
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.pdb
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.map
|
||||
/modules_libs/java.security.jgss/w2k_lsa_auth.dll
|
||||
"
|
||||
|
||||
|
@ -386,3 +386,4 @@ aa053a3faf266c12b4fd5272da431a3e08e4a3e3 jdk-9+136
|
||||
b32f998da32b488ec7c4e9dbb3c750841b48e74d jdk-9+141
|
||||
408c9c621938ca028e20bced0459f815de47eba8 jdk-9+142
|
||||
6211236ef15ec796806357608b1dd1b70c258ece jdk-9+143
|
||||
d4f1dae174098e799c48948e866054c52e11a186 jdk-9+144
|
||||
|
@ -546,3 +546,4 @@ fec31089c2ef5a12dd64f401b0bf2e00f56ee0d0 jdk-9+140
|
||||
160a00bc6ed0af1fdf8418fc65e6bddbbc0c536d jdk-9+141
|
||||
7b48d63dfd6b8e2657288de3d7b1f153dee02d7e jdk-9+142
|
||||
d87d5d430c42342f0320ca7f5cbe0cbd1f9d62ba jdk-9+143
|
||||
6187b582d02aee38341dc8ce4011906e9b364e9f jdk-9+144
|
||||
|
@ -386,3 +386,4 @@ a8d5fe567ae72b4931040e59dd4478363f9004f5 jdk-9+137
|
||||
037c095ba0c345edbeaaab52fda913a76c3930c0 jdk-9+141
|
||||
bdafa0cc34a97a2f8db4847a4efd34b407943591 jdk-9+142
|
||||
ce81d03ad7320dca3d673374c1a33bc0efd9136a jdk-9+143
|
||||
99be33734ff62b75116b1202d49a4d4e1bda4226 jdk-9+144
|
||||
|
@ -389,3 +389,4 @@ ab1d78d395d4cb8be426ff181211da1a4085cf01 jdk-9+134
|
||||
b2c18f755228d1d19a86cd7d5fa1abb6b1495dfb jdk-9+141
|
||||
59101416d90160cfcb4f45dfbccaec15e2c27a29 jdk-9+142
|
||||
1c988e708a06257119d54d8a57e99e3b0f37ff18 jdk-9+143
|
||||
92523c51d6a48b0a83912ba3cc43bc57b8159c2a jdk-9+144
|
||||
|
@ -386,3 +386,4 @@ e93b7ea559759f036c9f69fd2ddaf47bb4e98385 jdk-9+140
|
||||
8d752af5f61d41f226adf2cda72a20faa9ad620a jdk-9+141
|
||||
6ce43dd8e954b452f330dd7a412df5107f7e1923 jdk-9+142
|
||||
8dbc8594f9d5149bf1c22221272284609408227a jdk-9+143
|
||||
efa71dc820eb8bd5a6c9f2f66f39c383ac3ee99d jdk-9+144
|
||||
|
@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2016h
|
||||
tzdata2016i
|
||||
|
@ -87,13 +87,18 @@
|
||||
# Background:
|
||||
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
|
||||
|
||||
# From Steffen Thorsen (2016-10-28):
|
||||
# Australian Antarctica Division informed us that Casey changed time
|
||||
# zone to UTC+11 in "the morning of 22nd October 2016".
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Antarctica/Casey 0 - -00 1969
|
||||
8:00 - +08 2009 Oct 18 2:00
|
||||
11:00 - +11 2010 Mar 5 2:00
|
||||
8:00 - +08 2011 Oct 28 2:00
|
||||
11:00 - +11 2012 Feb 21 17:00u
|
||||
8:00 - +08
|
||||
8:00 - +08 2016 Oct 22
|
||||
11:00 - +11
|
||||
Zone Antarctica/Davis 0 - -00 1957 Jan 13
|
||||
7:00 - +07 1964 Nov
|
||||
0 - -00 1969 Feb
|
||||
|
@ -794,9 +794,19 @@ Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1
|
||||
###############################################################################
|
||||
|
||||
# Cyprus
|
||||
#
|
||||
|
||||
# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT.
|
||||
# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
|
||||
|
||||
# From Paul Eggert (2016-09-09):
|
||||
# Yesterday's Cyprus Mail reports that Northern Cyprus followed Turkey's
|
||||
# lead and switched from +02/+03 to +03 year-round.
|
||||
# http://cyprus-mail.com/2016/09/08/two-time-zones-cyprus-turkey-will-not-turn-clocks-back-next-month/
|
||||
#
|
||||
# From Even Scharning (2016-10-31):
|
||||
# Looks like the time zone split in Cyprus went through last night.
|
||||
# http://cyprus-mail.com/2016/10/30/cyprus-new-division-two-time-zones-now-reality/
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
|
||||
Rule Cyprus 1975 only - Oct 12 0:00 0 -
|
||||
@ -811,7 +821,10 @@ Rule Cyprus 1981 1998 - Mar lastSun 0:00 1:00 S
|
||||
Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14
|
||||
2:00 Cyprus EE%sT 1998 Sep
|
||||
2:00 EUAsia EE%sT
|
||||
# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
|
||||
Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
|
||||
2:00 Cyprus EE%sT 1998 Sep
|
||||
2:00 EUAsia EE%sT 2016 Sep 8
|
||||
3:00 - +03
|
||||
|
||||
# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
|
||||
# However, for various reasons many users expect to find it under Europe.
|
||||
|
@ -725,11 +725,13 @@ Rule Tonga 1999 only - Oct 7 2:00s 1:00 S
|
||||
Rule Tonga 2000 only - Mar 19 2:00s 0 -
|
||||
Rule Tonga 2000 2001 - Nov Sun>=1 2:00 1:00 S
|
||||
Rule Tonga 2001 2002 - Jan lastSun 2:00 0 -
|
||||
Rule Tonga 2016 max - Nov Sun>=1 2:00 1:00 S
|
||||
Rule Tonga 2017 max - Jan Sun>=15 3:00 0 -
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Pacific/Tongatapu 12:19:20 - LMT 1901
|
||||
12:20 - TOT 1941 # Tonga Time
|
||||
13:00 - TOT 1999
|
||||
13:00 Tonga TO%sT
|
||||
12:20 - +1220 1941
|
||||
13:00 - +13 1999
|
||||
13:00 Tonga +13/+14
|
||||
|
||||
# Tuvalu
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
@ -1735,9 +1737,17 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
|
||||
# of January the standard time in the Kingdom shall be moved backward by one
|
||||
# hour to 1:00am.
|
||||
|
||||
# From Pulu 'Anau (2002-11-05):
|
||||
# From Pulu ʻAnau (2002-11-05):
|
||||
# The law was for 3 years, supposedly to get renewed. It wasn't.
|
||||
|
||||
# From Pulu ʻAnau (2016-10-27):
|
||||
# http://mic.gov.to/news-today/press-releases/6375-daylight-saving-set-to-run-from-6-november-2016-to-15-january-2017
|
||||
# Cannot find anyone who knows the rules, has seen the duration or has seen
|
||||
# the cabinet decision, but it appears we are following Fiji's rule set.
|
||||
#
|
||||
# From Tim Parenti (2016-10-26):
|
||||
# Assume Tonga will observe DST from the first Sunday in November at 02:00
|
||||
# through the third Sunday in January at 03:00, like Fiji, for now.
|
||||
|
||||
# Wake
|
||||
|
||||
|
@ -1523,73 +1523,84 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908
|
||||
# But these events all occurred before the 1970 cutoff,
|
||||
# so record only the time in Rome.
|
||||
#
|
||||
# From Paul Eggert (2006-03-22):
|
||||
# For Italian DST we have three sources: Shanks & Pottenger, Whitman, and
|
||||
# F. Pollastri
|
||||
# Day-light Saving Time in Italy (2006-02-03)
|
||||
# http://toi.iriti.cnr.it/uk/ienitlt.html
|
||||
# ('FP' below), taken from an Italian National Electrotechnical Institute
|
||||
# publication. When the three sources disagree, guess who's right, as follows:
|
||||
# From Michael Deckers (2016-10-24):
|
||||
# http://www.ac-ilsestante.it/MERIDIANE/ora_legale quotes a law of 1893-08-10
|
||||
# ... [translated as] "The preceding dispositions will enter into
|
||||
# force at the instant at which, according to the time specified in
|
||||
# the 1st article, the 1st of November 1893 will begin...."
|
||||
#
|
||||
# year FP Shanks&P. (S) Whitman (W) Go with:
|
||||
# 1916 06-03 06-03 24:00 06-03 00:00 FP & W
|
||||
# 09-30 09-30 24:00 09-30 01:00 FP; guess 24:00s
|
||||
# 1917 04-01 03-31 24:00 03-31 00:00 FP & S
|
||||
# 09-30 09-29 24:00 09-30 01:00 FP & W
|
||||
# 1918 03-09 03-09 24:00 03-09 00:00 FP & S
|
||||
# 10-06 10-05 24:00 10-06 01:00 FP & W
|
||||
# 1919 03-01 03-01 24:00 03-01 00:00 FP & S
|
||||
# 10-04 10-04 24:00 10-04 01:00 FP; guess 24:00s
|
||||
# 1920 03-20 03-20 24:00 03-20 00:00 FP & S
|
||||
# 09-18 09-18 24:00 10-01 01:00 FP; guess 24:00s
|
||||
# 1944 04-02 04-03 02:00 S (see C-Eur)
|
||||
# 09-16 10-02 03:00 FP; guess 24:00s
|
||||
# 1945 09-14 09-16 24:00 FP; guess 24:00s
|
||||
# 1970 05-21 05-31 00:00 S
|
||||
# 09-20 09-27 00:00 S
|
||||
# From Pierpaolo Bernardi (2016-10-20):
|
||||
# The authoritative source for time in Italy is the national metrological
|
||||
# institute, which has a summary page of historical DST data at
|
||||
# http://www.inrim.it/res/tf/ora_legale_i.shtml
|
||||
# (2016-10-24):
|
||||
# http://www.renzobaldini.it/le-ore-legali-in-italia/
|
||||
# has still different data for 1944. It divides Italy in two, as
|
||||
# there were effectively two governments at the time, north of Gothic
|
||||
# Line German controlled territory, official government RSI, and south
|
||||
# of the Gothic Line, controlled by allied armies.
|
||||
#
|
||||
# From Brian Inglis (2016-10-23):
|
||||
# Viceregal LEGISLATIVE DECREE. 14 September 1944, no. 219.
|
||||
# Restoration of Standard Time. (044U0219) (OJ 62 of 30.9.1944) ...
|
||||
# Given the R. law decreed on 1944-03-29, no. 92, by which standard time is
|
||||
# advanced to sixty minutes later starting at hour two on 1944-04-02; ...
|
||||
# Starting at hour three on the date 1944-09-17 standard time will be resumed.
|
||||
#
|
||||
# From Paul Eggert (2016-10-27):
|
||||
# Go with INRiM for DST rules, except as corrected by Inglis for 1944
|
||||
# for the Kingdom of Italy. This is consistent with Renzo Baldini.
|
||||
# Model Rome's occupation by using using C-Eur rules from 1943-09-10
|
||||
# to 1944-06-04; although Rome was an open city during this period, it
|
||||
# was effectively controlled by Germany.
|
||||
#
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Italy 1916 only - Jun 3 0:00s 1:00 S
|
||||
Rule Italy 1916 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1917 only - Apr 1 0:00s 1:00 S
|
||||
Rule Italy 1917 only - Sep 30 0:00s 0 -
|
||||
Rule Italy 1918 only - Mar 10 0:00s 1:00 S
|
||||
Rule Italy 1918 1919 - Oct Sun>=1 0:00s 0 -
|
||||
Rule Italy 1919 only - Mar 2 0:00s 1:00 S
|
||||
Rule Italy 1920 only - Mar 21 0:00s 1:00 S
|
||||
Rule Italy 1920 only - Sep 19 0:00s 0 -
|
||||
Rule Italy 1940 only - Jun 15 0:00s 1:00 S
|
||||
Rule Italy 1944 only - Sep 17 0:00s 0 -
|
||||
Rule Italy 1945 only - Apr 2 2:00 1:00 S
|
||||
Rule Italy 1945 only - Sep 15 0:00s 0 -
|
||||
Rule Italy 1946 only - Mar 17 2:00s 1:00 S
|
||||
Rule Italy 1946 only - Oct 6 2:00s 0 -
|
||||
Rule Italy 1947 only - Mar 16 0:00s 1:00 S
|
||||
Rule Italy 1947 only - Oct 5 0:00s 0 -
|
||||
Rule Italy 1948 only - Feb 29 2:00s 1:00 S
|
||||
Rule Italy 1948 only - Oct 3 2:00s 0 -
|
||||
Rule Italy 1966 1968 - May Sun>=22 0:00 1:00 S
|
||||
Rule Italy 1966 1969 - Sep Sun>=22 0:00 0 -
|
||||
Rule Italy 1969 only - Jun 1 0:00 1:00 S
|
||||
Rule Italy 1970 only - May 31 0:00 1:00 S
|
||||
Rule Italy 1970 only - Sep lastSun 0:00 0 -
|
||||
Rule Italy 1971 1972 - May Sun>=22 0:00 1:00 S
|
||||
Rule Italy 1971 only - Sep lastSun 1:00 0 -
|
||||
Rule Italy 1972 only - Oct 1 0:00 0 -
|
||||
Rule Italy 1973 only - Jun 3 0:00 1:00 S
|
||||
Rule Italy 1973 1974 - Sep lastSun 0:00 0 -
|
||||
Rule Italy 1974 only - May 26 0:00 1:00 S
|
||||
Rule Italy 1975 only - Jun 1 0:00s 1:00 S
|
||||
Rule Italy 1975 1977 - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1976 only - May 30 0:00s 1:00 S
|
||||
Rule Italy 1977 1979 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1978 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1979 only - Sep 30 0:00s 0 -
|
||||
Rule Italy 1916 only - Jun 3 24:00 1:00 S
|
||||
Rule Italy 1916 1917 - Sep 30 24:00 0 -
|
||||
Rule Italy 1917 only - Mar 31 24:00 1:00 S
|
||||
Rule Italy 1918 only - Mar 9 24:00 1:00 S
|
||||
Rule Italy 1918 only - Oct 6 24:00 0 -
|
||||
Rule Italy 1919 only - Mar 1 24:00 1:00 S
|
||||
Rule Italy 1919 only - Oct 4 24:00 0 -
|
||||
Rule Italy 1920 only - Mar 20 24:00 1:00 S
|
||||
Rule Italy 1920 only - Sep 18 24:00 0 -
|
||||
Rule Italy 1940 only - Jun 14 24:00 1:00 S
|
||||
Rule Italy 1942 only - Nov 2 2:00s 0 -
|
||||
Rule Italy 1943 only - Mar 29 2:00s 1:00 S
|
||||
Rule Italy 1943 only - Oct 4 2:00s 0 -
|
||||
Rule Italy 1944 only - Apr 2 2:00s 1:00 S
|
||||
Rule Italy 1944 only - Sep 17 2:00s 0 -
|
||||
Rule Italy 1945 only - Apr 2 2:00 1:00 S
|
||||
Rule Italy 1945 only - Sep 15 1:00 0 -
|
||||
Rule Italy 1946 only - Mar 17 2:00s 1:00 S
|
||||
Rule Italy 1946 only - Oct 6 2:00s 0 -
|
||||
Rule Italy 1947 only - Mar 16 0:00s 1:00 S
|
||||
Rule Italy 1947 only - Oct 5 0:00s 0 -
|
||||
Rule Italy 1948 only - Feb 29 2:00s 1:00 S
|
||||
Rule Italy 1948 only - Oct 3 2:00s 0 -
|
||||
Rule Italy 1966 1968 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1966 only - Sep 24 24:00 0 -
|
||||
Rule Italy 1967 1969 - Sep Sun>=22 0:00s 0 -
|
||||
Rule Italy 1969 only - Jun 1 0:00s 1:00 S
|
||||
Rule Italy 1970 only - May 31 0:00s 1:00 S
|
||||
Rule Italy 1970 only - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1971 1972 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1971 only - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1972 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1973 only - Jun 3 0:00s 1:00 S
|
||||
Rule Italy 1973 1974 - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1974 only - May 26 0:00s 1:00 S
|
||||
Rule Italy 1975 only - Jun 1 0:00s 1:00 S
|
||||
Rule Italy 1975 1977 - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1976 only - May 30 0:00s 1:00 S
|
||||
Rule Italy 1977 1979 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1978 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1979 only - Sep 30 0:00s 0 -
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Europe/Rome 0:49:56 - LMT 1866 Sep 22
|
||||
0:49:56 - RMT 1893 Nov 1 0:00s # Rome Mean
|
||||
1:00 Italy CE%sT 1942 Nov 2 2:00s
|
||||
1:00 C-Eur CE%sT 1944 Jul
|
||||
0:49:56 - RMT 1893 Oct 31 23:49:56 # Rome Mean
|
||||
1:00 Italy CE%sT 1943 Sep 10
|
||||
1:00 C-Eur CE%sT 1944 Jun 4
|
||||
1:00 Italy CE%sT 1980
|
||||
1:00 EU CE%sT
|
||||
|
||||
@ -1788,6 +1799,10 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
|
||||
# See Europe/Belgrade.
|
||||
|
||||
# Malta
|
||||
#
|
||||
# From Paul Eggert (2016-10-21):
|
||||
# Assume 1900-1972 was like Rome, overriding Shanks.
|
||||
#
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Malta 1973 only - Mar 31 0:00s 1:00 S
|
||||
Rule Malta 1973 only - Sep 29 0:00s 0 -
|
||||
@ -1798,8 +1813,6 @@ Rule Malta 1975 1980 - Sep Sun>=15 2:00 0 -
|
||||
Rule Malta 1980 only - Mar 31 2:00 1:00 S
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
|
||||
1:00 Italy CE%sT 1942 Nov 2 2:00s
|
||||
1:00 C-Eur CE%sT 1945 Apr 2 2:00s
|
||||
1:00 Italy CE%sT 1973 Mar 31
|
||||
1:00 Malta CE%sT 1981
|
||||
1:00 EU CE%sT
|
||||
@ -1931,7 +1944,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
|
||||
# Amsterdam mean time.
|
||||
|
||||
# The data entries before 1945 are taken from
|
||||
# http://www.staff.science.uu.nl/~gent0113/idl/idl.htm
|
||||
# http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
|
||||
|
@ -175,7 +175,8 @@ CU +2308-08222 America/Havana
|
||||
CV +1455-02331 Atlantic/Cape_Verde
|
||||
CW +1211-06900 America/Curacao
|
||||
CX -1025+10543 Indian/Christmas
|
||||
CY +3510+03322 Asia/Nicosia
|
||||
CY +3510+03322 Asia/Nicosia Cyprus (most areas)
|
||||
CY +3507+03357 Asia/Famagusta Northern Cyprus
|
||||
CZ +5005+01426 Europe/Prague
|
||||
DE +5230+01322 Europe/Berlin Germany (most areas)
|
||||
DE +4742+00841 Europe/Busingen Busingen
|
||||
|
@ -28,14 +28,12 @@ include LauncherCommon.gmk
|
||||
$(eval $(call SetupBuildLauncher, javac, \
|
||||
MAIN_CLASS := com.sun.tools.javac.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, javah, \
|
||||
MAIN_CLASS := com.sun.tools.javah.Main, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, serialver, \
|
||||
@ -48,8 +46,7 @@ ifeq ($(ENABLE_SJAVAC), yes)
|
||||
# into any real images
|
||||
$(eval $(call SetupBuildLauncher, sjavac, \
|
||||
MAIN_CLASS := com.sun.tools.sjavac.Main, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
OUTPUT_DIR := $(JDK_OUTPUTDIR)/bin, \
|
||||
))
|
||||
endif
|
||||
|
@ -28,6 +28,5 @@ include LauncherCommon.gmk
|
||||
$(eval $(call SetupBuildLauncher, javadoc, \
|
||||
MAIN_CLASS := jdk.javadoc.internal.tool.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
@ -27,18 +27,15 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, javap, \
|
||||
MAIN_CLASS := com.sun.tools.javap.Main, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jdeps, \
|
||||
MAIN_CLASS := com.sun.tools.jdeps.Main, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jdeprscan, \
|
||||
MAIN_CLASS := com.sun.tools.jdeprscan.Main, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
@ -34,13 +34,11 @@ $(eval $(call SetupBuildLauncher, jlink,\
|
||||
MAIN_CLASS := jdk.tools.jlink.internal.Main, \
|
||||
JAVA_ARGS := --add-modules ALL-DEFAULT, \
|
||||
CFLAGS := -DENABLE_ARG_FILES \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jmod,\
|
||||
MAIN_CLASS := jdk.tools.jmod.Main, \
|
||||
CFLAGS := -DENABLE_ARG_FILES \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
-DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
@ -27,6 +27,5 @@ include LauncherCommon.gmk
|
||||
|
||||
$(eval $(call SetupBuildLauncher, jshell, \
|
||||
MAIN_CLASS := jdk.internal.jshell.tool.JShellTool, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS \
|
||||
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE, \
|
||||
CFLAGS := -DEXPAND_CLASSPATH_WILDCARDS, \
|
||||
))
|
||||
|
@ -77,13 +77,13 @@ SUNWprivate_1.1 {
|
||||
Java_java_io_FileDescriptor_initIDs;
|
||||
Java_java_io_FileDescriptor_sync;
|
||||
Java_java_io_FileDescriptor_getAppend;
|
||||
Java_java_io_FileInputStream_available;
|
||||
Java_java_io_FileInputStream_available0;
|
||||
Java_java_io_FileInputStream_close0;
|
||||
Java_java_io_FileInputStream_initIDs;
|
||||
Java_java_io_FileInputStream_open0;
|
||||
Java_java_io_FileInputStream_read0;
|
||||
Java_java_io_FileInputStream_readBytes;
|
||||
Java_java_io_FileInputStream_skip;
|
||||
Java_java_io_FileInputStream_skip0;
|
||||
Java_java_io_FileOutputStream_close0;
|
||||
Java_java_io_FileOutputStream_initIDs;
|
||||
Java_java_io_FileOutputStream_open0;
|
||||
|
@ -44,7 +44,7 @@ text: .text%Java_java_io_FileInputStream_open0;
|
||||
text: .text%fileOpen;
|
||||
text: .text%Java_java_io_FileInputStream_readBytes;
|
||||
text: .text%readBytes;
|
||||
text: .text%Java_java_io_FileInputStream_available;
|
||||
text: .text%Java_java_io_FileInputStream_available0;
|
||||
text: .text%Java_java_io_FileInputStream_close0;
|
||||
text: .text%Java_java_lang_System_mapLibraryName;
|
||||
text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
|
||||
|
@ -48,7 +48,7 @@ text: .text%Java_java_io_FileInputStream_open0;
|
||||
text: .text%fileOpen;
|
||||
text: .text%Java_java_io_FileInputStream_readBytes;
|
||||
text: .text%readBytes;
|
||||
text: .text%Java_java_io_FileInputStream_available;
|
||||
text: .text%Java_java_io_FileInputStream_available0;
|
||||
text: .text%Java_java_io_FileInputStream_close0;
|
||||
text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
|
||||
text: .text%Java_java_io_UnixFileSystem_list;
|
||||
|
@ -76,7 +76,7 @@ text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_Pri
|
||||
text: .text%JNU_GetEnv;
|
||||
text: .text%Java_java_io_UnixFileSystem_checkAccess;
|
||||
text: .text%Java_sun_reflect_NativeMethodAccessorImpl_invoke0;
|
||||
text: .text%Java_java_io_FileInputStream_available;
|
||||
text: .text%Java_java_io_FileInputStream_available0;
|
||||
text: .text%Java_java_lang_reflect_Array_newArray;
|
||||
text: .text%Java_java_lang_StackTraceElement_initStackTraceElements;
|
||||
text: .text%Java_java_lang_System_identityHashCode;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -118,7 +118,7 @@ class EPollArrayWrapper {
|
||||
// file descriptors higher than MAX_UPDATE_ARRAY_SIZE (unlimited case at
|
||||
// least) then the update is stored in a map.
|
||||
private final byte[] eventsLow = new byte[MAX_UPDATE_ARRAY_SIZE];
|
||||
private Map<Integer,Byte> eventsHigh;
|
||||
private final Map<Integer,Byte> eventsHigh = new HashMap<>();
|
||||
|
||||
// Used by release and updateRegistrations to track whether a file
|
||||
// descriptor is registered with epoll.
|
||||
@ -133,10 +133,6 @@ class EPollArrayWrapper {
|
||||
int allocationSize = NUM_EPOLLEVENTS * SIZE_EPOLLEVENT;
|
||||
pollArray = new AllocatedNativeObject(allocationSize, true);
|
||||
pollArrayAddress = pollArray.address();
|
||||
|
||||
// eventHigh needed when using file descriptors > 64k
|
||||
if (OPEN_MAX > MAX_UPDATE_ARRAY_SIZE)
|
||||
eventsHigh = new HashMap<>();
|
||||
}
|
||||
|
||||
void initInterrupt(int fd0, int fd1) {
|
||||
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -922,11 +922,6 @@ void SetJavaLauncherPlatformProps() {
|
||||
/* Linux only */
|
||||
}
|
||||
|
||||
jboolean
|
||||
ServerClassMachine(void) {
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
static JavaVM* jvmInstance = NULL;
|
||||
static jboolean sameThread = JNI_FALSE; /* start VM in current thread */
|
||||
|
||||
|
@ -280,7 +280,11 @@ class FileInputStream extends InputStream
|
||||
* @exception IOException if n is negative, if the stream does not
|
||||
* support seek, or if an I/O error occurs.
|
||||
*/
|
||||
public native long skip(long n) throws IOException;
|
||||
public long skip(long n) throws IOException {
|
||||
return skip0(n);
|
||||
}
|
||||
|
||||
private native long skip0(long n) throws IOException;
|
||||
|
||||
/**
|
||||
* Returns an estimate of the number of remaining bytes that can be read (or
|
||||
@ -299,7 +303,11 @@ class FileInputStream extends InputStream
|
||||
* @exception IOException if this file input stream has been closed by calling
|
||||
* {@code close} or an I/O error occurs.
|
||||
*/
|
||||
public native int available() throws IOException;
|
||||
public int available() throws IOException {
|
||||
return available0();
|
||||
}
|
||||
|
||||
private native int available0() throws IOException;
|
||||
|
||||
/**
|
||||
* Closes this file input stream and releases any system resources
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -335,15 +335,19 @@ public final class NetworkInterface {
|
||||
* {@link #getInetAddresses()} to obtain all IP addresses for this node
|
||||
*
|
||||
* @return an Enumeration of NetworkInterfaces found on this machine
|
||||
* @exception SocketException if an I/O error occurs.
|
||||
* @exception SocketException if an I/O error occurs,
|
||||
* or if the platform does not have at least one configured
|
||||
* network interface.
|
||||
* @see #networkInterfaces()
|
||||
*/
|
||||
public static Enumeration<NetworkInterface> getNetworkInterfaces()
|
||||
throws SocketException {
|
||||
NetworkInterface[] netifs = getAll();
|
||||
assert netifs != null && netifs.length > 0;
|
||||
|
||||
return enumerationFromArray(netifs);
|
||||
if (netifs != null && netifs.length > 0) {
|
||||
return enumerationFromArray(netifs);
|
||||
} else {
|
||||
throw new SocketException("No network interfaces configured");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -361,15 +365,19 @@ public final class NetworkInterface {
|
||||
* }</pre>
|
||||
*
|
||||
* @return a Stream of NetworkInterfaces found on this machine
|
||||
* @exception SocketException if an I/O error occurs.
|
||||
* @exception SocketException if an I/O error occurs,
|
||||
* or if the platform does not have at least one configured
|
||||
* network interface.
|
||||
* @since 9
|
||||
*/
|
||||
public static Stream<NetworkInterface> networkInterfaces()
|
||||
throws SocketException {
|
||||
NetworkInterface[] netifs = getAll();
|
||||
assert netifs != null && netifs.length > 0;
|
||||
|
||||
return streamFromArray(netifs);
|
||||
if (netifs != null && netifs.length > 0) {
|
||||
return streamFromArray(netifs);
|
||||
} else {
|
||||
throw new SocketException("No network interfaces configured");
|
||||
}
|
||||
}
|
||||
|
||||
private static <T> Enumeration<T> enumerationFromArray(T[] a) {
|
||||
|
@ -214,20 +214,20 @@ public final class Optional<T> {
|
||||
* @apiNote
|
||||
* This method supports post-processing on {@code Optional} values, without
|
||||
* the need to explicitly check for a return status. For example, the
|
||||
* following code traverses a stream of file names, selects one that has not
|
||||
* yet been processed, and then opens that file, returning an
|
||||
* {@code Optional<FileInputStream>}:
|
||||
* following code traverses a stream of URIs, selects one that has not
|
||||
* yet been processed, and creates a path from that URI, returning
|
||||
* an {@code Optional<Path>}:
|
||||
*
|
||||
* <pre>{@code
|
||||
* Optional<FileInputStream> fis =
|
||||
* names.stream().filter(name -> !isProcessedYet(name))
|
||||
* Optional<Path> p =
|
||||
* uris.stream().filter(uri -> !isProcessedYet(uri))
|
||||
* .findFirst()
|
||||
* .map(name -> new FileInputStream(name));
|
||||
* .map(Paths::get);
|
||||
* }</pre>
|
||||
*
|
||||
* Here, {@code findFirst} returns an {@code Optional<String>}, and then
|
||||
* {@code map} returns an {@code Optional<FileInputStream>} for the desired
|
||||
* file if one exists.
|
||||
* Here, {@code findFirst} returns an {@code Optional<URI>}, and then
|
||||
* {@code map} returns an {@code Optional<Path>} for the desired
|
||||
* URI if one exists.
|
||||
*
|
||||
* @param mapper the mapping function to apply to a value, if present
|
||||
* @param <U> The type of the value returned from the mapping function
|
||||
|
@ -192,9 +192,10 @@ class JarFile extends ZipFile {
|
||||
public static final String MANIFEST_NAME = META_INF + "MANIFEST.MF";
|
||||
|
||||
/**
|
||||
* The version that represents the unversioned configuration of a multi-release jar file.
|
||||
* Returns the version that represents the unversioned configuration of a
|
||||
* multi-release jar file.
|
||||
*
|
||||
* @return Runtime.Version that represents the unversioned configuration
|
||||
* @return the version that represents the unversioned configuration
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
@ -203,13 +204,16 @@ class JarFile extends ZipFile {
|
||||
}
|
||||
|
||||
/**
|
||||
* The version that represents the effective runtime versioned configuration of a
|
||||
* multi-release jar file. In most cases, {@code runtimeVersion()} is equal to
|
||||
* {@code Runtime.version()}. However, if the {@code jdk.util.jar.version} property is set,
|
||||
* {@code runtimeVersion()} is derived from that property and may not be equal to
|
||||
* {@code Runtime.version()}.
|
||||
* Returns the version that represents the effective runtime versioned
|
||||
* configuration of a multi-release jar file.
|
||||
* <p>
|
||||
* By default the major version number of the returned {@code Version} will
|
||||
* be equal to the major version number of {@code Runtime.version()}.
|
||||
* However, if the {@code jdk.util.jar.version} property is set, the
|
||||
* returned {@code Version} is derived from that property and major version
|
||||
* numbers may not be equal.
|
||||
*
|
||||
* @return Runtime.Version that represents the runtime versioned configuration
|
||||
* @return the version that represents the runtime versioned configuration
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
@ -335,6 +339,10 @@ class JarFile extends ZipFile {
|
||||
|
||||
/**
|
||||
* Returns the maximum version used when searching for versioned entries.
|
||||
* <p>
|
||||
* If this {@code JarFile} is not a multi-release jar file or is not
|
||||
* configured to be processed as such, then the version returned will be the
|
||||
* same as that returned from {@link #baseVersion()}.
|
||||
*
|
||||
* @return the maximum version
|
||||
* @since 9
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -139,8 +139,7 @@ public final class LauncherHelper {
|
||||
* line entirely.
|
||||
*/
|
||||
static void showSettings(boolean printToStderr, String optionFlag,
|
||||
long initialHeapSize, long maxHeapSize, long stackSize,
|
||||
boolean isServer) {
|
||||
long initialHeapSize, long maxHeapSize, long stackSize) {
|
||||
|
||||
initOutput(printToStderr);
|
||||
String opts[] = optionFlag.split(":");
|
||||
@ -149,8 +148,7 @@ public final class LauncherHelper {
|
||||
: "all";
|
||||
switch (optStr) {
|
||||
case "vm":
|
||||
printVmSettings(initialHeapSize, maxHeapSize,
|
||||
stackSize, isServer);
|
||||
printVmSettings(initialHeapSize, maxHeapSize, stackSize);
|
||||
break;
|
||||
case "properties":
|
||||
printProperties();
|
||||
@ -159,8 +157,7 @@ public final class LauncherHelper {
|
||||
printLocale();
|
||||
break;
|
||||
default:
|
||||
printVmSettings(initialHeapSize, maxHeapSize, stackSize,
|
||||
isServer);
|
||||
printVmSettings(initialHeapSize, maxHeapSize, stackSize);
|
||||
printProperties();
|
||||
printLocale();
|
||||
break;
|
||||
@ -172,7 +169,7 @@ public final class LauncherHelper {
|
||||
*/
|
||||
private static void printVmSettings(
|
||||
long initialHeapSize, long maxHeapSize,
|
||||
long stackSize, boolean isServer) {
|
||||
long stackSize) {
|
||||
|
||||
ostream.println(VM_SETTINGS);
|
||||
if (stackSize != 0L) {
|
||||
@ -190,8 +187,6 @@ public final class LauncherHelper {
|
||||
ostream.println(INDENT + "Max. Heap Size (Estimated): "
|
||||
+ SizePrefix.scaleValue(Runtime.getRuntime().maxMemory()));
|
||||
}
|
||||
ostream.println(INDENT + "Ergonomics Machine Class: "
|
||||
+ ((isServer) ? "server" : "client"));
|
||||
ostream.println(INDENT + "Using VM: "
|
||||
+ System.getProperty("java.vm.name"));
|
||||
ostream.println();
|
||||
@ -378,18 +373,6 @@ public final class LauncherHelper {
|
||||
vm1, vm2));
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the vm Ergo message to the header, already created.
|
||||
* initHelpSystem must be called before using this method.
|
||||
*/
|
||||
static void appendVmErgoMessage(boolean isServerClass, String vm) {
|
||||
outBuf = outBuf.append(getLocalizedMessage("java.launcher.ergo.message1",
|
||||
vm));
|
||||
outBuf = (isServerClass) ? outBuf.append(",\n")
|
||||
.append(getLocalizedMessage("java.launcher.ergo.message2"))
|
||||
.append("\n\n") : outBuf.append(".\n\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the last invariant part to the previously created messages,
|
||||
* and finishes up the printing to the desired output stream.
|
||||
|
@ -35,9 +35,6 @@ java.launcher.opt.datamodel =\ -d{0}\t Deprecated, will be removed in a fut
|
||||
java.launcher.opt.vmselect =\ {0}\t to select the "{1}" VM\n
|
||||
java.launcher.opt.hotspot =\ {0}\t is a synonym for the "{1}" VM [deprecated]\n
|
||||
|
||||
java.launcher.ergo.message1 =\ The default VM is {0}
|
||||
java.launcher.ergo.message2 =\ because you are running on a server-class machine.\n
|
||||
|
||||
# Translators please note do not translate the options themselves
|
||||
java.launcher.opt.footer =\ -cp <class search path of directories and zip/jar files>\n\
|
||||
\ -classpath <class search path of directories and zip/jar files>\n\
|
||||
|
@ -740,7 +740,7 @@ class RevocationChecker extends PKIXRevocationChecker {
|
||||
}
|
||||
|
||||
response = OCSP.check(Collections.singletonList(certId),
|
||||
responderURI, issuerInfo, responderCert, params.date(),
|
||||
responderURI, issuerInfo, responderCert, null,
|
||||
ocspExtensions);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -257,7 +257,13 @@ final class RSAClientKeyExchange extends HandshakeMessage {
|
||||
|
||||
@Override
|
||||
void print(PrintStream s) throws IOException {
|
||||
s.println("*** ClientKeyExchange, RSA PreMasterSecret, " +
|
||||
protocolVersion);
|
||||
String version = "version not available/extractable";
|
||||
|
||||
byte[] ba = preMaster.getEncoded();
|
||||
if (ba != null && ba.length >= 2) {
|
||||
version = ProtocolVersion.valueOf(ba[0], ba[1]).name;
|
||||
}
|
||||
|
||||
s.println("*** ClientKeyExchange, RSA PreMasterSecret, " + version);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -84,8 +84,10 @@ import sun.security.util.Pem;
|
||||
import sun.security.x509.*;
|
||||
|
||||
import static java.security.KeyStore.*;
|
||||
import java.security.Security;
|
||||
import static sun.security.tools.keytool.Main.Command.*;
|
||||
import static sun.security.tools.keytool.Main.Option.*;
|
||||
import sun.security.util.DisabledAlgorithmConstraints;
|
||||
|
||||
/**
|
||||
* This tool manages keystores.
|
||||
@ -2428,6 +2430,10 @@ public final class Main {
|
||||
|
||||
private void doPrintCert(final PrintStream out) throws Exception {
|
||||
if (jarfile != null) {
|
||||
// reset "jdk.certpath.disabledAlgorithms" security property
|
||||
// to be able to read jars which were signed with weak algorithms
|
||||
Security.setProperty(DisabledAlgorithmConstraints.PROPERTY_JAR_DISABLED_ALGS, "");
|
||||
|
||||
JarFile jf = new JarFile(jarfile, true);
|
||||
Enumeration<JarEntry> entries = jf.entries();
|
||||
Set<CodeSigner> ss = new HashSet<>();
|
||||
|
@ -46,8 +46,12 @@ public abstract class AbstractAlgorithmConstraints
|
||||
// Get algorithm constraints from the specified security property.
|
||||
static String[] getAlgorithms(String propertyName) {
|
||||
String property = AccessController.doPrivileged(
|
||||
(PrivilegedAction<String>) () -> Security.getProperty(
|
||||
propertyName));
|
||||
new PrivilegedAction<String>() {
|
||||
@Override
|
||||
public String run() {
|
||||
return Security.getProperty(propertyName);
|
||||
}
|
||||
});
|
||||
|
||||
String[] algorithmsInProperty = null;
|
||||
if (property != null && !property.isEmpty()) {
|
||||
|
@ -34,20 +34,18 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class AlgorithmDecomposer {
|
||||
|
||||
private static final Pattern transPattern = Pattern.compile("/");
|
||||
|
||||
// '(?<!padd)in': match 'in' but not preceded with 'padd'.
|
||||
private static final Pattern pattern =
|
||||
private static final Pattern PATTERN =
|
||||
Pattern.compile("with|and|(?<!padd)in", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
private static Set<String> decomposeImpl(String algorithm) {
|
||||
Set<String> elements = new HashSet<>();
|
||||
|
||||
// algorithm/mode/padding
|
||||
String[] transTockens = transPattern.split(algorithm);
|
||||
String[] transTokens = algorithm.split("/");
|
||||
|
||||
Set<String> elements = new HashSet<>();
|
||||
for (String transTocken : transTockens) {
|
||||
if (transTocken == null || transTocken.length() == 0) {
|
||||
for (String transToken : transTokens) {
|
||||
if (transToken == null || transToken.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -57,10 +55,10 @@ public class AlgorithmDecomposer {
|
||||
// <digest>with<encryption>
|
||||
// <digest>with<encryption>and<mgf>
|
||||
// <digest>with<encryption>in<format>
|
||||
String[] tokens = pattern.split(transTocken);
|
||||
String[] tokens = PATTERN.split(transToken);
|
||||
|
||||
for (String token : tokens) {
|
||||
if (token == null || token.length() == 0) {
|
||||
if (token == null || token.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class AnchorCertificates {
|
||||
try {
|
||||
cacerts = KeyStore.getInstance("JKS");
|
||||
try (FileInputStream fis = new FileInputStream(f)) {
|
||||
cacerts.load(fis, "changeit".toCharArray());
|
||||
cacerts.load(fis, null);
|
||||
certs = new HashSet<>();
|
||||
Enumeration<String> list = cacerts.aliases();
|
||||
String alias;
|
||||
|
@ -39,6 +39,7 @@ import java.util.HashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.Matcher;
|
||||
@ -240,10 +241,11 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
|
||||
|
||||
private static class Constraints {
|
||||
private Map<String, Set<Constraint>> constraintsMap = new HashMap<>();
|
||||
private static final Pattern keySizePattern = Pattern.compile(
|
||||
"keySize\\s*(<=|<|==|!=|>|>=)\\s*(\\d+)");
|
||||
private static final Pattern denyAfterPattern = Pattern.compile(
|
||||
"denyAfter\\s+(\\d{4})-(\\d{2})-(\\d{2})");
|
||||
|
||||
private static class Holder {
|
||||
private static final Pattern DENY_AFTER_PATTERN = Pattern.compile(
|
||||
"denyAfter\\s+(\\d{4})-(\\d{2})-(\\d{2})");
|
||||
}
|
||||
|
||||
public Constraints(String[] constraintArray) {
|
||||
for (String constraintEntry : constraintArray) {
|
||||
@ -267,9 +269,11 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
|
||||
toUpperCase(Locale.ENGLISH));
|
||||
policy = constraintEntry.substring(space + 1);
|
||||
} else {
|
||||
constraintsMap.computeIfAbsent(
|
||||
constraintEntry.toUpperCase(Locale.ENGLISH),
|
||||
k -> new HashSet<>());
|
||||
algorithm = constraintEntry.toUpperCase(Locale.ENGLISH);
|
||||
if (!constraintsMap.containsKey(algorithm)) {
|
||||
constraintsMap.putIfAbsent(algorithm,
|
||||
new HashSet<>());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -283,15 +287,21 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
|
||||
for (String entry : policy.split("&")) {
|
||||
entry = entry.trim();
|
||||
|
||||
Matcher matcher = keySizePattern.matcher(entry);
|
||||
if (matcher.matches()) {
|
||||
Matcher matcher;
|
||||
if (entry.startsWith("keySize")) {
|
||||
if (debug != null) {
|
||||
debug.println("Constraints set to keySize: " +
|
||||
entry);
|
||||
}
|
||||
StringTokenizer tokens = new StringTokenizer(entry);
|
||||
if (!"keySize".equals(tokens.nextToken())) {
|
||||
throw new IllegalArgumentException("Error in " +
|
||||
"security property. Constraint unknown: " +
|
||||
entry);
|
||||
}
|
||||
c = new KeySizeConstraint(algorithm,
|
||||
KeySizeConstraint.Operator.of(matcher.group(1)),
|
||||
Integer.parseInt(matcher.group(2)));
|
||||
KeySizeConstraint.Operator.of(tokens.nextToken()),
|
||||
Integer.parseInt(tokens.nextToken()));
|
||||
|
||||
} else if (entry.equalsIgnoreCase("jdkCA")) {
|
||||
if (debug != null) {
|
||||
@ -305,7 +315,9 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
|
||||
c = new jdkCAConstraint(algorithm);
|
||||
jdkCALimit = true;
|
||||
|
||||
} else if(matcher.usePattern(denyAfterPattern).matches()) {
|
||||
} else if(entry.startsWith("denyAfter") &&
|
||||
(matcher = Holder.DENY_AFTER_PATTERN.matcher(entry))
|
||||
.matches()) {
|
||||
if (debug != null) {
|
||||
debug.println("Constraints set to denyAfter");
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ public final class LocaleMatcher {
|
||||
continue;
|
||||
}
|
||||
|
||||
String rangeForRegex = range.replaceAll("\\x2A", "\\\\p{Alnum}*");
|
||||
String rangeForRegex = range.replace("*", "\\p{Alnum}*");
|
||||
while (rangeForRegex.length() > 0) {
|
||||
for (String tag : tags) {
|
||||
tag = tag.toLowerCase(Locale.ROOT);
|
||||
@ -399,7 +399,7 @@ public final class LocaleMatcher {
|
||||
continue;
|
||||
}
|
||||
|
||||
String rangeForRegex = range.replaceAll("\\x2A", "\\\\p{Alnum}*");
|
||||
String rangeForRegex = range.replace("*", "\\p{Alnum}*");
|
||||
while (rangeForRegex.length() > 0) {
|
||||
if (tag.matches(rangeForRegex)) {
|
||||
return true;
|
||||
@ -447,7 +447,7 @@ public final class LocaleMatcher {
|
||||
}
|
||||
|
||||
public static List<LanguageRange> parse(String ranges) {
|
||||
ranges = ranges.replaceAll(" ", "").toLowerCase(Locale.ROOT);
|
||||
ranges = ranges.replace(" ", "").toLowerCase(Locale.ROOT);
|
||||
if (ranges.startsWith("accept-language:")) {
|
||||
ranges = ranges.substring(16); // delete unnecessary prefix
|
||||
}
|
||||
@ -536,6 +536,21 @@ public final class LocaleMatcher {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* A faster alternative approach to String.replaceFirst(), if the given
|
||||
* string is a literal String, not a regex.
|
||||
*/
|
||||
private static String replaceFirstSubStringMatch(String range,
|
||||
String substr, String replacement) {
|
||||
int pos = range.indexOf(substr);
|
||||
if (pos == -1) {
|
||||
return range;
|
||||
} else {
|
||||
return range.substring(0, pos) + replacement
|
||||
+ range.substring(pos + substr.length());
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] getEquivalentsForLanguage(String range) {
|
||||
String r = range;
|
||||
|
||||
@ -544,13 +559,16 @@ public final class LocaleMatcher {
|
||||
String equiv = LocaleEquivalentMaps.singleEquivMap.get(r);
|
||||
// Return immediately for performance if the first matching
|
||||
// subtag is found.
|
||||
return new String[] {range.replaceFirst(r, equiv)};
|
||||
return new String[]{replaceFirstSubStringMatch(range,
|
||||
r, equiv)};
|
||||
} else if (LocaleEquivalentMaps.multiEquivsMap.containsKey(r)) {
|
||||
String[] equivs = LocaleEquivalentMaps.multiEquivsMap.get(r);
|
||||
String[] result = new String[equivs.length];
|
||||
for (int i = 0; i < equivs.length; i++) {
|
||||
equivs[i] = range.replaceFirst(r, equivs[i]);
|
||||
result[i] = replaceFirstSubStringMatch(range,
|
||||
r, equivs[i]);
|
||||
}
|
||||
return equivs;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Truncate the last subtag simply.
|
||||
@ -578,7 +596,9 @@ public final class LocaleMatcher {
|
||||
|
||||
int len = index + subtag.length();
|
||||
if (range.length() == len || range.charAt(len) == '-') {
|
||||
return range.replaceFirst(subtag, LocaleEquivalentMaps.regionVariantEquivMap.get(subtag));
|
||||
return replaceFirstSubStringMatch(range, subtag,
|
||||
LocaleEquivalentMaps.regionVariantEquivMap
|
||||
.get(subtag));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,6 +181,6 @@ grant codeBase "jrt:/jdk.security.jgss" {
|
||||
grant codeBase "jrt:/jdk.zipfs" {
|
||||
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
|
||||
permission java.lang.RuntimePermission "fileSystemProvider";
|
||||
permission java.util.PropertyPermission "*", "read";
|
||||
permission java.util.PropertyPermission "os.name", "read";
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -70,14 +70,6 @@ static const jboolean const_cpwildcard = JNI_TRUE;
|
||||
static const jboolean const_cpwildcard = JNI_FALSE;
|
||||
#endif /* EXPAND_CLASSPATH_WILDCARDS */
|
||||
|
||||
#if defined(NEVER_ACT_AS_SERVER_CLASS_MACHINE)
|
||||
static const jint const_ergo_class = NEVER_SERVER_CLASS;
|
||||
#elif defined(ALWAYS_ACT_AS_SERVER_CLASS_MACHINE)
|
||||
static const jint const_ergo_class = ALWAYS_SERVER_CLASS;
|
||||
#else
|
||||
static const jint const_ergo_class = DEFAULT_POLICY;
|
||||
#endif /* NEVER_ACT_AS_SERVER_CLASS_MACHINE */
|
||||
|
||||
#ifdef ENABLE_ARG_FILES
|
||||
static const jboolean const_disable_argfile = JNI_FALSE;
|
||||
#else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -156,5 +156,5 @@ main(int argc, char **argv)
|
||||
(const_progname != NULL) ? const_progname : *margv,
|
||||
(const_launcher != NULL) ? const_launcher : *margv,
|
||||
HAS_JAVA_ARGS,
|
||||
const_cpwildcard, const_javaw, const_ergo_class);
|
||||
const_cpwildcard, const_javaw, 0);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ Java_java_io_FileInputStream_readBytes(JNIEnv *env, jobject this,
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_java_io_FileInputStream_skip(JNIEnv *env, jobject this, jlong toSkip) {
|
||||
Java_java_io_FileInputStream_skip0(JNIEnv *env, jobject this, jlong toSkip) {
|
||||
jlong cur = jlong_zero;
|
||||
jlong end = jlong_zero;
|
||||
FD fd = GET_FD(this, fis_fd);
|
||||
@ -90,7 +90,7 @@ Java_java_io_FileInputStream_skip(JNIEnv *env, jobject this, jlong toSkip) {
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_java_io_FileInputStream_available(JNIEnv *env, jobject this) {
|
||||
Java_java_io_FileInputStream_available0(JNIEnv *env, jobject this) {
|
||||
jlong ret;
|
||||
FD fd = GET_FD(this, fis_fd);
|
||||
if (fd == -1) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -78,7 +78,6 @@ static jboolean _is_java_args = JNI_FALSE;
|
||||
static jboolean _have_classpath = JNI_FALSE;
|
||||
static const char *_fVersion;
|
||||
static jboolean _wc_enabled = JNI_FALSE;
|
||||
static jint _ergo_policy = DEFAULT_POLICY;
|
||||
|
||||
/*
|
||||
* Entries for splash screen environment variables.
|
||||
@ -218,7 +217,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */
|
||||
jboolean javaargs, /* JAVA_ARGS */
|
||||
jboolean cpwildcard, /* classpath wildcard*/
|
||||
jboolean javaw, /* windows-only javaw */
|
||||
jint ergo /* ergonomics class policy */
|
||||
jint ergo /* unused */
|
||||
)
|
||||
{
|
||||
int mode = LM_UNKNOWN;
|
||||
@ -236,7 +235,6 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */
|
||||
_program_name = pname;
|
||||
_is_java_args = javaargs;
|
||||
_wc_enabled = cpwildcard;
|
||||
_ergo_policy = ergo;
|
||||
|
||||
InitLauncher(javaw);
|
||||
DumpState();
|
||||
@ -431,7 +429,7 @@ JavaMain(void * _args)
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
FreeKnownVMs(); /* after last possible PrintUsage() */
|
||||
FreeKnownVMs(); /* after last possible PrintUsage */
|
||||
|
||||
if (JLI_IsTraceLauncher()) {
|
||||
end = CounterGet();
|
||||
@ -669,11 +667,6 @@ CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
|
||||
/* use the default VM type if not specified (no alias processing) */
|
||||
if (jvmtype == NULL) {
|
||||
char* result = knownVMs[0].name+1;
|
||||
/* Use a different VM type if we are on a server class machine? */
|
||||
if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
|
||||
(ServerClassMachine() == JNI_TRUE)) {
|
||||
result = knownVMs[0].server_class+1;
|
||||
}
|
||||
JLI_TraceLauncher("Default VM: %s\n", result);
|
||||
return result;
|
||||
}
|
||||
@ -1777,15 +1770,14 @@ ShowSettings(JNIEnv *env, char *optString)
|
||||
jclass cls = GetLauncherHelperClass(env);
|
||||
NULL_CHECK(cls);
|
||||
NULL_CHECK(showSettingsID = (*env)->GetStaticMethodID(env, cls,
|
||||
"showSettings", "(ZLjava/lang/String;JJJZ)V"));
|
||||
"showSettings", "(ZLjava/lang/String;JJJ)V"));
|
||||
NULL_CHECK(joptString = (*env)->NewStringUTF(env, optString));
|
||||
(*env)->CallStaticVoidMethod(env, cls, showSettingsID,
|
||||
USE_STDERR,
|
||||
joptString,
|
||||
(jlong)initialHeapSize,
|
||||
(jlong)maxHeapSize,
|
||||
(jlong)threadStackSize,
|
||||
ServerClassMachine());
|
||||
(jlong)threadStackSize);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1812,7 +1804,7 @@ ListModules(JNIEnv *env, char *optString)
|
||||
static void
|
||||
PrintUsage(JNIEnv* env, jboolean doXUsage)
|
||||
{
|
||||
jmethodID initHelp, vmSelect, vmSynonym, vmErgo, printHelp, printXUsageMessage;
|
||||
jmethodID initHelp, vmSelect, vmSynonym, printHelp, printXUsageMessage;
|
||||
jstring jprogname, vm1, vm2;
|
||||
int i;
|
||||
jclass cls = GetLauncherHelperClass(env);
|
||||
@ -1831,8 +1823,6 @@ PrintUsage(JNIEnv* env, jboolean doXUsage)
|
||||
NULL_CHECK(vmSynonym = (*env)->GetStaticMethodID(env, cls,
|
||||
"appendVmSynonymMessage",
|
||||
"(Ljava/lang/String;Ljava/lang/String;)V"));
|
||||
NULL_CHECK(vmErgo = (*env)->GetStaticMethodID(env, cls,
|
||||
"appendVmErgoMessage", "(ZLjava/lang/String;)V"));
|
||||
|
||||
NULL_CHECK(printHelp = (*env)->GetStaticMethodID(env, cls,
|
||||
"printHelpMessage", "(Z)V"));
|
||||
@ -1845,13 +1835,6 @@ PrintUsage(JNIEnv* env, jboolean doXUsage)
|
||||
|
||||
|
||||
/* Assemble the other variant part of the usage */
|
||||
if ((knownVMs[0].flag == VM_KNOWN) ||
|
||||
(knownVMs[0].flag == VM_IF_SERVER_CLASS)) {
|
||||
NULL_CHECK(vm1 = (*env)->NewStringUTF(env, knownVMs[0].name));
|
||||
NULL_CHECK(vm2 = (*env)->NewStringUTF(env, knownVMs[0].name+1));
|
||||
(*env)->CallStaticVoidMethod(env, cls, vmSelect, vm1, vm2);
|
||||
CHECK_EXCEPTION_RETURN();
|
||||
}
|
||||
for (i=1; i<knownVMsCount; i++) {
|
||||
if (knownVMs[i].flag == VM_KNOWN) {
|
||||
NULL_CHECK(vm1 = (*env)->NewStringUTF(env, knownVMs[i].name));
|
||||
@ -1869,20 +1852,6 @@ PrintUsage(JNIEnv* env, jboolean doXUsage)
|
||||
}
|
||||
}
|
||||
|
||||
/* The first known VM is the default */
|
||||
{
|
||||
jboolean isServerClassMachine = ServerClassMachine();
|
||||
|
||||
const char* defaultVM = knownVMs[0].name+1;
|
||||
if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) && isServerClassMachine) {
|
||||
defaultVM = knownVMs[0].server_class+1;
|
||||
}
|
||||
|
||||
NULL_CHECK(vm1 = (*env)->NewStringUTF(env, defaultVM));
|
||||
(*env)->CallStaticVoidMethod(env, cls, vmErgo, isServerClassMachine, vm1);
|
||||
CHECK_EXCEPTION_RETURN();
|
||||
}
|
||||
|
||||
/* Complete the usage message and print to stderr*/
|
||||
(*env)->CallStaticVoidMethod(env, cls, printHelp, USE_STDERR);
|
||||
}
|
||||
@ -2011,19 +1980,7 @@ ReadKnownVMs(const char *jvmCfgName, jboolean speculative)
|
||||
} else if (!JLI_StrCCmp(tmpPtr, "ERROR")) {
|
||||
vmType = VM_ERROR;
|
||||
} else if (!JLI_StrCCmp(tmpPtr, "IF_SERVER_CLASS")) {
|
||||
tmpPtr += JLI_StrCSpn(tmpPtr, whiteSpace);
|
||||
if (*tmpPtr != 0) {
|
||||
tmpPtr += JLI_StrSpn(tmpPtr, whiteSpace);
|
||||
}
|
||||
if (*tmpPtr == 0) {
|
||||
JLI_ReportErrorMessage(CFG_WARN4, lineno, jvmCfgName);
|
||||
} else {
|
||||
/* Null terminate server class VM name */
|
||||
serverClassVMName = tmpPtr;
|
||||
tmpPtr += JLI_StrCSpn(tmpPtr, whiteSpace);
|
||||
*tmpPtr = 0;
|
||||
vmType = VM_IF_SERVER_CLASS;
|
||||
}
|
||||
/* ignored */
|
||||
} else {
|
||||
JLI_ReportErrorMessage(CFG_WARN5, lineno, &jvmCfgName[0]);
|
||||
vmType = VM_KNOWN;
|
||||
@ -2043,11 +2000,6 @@ ReadKnownVMs(const char *jvmCfgName, jboolean speculative)
|
||||
JLI_TraceLauncher(" name: %s vmType: %s alias: %s\n",
|
||||
knownVMs[cnt].name, "VM_ALIASED_TO", knownVMs[cnt].alias);
|
||||
break;
|
||||
case VM_IF_SERVER_CLASS:
|
||||
knownVMs[cnt].server_class = JLI_StringDup(serverClassVMName);
|
||||
JLI_TraceLauncher(" name: %s vmType: %s server_class: %s\n",
|
||||
knownVMs[cnt].name, "VM_IF_SERVER_CLASS", knownVMs[cnt].server_class);
|
||||
break;
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
@ -2197,12 +2149,6 @@ GetLauncherName()
|
||||
return _launcher_name;
|
||||
}
|
||||
|
||||
jint
|
||||
GetErgoPolicy()
|
||||
{
|
||||
return _ergo_policy;
|
||||
}
|
||||
|
||||
jboolean
|
||||
IsJavaArgs()
|
||||
{
|
||||
@ -2267,17 +2213,6 @@ DumpState()
|
||||
printf("\tlauncher name:%s\n", GetLauncherName());
|
||||
printf("\tjavaw:%s\n", (IsJavaw() == JNI_TRUE) ? "on" : "off");
|
||||
printf("\tfullversion:%s\n", GetFullVersion());
|
||||
printf("\tergo_policy:");
|
||||
switch(GetErgoPolicy()) {
|
||||
case NEVER_SERVER_CLASS:
|
||||
printf("NEVER_ACT_AS_A_SERVER_CLASS_MACHINE\n");
|
||||
break;
|
||||
case ALWAYS_SERVER_CLASS:
|
||||
printf("ALWAYS_ACT_AS_A_SERVER_CLASS_MACHINE\n");
|
||||
break;
|
||||
default:
|
||||
printf("DEFAULT_ERGONOMICS_POLICY\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -166,19 +166,10 @@ char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
|
||||
void AddOption(char *str, void *info);
|
||||
jboolean IsWhiteSpaceOption(const char* name);
|
||||
|
||||
enum ergo_policy {
|
||||
DEFAULT_POLICY = 0,
|
||||
NEVER_SERVER_CLASS,
|
||||
ALWAYS_SERVER_CLASS
|
||||
};
|
||||
|
||||
const char* GetProgramName();
|
||||
const char* GetFullVersion();
|
||||
jboolean IsJavaArgs();
|
||||
jboolean IsJavaw();
|
||||
jint GetErgoPolicy();
|
||||
|
||||
jboolean ServerClassMachine();
|
||||
|
||||
int ContinueInNewThread(InvocationFunctions* ifn, jlong threadStackSize,
|
||||
int argc, char** argv,
|
||||
|
@ -21,10 +21,9 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -21,10 +21,9 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -23,13 +23,13 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
|
||||
# and may not be available in a future release.
|
||||
#
|
||||
-client IF_SERVER_CLASS -server
|
||||
-server KNOWN
|
||||
-client KNOWN
|
||||
-minimal KNOWN
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
@ -24,11 +21,9 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,13 +23,13 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
|
||||
# and may not be available in a future release.
|
||||
#
|
||||
-client IF_SERVER_CLASS -server
|
||||
-server KNOWN
|
||||
-client KNOWN
|
||||
-minimal KNOWN
|
||||
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -21,10 +21,9 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/* This file houses the common methods for VM ergonomics the platforms
|
||||
* are split into ergo_sparc and ergo_x86, and they could be split more
|
||||
* in the future if required. The following comments are not entirely
|
||||
* true after bifurcation of the platform specific files.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following methods (down to ServerClassMachine()) answer
|
||||
* the question about whether a machine is a "server-class"
|
||||
* machine. A server-class machine is loosely defined as one
|
||||
* with 2 or more processors and 2 gigabytes or more physical
|
||||
* memory. The definition of a processor is a physical package,
|
||||
* not a hyperthreaded chip masquerading as a multi-processor.
|
||||
* The definition of memory is also somewhat fuzzy, since x86
|
||||
* machines seem not to report all the memory in their DIMMs, we
|
||||
* think because of memory mapping of graphics cards, etc.
|
||||
*
|
||||
* This code is somewhat more confused with #ifdef's than we'd
|
||||
* like because this file is used by both Solaris and Linux
|
||||
* platforms, and so needs to be parameterized for SPARC and
|
||||
* i586 hardware. The other Linux platforms (amd64 and ia64)
|
||||
* don't even ask this question, because they only come with
|
||||
* server JVMs.
|
||||
*/
|
||||
|
||||
#include "ergo.h"
|
||||
|
||||
/* Dispatch to the platform-specific definition of "server-class" */
|
||||
jboolean
|
||||
ServerClassMachine(void) {
|
||||
jboolean result;
|
||||
switch(GetErgoPolicy()) {
|
||||
case NEVER_SERVER_CLASS:
|
||||
return JNI_FALSE;
|
||||
case ALWAYS_SERVER_CLASS:
|
||||
return JNI_TRUE;
|
||||
default:
|
||||
result = ServerClassMachineImpl();
|
||||
JLI_TraceLauncher("ServerClassMachine: returns default value of %s\n",
|
||||
(result == JNI_TRUE ? "true" : "false"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_GENERIC_ERGO
|
||||
/* Ask the OS how many processors there are. */
|
||||
static unsigned long
|
||||
physical_processors(void) {
|
||||
const unsigned long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
|
||||
JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
|
||||
return sys_processors;
|
||||
}
|
||||
|
||||
jboolean
|
||||
ServerClassMachineImpl(void) {
|
||||
jboolean result = JNI_FALSE;
|
||||
/* How big is a server class machine? */
|
||||
const unsigned long server_processors = 2UL;
|
||||
const uint64_t server_memory = 2UL * GB;
|
||||
const uint64_t actual_memory = physical_memory();
|
||||
|
||||
/* Is this a server class machine? */
|
||||
if (actual_memory >= server_memory) {
|
||||
const unsigned long actual_processors = physical_processors();
|
||||
if (actual_processors >= server_processors) {
|
||||
result = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
JLI_TraceLauncher("unix_" LIBARCHNAME "_ServerClassMachine: %s\n",
|
||||
(result == JNI_TRUE ? "JNI_TRUE" : "JNI_FALSE"));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Compute physical memory by asking the OS */
|
||||
uint64_t
|
||||
physical_memory(void) {
|
||||
const uint64_t pages = (uint64_t) sysconf(_SC_PHYS_PAGES);
|
||||
const uint64_t page_size = (uint64_t) sysconf(_SC_PAGESIZE);
|
||||
const uint64_t result = pages * page_size;
|
||||
# define UINT64_FORMAT "%" PRIu64
|
||||
|
||||
JLI_TraceLauncher("pages: " UINT64_FORMAT
|
||||
" page_size: " UINT64_FORMAT
|
||||
" physical memory: " UINT64_FORMAT " (%.3fGB)\n",
|
||||
pages, page_size, result, result / (double) GB);
|
||||
return result;
|
||||
}
|
@ -1,323 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2007, 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.
|
||||
*/
|
||||
|
||||
#include "ergo.h"
|
||||
|
||||
static unsigned long physical_processors(void);
|
||||
|
||||
#ifdef __solaris__
|
||||
|
||||
/*
|
||||
* A utility method for asking the CPU about itself.
|
||||
* There's a corresponding version of linux-i586
|
||||
* because the compilers are different.
|
||||
*/
|
||||
static void
|
||||
get_cpuid(uint32_t arg,
|
||||
uint32_t* eaxp,
|
||||
uint32_t* ebxp,
|
||||
uint32_t* ecxp,
|
||||
uint32_t* edxp) {
|
||||
#ifdef _LP64
|
||||
asm(
|
||||
/* rbx is a callee-saved register */
|
||||
" movq %rbx, %r11 \n"
|
||||
/* rdx and rcx are 3rd and 4th argument registers */
|
||||
" movq %rdx, %r10 \n"
|
||||
" movq %rcx, %r9 \n"
|
||||
" movl %edi, %eax \n"
|
||||
" cpuid \n"
|
||||
" movl %eax, (%rsi)\n"
|
||||
" movl %ebx, (%r10)\n"
|
||||
" movl %ecx, (%r9) \n"
|
||||
" movl %edx, (%r8) \n"
|
||||
/* Restore rbx */
|
||||
" movq %r11, %rbx");
|
||||
#else
|
||||
/* EBX is a callee-saved register */
|
||||
asm(" pushl %ebx");
|
||||
/* Need ESI for storing through arguments */
|
||||
asm(" pushl %esi");
|
||||
asm(" movl 8(%ebp), %eax \n"
|
||||
" cpuid \n"
|
||||
" movl 12(%ebp), %esi \n"
|
||||
" movl %eax, (%esi) \n"
|
||||
" movl 16(%ebp), %esi \n"
|
||||
" movl %ebx, (%esi) \n"
|
||||
" movl 20(%ebp), %esi \n"
|
||||
" movl %ecx, (%esi) \n"
|
||||
" movl 24(%ebp), %esi \n"
|
||||
" movl %edx, (%esi) ");
|
||||
/* Restore ESI and EBX */
|
||||
asm(" popl %esi");
|
||||
/* Restore EBX */
|
||||
asm(" popl %ebx");
|
||||
#endif /* LP64 */
|
||||
}
|
||||
|
||||
/* The definition of a server-class machine for solaris-i586/amd64 */
|
||||
jboolean
|
||||
ServerClassMachineImpl(void) {
|
||||
jboolean result = JNI_FALSE;
|
||||
/* How big is a server class machine? */
|
||||
const unsigned long server_processors = 2UL;
|
||||
const uint64_t server_memory = 2UL * GB;
|
||||
/*
|
||||
* We seem not to get our full complement of memory.
|
||||
* We allow some part (1/8?) of the memory to be "missing",
|
||||
* based on the sizes of DIMMs, and maybe graphics cards.
|
||||
*/
|
||||
const uint64_t missing_memory = 256UL * MB;
|
||||
const uint64_t actual_memory = physical_memory();
|
||||
|
||||
/* Is this a server class machine? */
|
||||
if (actual_memory >= (server_memory - missing_memory)) {
|
||||
const unsigned long actual_processors = physical_processors();
|
||||
if (actual_processors >= server_processors) {
|
||||
result = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
JLI_TraceLauncher("solaris_" LIBARCHNAME "_ServerClassMachine: %s\n",
|
||||
(result == JNI_TRUE ? "true" : "false"));
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* __solaris__ */
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
/*
|
||||
* A utility method for asking the CPU about itself.
|
||||
* There's a corresponding version of solaris-i586
|
||||
* because the compilers are different.
|
||||
*/
|
||||
static void
|
||||
get_cpuid(uint32_t arg,
|
||||
uint32_t* eaxp,
|
||||
uint32_t* ebxp,
|
||||
uint32_t* ecxp,
|
||||
uint32_t* edxp) {
|
||||
#ifdef _LP64
|
||||
__asm__ volatile (/* Instructions */
|
||||
" movl %4, %%eax \n"
|
||||
" cpuid \n"
|
||||
" movl %%eax, (%0)\n"
|
||||
" movl %%ebx, (%1)\n"
|
||||
" movl %%ecx, (%2)\n"
|
||||
" movl %%edx, (%3)\n"
|
||||
: /* Outputs */
|
||||
: /* Inputs */
|
||||
"r" (eaxp),
|
||||
"r" (ebxp),
|
||||
"r" (ecxp),
|
||||
"r" (edxp),
|
||||
"r" (arg)
|
||||
: /* Clobbers */
|
||||
"%rax", "%rbx", "%rcx", "%rdx", "memory"
|
||||
);
|
||||
#else /* _LP64 */
|
||||
uint32_t value_of_eax = 0;
|
||||
uint32_t value_of_ebx = 0;
|
||||
uint32_t value_of_ecx = 0;
|
||||
uint32_t value_of_edx = 0;
|
||||
__asm__ volatile (/* Instructions */
|
||||
/* ebx is callee-save, so push it */
|
||||
" pushl %%ebx \n"
|
||||
" movl %4, %%eax \n"
|
||||
" cpuid \n"
|
||||
" movl %%eax, %0 \n"
|
||||
" movl %%ebx, %1 \n"
|
||||
" movl %%ecx, %2 \n"
|
||||
" movl %%edx, %3 \n"
|
||||
/* restore ebx */
|
||||
" popl %%ebx \n"
|
||||
|
||||
: /* Outputs */
|
||||
"=m" (value_of_eax),
|
||||
"=m" (value_of_ebx),
|
||||
"=m" (value_of_ecx),
|
||||
"=m" (value_of_edx)
|
||||
: /* Inputs */
|
||||
"m" (arg)
|
||||
: /* Clobbers */
|
||||
"%eax", "%ecx", "%edx"
|
||||
);
|
||||
*eaxp = value_of_eax;
|
||||
*ebxp = value_of_ebx;
|
||||
*ecxp = value_of_ecx;
|
||||
*edxp = value_of_edx;
|
||||
#endif /* _LP64 */
|
||||
}
|
||||
|
||||
/* The definition of a server-class machine for linux-i586 */
|
||||
jboolean
|
||||
ServerClassMachineImpl(void) {
|
||||
jboolean result = JNI_FALSE;
|
||||
/* How big is a server class machine? */
|
||||
const unsigned long server_processors = 2UL;
|
||||
const uint64_t server_memory = 2UL * GB;
|
||||
/*
|
||||
* We seem not to get our full complement of memory.
|
||||
* We allow some part (1/8?) of the memory to be "missing",
|
||||
* based on the sizes of DIMMs, and maybe graphics cards.
|
||||
*/
|
||||
const uint64_t missing_memory = 256UL * MB;
|
||||
const uint64_t actual_memory = physical_memory();
|
||||
|
||||
/* Is this a server class machine? */
|
||||
if (actual_memory >= (server_memory - missing_memory)) {
|
||||
const unsigned long actual_processors = physical_processors();
|
||||
if (actual_processors >= server_processors) {
|
||||
result = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
JLI_TraceLauncher("linux_" LIBARCHNAME "_ServerClassMachine: %s\n",
|
||||
(result == JNI_TRUE ? "true" : "false"));
|
||||
return result;
|
||||
}
|
||||
#endif /* __linux__ */
|
||||
|
||||
/*
|
||||
* Routines shared by solaris-i586 and linux-i586.
|
||||
*/
|
||||
|
||||
enum HyperThreadingSupport_enum {
|
||||
hts_supported = 1,
|
||||
hts_too_soon_to_tell = 0,
|
||||
hts_not_supported = -1,
|
||||
hts_not_pentium4 = -2,
|
||||
hts_not_intel = -3
|
||||
};
|
||||
typedef enum HyperThreadingSupport_enum HyperThreadingSupport;
|
||||
|
||||
/* Determine if hyperthreading is supported */
|
||||
static HyperThreadingSupport
|
||||
hyperthreading_support(void) {
|
||||
HyperThreadingSupport result = hts_too_soon_to_tell;
|
||||
/* Bits 11 through 8 is family processor id */
|
||||
# define FAMILY_ID_SHIFT 8
|
||||
# define FAMILY_ID_MASK 0xf
|
||||
/* Bits 23 through 20 is extended family processor id */
|
||||
# define EXT_FAMILY_ID_SHIFT 20
|
||||
# define EXT_FAMILY_ID_MASK 0xf
|
||||
/* Pentium 4 family processor id */
|
||||
# define PENTIUM4_FAMILY_ID 0xf
|
||||
/* Bit 28 indicates Hyper-Threading Technology support */
|
||||
# define HT_BIT_SHIFT 28
|
||||
# define HT_BIT_MASK 1
|
||||
uint32_t vendor_id[3] = { 0U, 0U, 0U };
|
||||
uint32_t value_of_eax = 0U;
|
||||
uint32_t value_of_edx = 0U;
|
||||
uint32_t dummy = 0U;
|
||||
|
||||
/* Yes, this is supposed to be [0], [2], [1] */
|
||||
get_cpuid(0, &dummy, &vendor_id[0], &vendor_id[2], &vendor_id[1]);
|
||||
JLI_TraceLauncher("vendor: %c %c %c %c %c %c %c %c %c %c %c %c \n",
|
||||
((vendor_id[0] >> 0) & 0xff),
|
||||
((vendor_id[0] >> 8) & 0xff),
|
||||
((vendor_id[0] >> 16) & 0xff),
|
||||
((vendor_id[0] >> 24) & 0xff),
|
||||
((vendor_id[1] >> 0) & 0xff),
|
||||
((vendor_id[1] >> 8) & 0xff),
|
||||
((vendor_id[1] >> 16) & 0xff),
|
||||
((vendor_id[1] >> 24) & 0xff),
|
||||
((vendor_id[2] >> 0) & 0xff),
|
||||
((vendor_id[2] >> 8) & 0xff),
|
||||
((vendor_id[2] >> 16) & 0xff),
|
||||
((vendor_id[2] >> 24) & 0xff));
|
||||
get_cpuid(1, &value_of_eax, &dummy, &dummy, &value_of_edx);
|
||||
JLI_TraceLauncher("value_of_eax: 0x%x value_of_edx: 0x%x\n",
|
||||
value_of_eax, value_of_edx);
|
||||
if ((((value_of_eax >> FAMILY_ID_SHIFT) & FAMILY_ID_MASK) == PENTIUM4_FAMILY_ID) ||
|
||||
(((value_of_eax >> EXT_FAMILY_ID_SHIFT) & EXT_FAMILY_ID_MASK) != 0)) {
|
||||
if ((((vendor_id[0] >> 0) & 0xff) == 'G') &&
|
||||
(((vendor_id[0] >> 8) & 0xff) == 'e') &&
|
||||
(((vendor_id[0] >> 16) & 0xff) == 'n') &&
|
||||
(((vendor_id[0] >> 24) & 0xff) == 'u') &&
|
||||
(((vendor_id[1] >> 0) & 0xff) == 'i') &&
|
||||
(((vendor_id[1] >> 8) & 0xff) == 'n') &&
|
||||
(((vendor_id[1] >> 16) & 0xff) == 'e') &&
|
||||
(((vendor_id[1] >> 24) & 0xff) == 'I') &&
|
||||
(((vendor_id[2] >> 0) & 0xff) == 'n') &&
|
||||
(((vendor_id[2] >> 8) & 0xff) == 't') &&
|
||||
(((vendor_id[2] >> 16) & 0xff) == 'e') &&
|
||||
(((vendor_id[2] >> 24) & 0xff) == 'l')) {
|
||||
if (((value_of_edx >> HT_BIT_SHIFT) & HT_BIT_MASK) == HT_BIT_MASK) {
|
||||
JLI_TraceLauncher("Hyperthreading supported\n");
|
||||
result = hts_supported;
|
||||
} else {
|
||||
JLI_TraceLauncher("Hyperthreading not supported\n");
|
||||
result = hts_not_supported;
|
||||
}
|
||||
} else {
|
||||
JLI_TraceLauncher("Not GenuineIntel\n");
|
||||
result = hts_not_intel;
|
||||
}
|
||||
} else {
|
||||
JLI_TraceLauncher("not Pentium 4 or extended\n");
|
||||
result = hts_not_pentium4;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Determine how many logical processors there are per CPU */
|
||||
static unsigned int
|
||||
logical_processors_per_package(void) {
|
||||
/*
|
||||
* After CPUID with EAX==1, register EBX bits 23 through 16
|
||||
* indicate the number of logical processors per package
|
||||
*/
|
||||
# define NUM_LOGICAL_SHIFT 16
|
||||
# define NUM_LOGICAL_MASK 0xff
|
||||
unsigned int result = 1U;
|
||||
const HyperThreadingSupport hyperthreading = hyperthreading_support();
|
||||
|
||||
if (hyperthreading == hts_supported) {
|
||||
uint32_t value_of_ebx = 0U;
|
||||
uint32_t dummy = 0U;
|
||||
|
||||
get_cpuid(1, &dummy, &value_of_ebx, &dummy, &dummy);
|
||||
result = (value_of_ebx >> NUM_LOGICAL_SHIFT) & NUM_LOGICAL_MASK;
|
||||
JLI_TraceLauncher("logical processors per package: %u\n", result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Compute the number of physical processors, not logical processors */
|
||||
static unsigned long
|
||||
physical_processors(void) {
|
||||
const long sys_processors = sysconf(_SC_NPROCESSORS_CONF);
|
||||
unsigned long result = sys_processors;
|
||||
|
||||
JLI_TraceLauncher("sysconf(_SC_NPROCESSORS_CONF): %lu\n", sys_processors);
|
||||
if (sys_processors > 1) {
|
||||
unsigned int logical_processors = logical_processors_per_package();
|
||||
if (logical_processors > 1) {
|
||||
result = (unsigned long) sys_processors / logical_processors;
|
||||
}
|
||||
}
|
||||
JLI_TraceLauncher("physical processors: %lu\n", result);
|
||||
return result;
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
@ -27,7 +24,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -23,7 +23,7 @@
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -1,6 +1,3 @@
|
||||
#
|
||||
#
|
||||
#
|
||||
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
@ -24,10 +21,9 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
#
|
||||
# List of JVMs that can be used as an option to java, javac, etc.
|
||||
# Order is important -- first in this list is the default JVM.
|
||||
# NOTE that this both this file and its format are UNSUPPORTED and
|
||||
# NOTE that both this file and its format are UNSUPPORTED and
|
||||
# WILL GO AWAY in a future release.
|
||||
#
|
||||
# You may also select a JVM in an arbitrary location with the
|
||||
|
@ -639,11 +639,6 @@ void JLI_ReportExceptionDescription(JNIEnv * env) {
|
||||
}
|
||||
}
|
||||
|
||||
jboolean
|
||||
ServerClassMachine() {
|
||||
return (GetErgoPolicy() == ALWAYS_SERVER_CLASS) ? JNI_TRUE : JNI_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper for platform dependent unsetenv function.
|
||||
*/
|
||||
|
@ -3222,7 +3222,7 @@ public class ConsoleReader
|
||||
}
|
||||
//where:
|
||||
private Pattern CURSOR_COLUMN_PATTERN =
|
||||
Pattern.compile("(?<prefix>.*)\033\\[[0-9]+;(?<column>[0-9]+)R");
|
||||
Pattern.compile("(?<prefix>.*)\033\\[[0-9]+;(?<column>[0-9]+)R", Pattern.DOTALL);
|
||||
|
||||
/**
|
||||
* Read a line for unsupported terminals.
|
||||
|
@ -71,9 +71,7 @@ main.opt.footer=\
|
||||
\ separated list of elements each using one the following forms:\n\
|
||||
\ <glob-pattern>\n\
|
||||
\ glob:<glob-pattern>\n\
|
||||
\ regex:<regex-pattern>\n\
|
||||
\ @<filename> where filename is the name of a file containing patterns to be\
|
||||
\ used, one pattern per line\n\
|
||||
\ regex:<regex-pattern>
|
||||
|
||||
|
||||
main.opt.full-version=\
|
||||
|
@ -92,7 +92,7 @@ public class DirArchive implements Archive {
|
||||
public DirArchive(Path dirPath, Consumer<String> log) {
|
||||
Objects.requireNonNull(dirPath);
|
||||
if (!Files.isDirectory(dirPath)) {
|
||||
throw new IllegalArgumentException("Not a directory");
|
||||
throw new IllegalArgumentException(dirPath + " is not a directory");
|
||||
}
|
||||
chop = dirPath.toString().length() + 1;
|
||||
this.moduleName = Objects.requireNonNull(dirPath.getFileName()).toString();
|
||||
|
@ -212,7 +212,7 @@ public final class TaskHelper {
|
||||
mainOptions.add(new PlugOption(true, (task, opt, arg) -> {
|
||||
Path path = Paths.get(arg);
|
||||
if (!Files.exists(path) || !Files.isDirectory(path)) {
|
||||
throw newBadArgs("err.image.must.exist");
|
||||
throw newBadArgs("err.image.must.exist", path);
|
||||
}
|
||||
existingImage = path.toAbsolutePath();
|
||||
}, true, POST_PROCESS));
|
||||
|
@ -91,7 +91,7 @@ err.modulepath.must.be.specified:--module-path must be specified
|
||||
err.mods.must.be.specified:no modules specified to {0}
|
||||
err.path.not.found=path not found: {0}
|
||||
err.path.not.valid=invalid path: {0}
|
||||
err.image.must.exist=image does not exist or is not a directory
|
||||
err.image.must.exist=image {0} does not exist or is not a directory
|
||||
err.existing.image.invalid=existing image is not valid
|
||||
err.file.not.found=cannot find file: {0}
|
||||
err.file.error=cannot access file: {0}
|
||||
|
@ -18,7 +18,7 @@ keys=2d dnd i18n intermittent randomness headful
|
||||
othervm.dirs=java/awt java/beans javax/accessibility javax/imageio javax/sound javax/print javax/management com/sun/awt sun/awt sun/java2d sun/pisces javax/xml/jaxp/testng/validation java/lang/ProcessHandle
|
||||
|
||||
# Tests that cannot run concurrently
|
||||
exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream javax/rmi
|
||||
exclusiveAccess.dirs=java/rmi/Naming java/util/prefs sun/management/jmxremote sun/tools/jstatd sun/security/mscapi java/util/stream javax/rmi com/sun/corba/cachedSocket
|
||||
|
||||
# Group definitions
|
||||
groups=TEST.groups [closed/TEST.groups]
|
||||
|
@ -1 +1 @@
|
||||
modules = jdk.httpserver
|
||||
modules = jdk.httpserver java.logging
|
||||
|
74
jdk/test/java/util/Locale/Bug8166994.java
Normal file
74
jdk/test/java/util/Locale/Bug8166994.java
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
/*
|
||||
* @test
|
||||
* @bug 8166884
|
||||
* @summary Checks the subsequent call to parse the same language ranges
|
||||
* which must generate the same list of language ranges
|
||||
* i.e. the priority list containing equivalents, as in the
|
||||
* first call
|
||||
*/
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Bug8166994 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> list = Arrays.asList("ccq-aa", "ybd-aa", "rki-aa");
|
||||
String ranges = "ccq-aa";
|
||||
testParseConsistency(list, ranges);
|
||||
|
||||
// consecutive call to check the language range parse consistency
|
||||
testParseConsistency(list, ranges);
|
||||
|
||||
// another case with ranges consisting of multiple equivalents and
|
||||
// single equivalents
|
||||
list = Arrays.asList("gfx-xz", "oun-xz", "mwj-xz", "vaj-xz",
|
||||
"taj-xy", "tsf-xy");
|
||||
ranges = "gfx-xz, taj-xy";
|
||||
testParseConsistency(list, ranges);
|
||||
// consecutive call to check the language range parse consistency
|
||||
testParseConsistency(list, ranges);
|
||||
|
||||
}
|
||||
|
||||
private static void testParseConsistency(List<String> list, String ranges) {
|
||||
List<String> priorityList = parseRanges(ranges);
|
||||
if (!list.equals(priorityList)) {
|
||||
throw new RuntimeException("Failed to parse the language range ["
|
||||
+ ranges + "], Expected: " + list + " Found: "
|
||||
+ priorityList);
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> parseRanges(String s) {
|
||||
return Locale.LanguageRange.parse(s).stream()
|
||||
.map(Locale.LanguageRange::getRange)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -176,7 +176,10 @@ public class DTLSOverDatagram {
|
||||
boolean finished = onReceiveTimeout(
|
||||
engine, peerAddr, side, packets);
|
||||
|
||||
log(side, "Reproduced " + packets.size() + " packets");
|
||||
for (DatagramPacket p : packets) {
|
||||
printHex("Reproduced packet",
|
||||
p.getData(), p.getOffset(), p.getLength());
|
||||
socket.send(p);
|
||||
}
|
||||
|
||||
@ -334,7 +337,7 @@ public class DTLSOverDatagram {
|
||||
String side, List<DatagramPacket> packets) throws Exception {
|
||||
|
||||
boolean endLoops = false;
|
||||
int loops = MAX_HANDSHAKE_LOOPS;
|
||||
int loops = MAX_HANDSHAKE_LOOPS / 2;
|
||||
while (!endLoops &&
|
||||
(serverException == null) && (clientException == null)) {
|
||||
|
||||
@ -350,7 +353,8 @@ public class DTLSOverDatagram {
|
||||
|
||||
SSLEngineResult.Status rs = r.getStatus();
|
||||
SSLEngineResult.HandshakeStatus hs = r.getHandshakeStatus();
|
||||
log(side, "====packet(" + loops + ", " + rs + ", " + hs + ")====");
|
||||
log(side, "----produce handshake packet(" +
|
||||
loops + ", " + rs + ", " + hs + ")----");
|
||||
if (rs == SSLEngineResult.Status.BUFFER_OVERFLOW) {
|
||||
// the client maximum fragment size config does not work?
|
||||
throw new Exception("Buffer overflow: " +
|
||||
|
75
jdk/test/javax/net/ssl/interop/ClientHelloChromeInterOp.java
Normal file
75
jdk/test/javax/net/ssl/interop/ClientHelloChromeInterOp.java
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
//
|
||||
// SunJSSE does not support dynamic system properties, no way to re-use
|
||||
// system properties in samevm/agentvm mode.
|
||||
//
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8169362
|
||||
* @summary Interop automated testing with Chrome
|
||||
* @modules java.base/sun.security.util
|
||||
* @run main/othervm ClientHelloChromeInterOp
|
||||
*/
|
||||
|
||||
import java.util.Base64;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
|
||||
public class ClientHelloChromeInterOp extends ClientHelloInterOp {
|
||||
// The ClientHello message.
|
||||
//
|
||||
// Captured from Chrome browser (version 54.0.2840.87 m (64-bit)) on
|
||||
// Windows 10.
|
||||
private final static String ClientHelloMsg =
|
||||
"FgMBAL4BAAC6AwOWBEueOntnurZ+WAW0D9Qn2HpdzXLu0MgDjsD9e5JU6AAAIsA\n" +
|
||||
"rwC/ALMAwzKnMqMwUzBPACcATwArAFACcAJ0ALwA1AAoBAABv/wEAAQAAAAATAB\n" +
|
||||
"EAAA53d3cub3JhY2xlLmNvbQAXAAAAIwAAAA0AEgAQBgEGAwUBBQMEAQQDAgECA\n" +
|
||||
"wAFAAUBAAAAAAASAAAAEAAOAAwCaDIIaHR0cC8xLjF1UAAAAAsAAgEAAAoACAAG\n" +
|
||||
"AB0AFwAY";
|
||||
|
||||
/*
|
||||
* Main entry point for this test.
|
||||
*/
|
||||
public static void main(String args[]) throws Exception {
|
||||
(new ClientHelloChromeInterOp()).run();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected byte[] createClientHelloMessage() {
|
||||
byte[] bytes = Base64.getMimeDecoder().decode(ClientHelloMsg);
|
||||
|
||||
// Dump the hex codes of the ClientHello message so that developers
|
||||
// can easily check whether the message is captured correct or not.
|
||||
HexDumpEncoder dump = new HexDumpEncoder();
|
||||
System.out.println("The ClientHello message used");
|
||||
try {
|
||||
dump.encodeBuffer(bytes, System.out);
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
}
|
432
jdk/test/javax/net/ssl/interop/ClientHelloInterOp.java
Normal file
432
jdk/test/javax/net/ssl/interop/ClientHelloInterOp.java
Normal file
@ -0,0 +1,432 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import javax.net.ssl.*;
|
||||
import javax.net.ssl.SSLEngineResult.*;
|
||||
import java.io.*;
|
||||
import java.nio.*;
|
||||
import java.security.KeyStore;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.spec.*;
|
||||
import java.util.Base64;
|
||||
|
||||
public abstract class ClientHelloInterOp {
|
||||
|
||||
/*
|
||||
* Certificates and keys used in the test.
|
||||
*/
|
||||
// Trusted certificates.
|
||||
private final static String[] trustedCertStrs = {
|
||||
// SHA256withECDSA, curve prime256v1
|
||||
// Validity
|
||||
// Not Before: Nov 9 03:24:05 2016 GMT
|
||||
// Not After : Oct 20 03:24:05 2037 GMT
|
||||
"-----BEGIN CERTIFICATE-----\n" +
|
||||
"MIICHDCCAcGgAwIBAgIJAM83C/MVp9F5MAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" +
|
||||
"AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
|
||||
"ZTAeFw0xNjExMDkwMzI0MDVaFw0zNzEwMjAwMzI0MDVaMDsxCzAJBgNVBAYTAlVT\n" +
|
||||
"MQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" +
|
||||
"MBMGByqGSM49AgEGCCqGSM49AwEHA0IABGeQXwyeNyU4UAATfwUbMO5zaREI21Wh\n" +
|
||||
"bds6WDu+PmfK8SWsTgsgpYxBRui+fZtYqSmbdjkurvAQ3j2fvN++BtWjga0wgaow\n" +
|
||||
"HQYDVR0OBBYEFDF/OeJ82qBSRkAm1rdZUPbWfDzyMGsGA1UdIwRkMGKAFDF/OeJ8\n" +
|
||||
"2qBSRkAm1rdZUPbWfDzyoT+kPTA7MQswCQYDVQQGEwJVUzENMAsGA1UEChMESmF2\n" +
|
||||
"YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2WCCQDPNwvzFafReTAPBgNV\n" +
|
||||
"HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAKBggqhkjOPQQDAgNJADBGAiEAlHQY\n" +
|
||||
"QFPlODOsjLVQYSxgeSUvYzMp0vP8naeVB9bfFG8CIQCFfrKZvhq9z3bOtlYKxs2a\n" +
|
||||
"EWUjUZ82a1JTqkP+lgHY5A==\n" +
|
||||
"-----END CERTIFICATE-----",
|
||||
|
||||
// SHA256withRSA, 2048 bits
|
||||
// Validity
|
||||
// Not Before: Nov 9 03:24:16 2016 GMT
|
||||
// Not After : Oct 20 03:24:16 2037 GMT
|
||||
"-----BEGIN CERTIFICATE-----\n" +
|
||||
"MIIDpzCCAo+gAwIBAgIJAJAYpR2aIlA1MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
|
||||
"BAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2Vy\n" +
|
||||
"aXZjZTAeFw0xNjExMDkwMzI0MTZaFw0zNzEwMjAwMzI0MTZaMDsxCzAJBgNVBAYT\n" +
|
||||
"AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
|
||||
"ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL+F/FTPODYzsU0Pakfp\n" +
|
||||
"lsh88YoQWZPjABhCU+HPsCTMYc8UBkaiduUzregwwVBW3D7kmec2K408krGQsxdy\n" +
|
||||
"oKJA12GL/XX1YgzDEsyBRk/gvex5lPaBIZiJ5IZlUfjLuRDGxPjtRelBTpZ7SUet\n" +
|
||||
"PJVZz6zV6hMPGO6kQzCtbzzET515EE0okIS40LkAmtWoOmVm3gRldomaZTrZ0V2L\n" +
|
||||
"MMaJGzrXYqk0SX+PYul8v+2EEHeMuaXG/XpK5xsg9gZvzpKqFQcBOdENoJHB07go\n" +
|
||||
"jCmRC328ALqr+bMyktKAuYfB+mhjmN2AU8TQx72WPpvNTXxFDYcwo+8254cCAVKB\n" +
|
||||
"e98CAwEAAaOBrTCBqjAdBgNVHQ4EFgQUlJQlQTbi8YIyiNf+SqF7LtH+gicwawYD\n" +
|
||||
"VR0jBGQwYoAUlJQlQTbi8YIyiNf+SqF7LtH+giehP6Q9MDsxCzAJBgNVBAYTAlVT\n" +
|
||||
"MQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZjZYIJ\n" +
|
||||
"AJAYpR2aIlA1MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3\n" +
|
||||
"DQEBCwUAA4IBAQAI0lTY0YAKQ2VdoIQ6dnqolphLVWdNGiC9drHEYSn7+hmAD2r2\n" +
|
||||
"v1U/9m752TkcT74a65xKbEVuVtleD/w6i+QjALW2PYt6ivjOnnY0a9Y9a9UCa00j\n" +
|
||||
"C9415sCw84Tp9VoKtuYqzhN87bBUeABOw5dsW3z32C2N/YhprkqeF/vdx4JxulPr\n" +
|
||||
"PKze5BREXnKLA1ISoDioCPphvNMKrSpkAofb1rTCwtgt5V/WFls283L52ORmpRGO\n" +
|
||||
"Ja88ztXOz00ZGu0RQLwlmpN7m8tNgA/5MPrldyYIwegP4RSkkJlF/8+hxvvqfJhK\n" +
|
||||
"FFDa0HHQSJfR2b9628Iniw1UHOMMT6qx5EHr\n" +
|
||||
"-----END CERTIFICATE-----"
|
||||
};
|
||||
|
||||
// End entity certificate.
|
||||
private final static String[] endEntityCertStrs = {
|
||||
// SHA256withECDSA, curve prime256v1
|
||||
// Validity
|
||||
// Not Before: Nov 9 03:24:05 2016 GMT
|
||||
// Not After : Jul 27 03:24:05 2036 GMT
|
||||
"-----BEGIN CERTIFICATE-----\n" +
|
||||
"MIIB1DCCAXmgAwIBAgIJAKVa+4dIUjaLMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" +
|
||||
"AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
|
||||
"ZTAeFw0xNjExMDkwMzI0MDVaFw0zNjA3MjcwMzI0MDVaMFIxCzAJBgNVBAYTAlVT\n" +
|
||||
"MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEV\n" +
|
||||
"MBMGA1UEAwwMSW50ZXJPcCBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\n" +
|
||||
"h4vXNUJzULq4e7fAOvF0WiWU6cllOAMus1GqTFvcnRPOChl8suZsvksO0CpZqL3h\n" +
|
||||
"jXmVX9dp1FV/rUBGLo1aG6NPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSO8V5+\n" +
|
||||
"bj0ik0T9BtJc4jLJt7m6wjAfBgNVHSMEGDAWgBQxfznifNqgUkZAJta3WVD21nw8\n" +
|
||||
"8jAKBggqhkjOPQQDAgNJADBGAiEAk7MF+L9bFRwUsbPsBCbCqH9DMdzBQR+kFDNf\n" +
|
||||
"lfn8Rs4CIQD9qWvBXd+EJqwraxiX6cftaFchn+T2HpvMboy+irMFow==\n" +
|
||||
"-----END CERTIFICATE-----",
|
||||
|
||||
// SHA256withRSA, 2048 bits
|
||||
// Validity
|
||||
// Not Before: Nov 9 03:24:16 2016 GMT
|
||||
// Not After : Jul 27 03:24:16 2036 GMT
|
||||
"-----BEGIN CERTIFICATE-----\n" +
|
||||
"MIIDczCCAlugAwIBAgIJAPhM2oUKx0aJMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" +
|
||||
"BAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2Vy\n" +
|
||||
"aXZjZTAeFw0xNjExMDkwMzI0MTZaFw0zNjA3MjcwMzI0MTZaMFIxCzAJBgNVBAYT\n" +
|
||||
"AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" +
|
||||
"ZTEVMBMGA1UEAwwMSW50ZXJPcCBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" +
|
||||
"MIIBCgKCAQEA36tJaXfJ2B/AFvES+tnueyQPSNABVu9nfMdU+NEPamJ+FH7cEF8Z\n" +
|
||||
"1Spr1vlQgNzCpDUVrfnmT75rCapgz5ldA9+y+3hdfUyHjZBzzfx+6GHXLB4u6eU2\n" +
|
||||
"NATa7vqSLNbcLcfZ7/QmkFqg4JRJbX4F42kKkRJrWdKZ8UoCYC8WXWvDaZ3nUs05\n" +
|
||||
"XHe+mBJ8qMNPTbYST1jpzXPyH5CljlFGYi2mKJDTImDhwht7mu2+zvwvbJ81Gj2X\n" +
|
||||
"JUSTSf9fu0zxFcCk6RmJPw9nSVqePVlOwtNNBodfKN+k4yr+gOz1v8NmMtmEtklV\n" +
|
||||
"Sulr/J4QxI+E2Zar/C+4XjxkvstIS+PNKQIDAQABo2MwYTALBgNVHQ8EBAMCA+gw\n" +
|
||||
"HQYDVR0OBBYEFHt19CItAz0VOF0WKGWwaT4DtEsSMB8GA1UdIwQYMBaAFJSUJUE2\n" +
|
||||
"4vGCMojX/kqhey7R/oInMBIGA1UdEQEB/wQIMAaHBH8AAAEwDQYJKoZIhvcNAQEL\n" +
|
||||
"BQADggEBACKYZWvo9B9IEpCCdBba2sNo4X1NI/VEY3fyUx1lkw+Kna+1d2Ab+RCZ\n" +
|
||||
"cf3Y85fcwv03hNE///wNBp+Nde4NQRDK/oiQARzWwWslfinm5d83eQwzC3cpSzt+\n" +
|
||||
"7ts6M5UlOblGsLXZI7THWO1tkgoEra9p+zezxLMmf/2MpNyZMZlVoJPM2YGxU9cN\n" +
|
||||
"ws0AyeY1gpBEdT21vjsBPdxxj6qklXVMnzS3zF8YwXyOndDYQWdjmFEknRK/qmQ2\n" +
|
||||
"gkLHrzpSpyCziecna5mGuDRdCU2dpsWiq1npEPXTq+PQGwWYcoaFTtXF8DDqhfPC\n" +
|
||||
"4Abe8gPm6MfzerdmS3RFTj9b/DIIENM=\n" +
|
||||
"-----END CERTIFICATE-----"
|
||||
};
|
||||
|
||||
// Private key in the format of PKCS#8.
|
||||
private final static String[] endEntityPrivateKeys = {
|
||||
//
|
||||
// EC private key related to cert endEntityCertStrs[0].
|
||||
//
|
||||
"MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgA3pmS+OrIjGyUv2F\n" +
|
||||
"K/PkyayJIePM2RTFYxNoQqmJGnihRANCAASHi9c1QnNQurh7t8A68XRaJZTpyWU4\n" +
|
||||
"Ay6zUapMW9ydE84KGXyy5my+Sw7QKlmoveGNeZVf12nUVX+tQEYujVob",
|
||||
|
||||
//
|
||||
// RSA private key related to cert endEntityCertStrs[1].
|
||||
//
|
||||
"MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDfq0lpd8nYH8AW\n" +
|
||||
"8RL62e57JA9I0AFW72d8x1T40Q9qYn4UftwQXxnVKmvW+VCA3MKkNRWt+eZPvmsJ\n" +
|
||||
"qmDPmV0D37L7eF19TIeNkHPN/H7oYdcsHi7p5TY0BNru+pIs1twtx9nv9CaQWqDg\n" +
|
||||
"lEltfgXjaQqREmtZ0pnxSgJgLxZda8NpnedSzTlcd76YEnyow09NthJPWOnNc/If\n" +
|
||||
"kKWOUUZiLaYokNMiYOHCG3ua7b7O/C9snzUaPZclRJNJ/1+7TPEVwKTpGYk/D2dJ\n" +
|
||||
"Wp49WU7C000Gh18o36TjKv6A7PW/w2Yy2YS2SVVK6Wv8nhDEj4TZlqv8L7hePGS+\n" +
|
||||
"y0hL480pAgMBAAECggEBAJyP1zk+IkloIBtu7+wrdCU6HoDHKMjjlzrehHoOTI4Z\n" +
|
||||
"F0vdaMkE6J4vrYCyz0kEPjKW/e/jxvT2wxHm8xEdtuApS61+mWJFmXTcMlNzdJnR\n" +
|
||||
"Mr6s+gW67fAHngA94OgGFeTtyX2PFxdgeM/6vFMqLZD7S+w0SnR7WEpvla4iB7On\n" +
|
||||
"lXqhJKVQeVc+IpByg/S4MmJb91jck73GltCaCL/b6BTrsz+zc/AY5tb8JInxjMZ9\n" +
|
||||
"jmjmA+s6l7tnBrFQfJHlF9a374lxCOtZTxyxVJjD7tQcGpsUpSHXZGdpDcT34qYT\n" +
|
||||
"UGh0yp2Mc/1PfWni5gS/6UGLrYmT57RRCn5YJBJTEkkCgYEA/XPCNehFaOMSxOZh\n" +
|
||||
"OGBVhQ+eRAmdpJfMhSUsDdEdQLZyWGmZsMTHjZZrwevBX/D0dxQYDv/sAl0GZomJ\n" +
|
||||
"d6iRCHlscycwx5Q0U/EpacsgRlYHz1nMRzXqS3Ry+8O8qQlliqCLUM7SfVgzdI5/\n" +
|
||||
"ll9JMrng9NnRl8ccjEdOGK8g/MMCgYEA4eriKMfRslGY4uOQoTPbuEJSMMwQ2X4k\n" +
|
||||
"lPj1p+xSQfU9QBaWJake67oBj3vpCxqN7/VkvCIeC6LCjhLpWHCn4EkdGiqkEdWz\n" +
|
||||
"m5CHzpzVIgznzWnbt0rCVL2KdL+ihgY8KPDdsZ6tZrABHuYhsWkAu10wyvuQYM88\n" +
|
||||
"3u6yOIQn36MCgYEAk5qR1UEzAxWTPbaJkgKQa5Cf9DHBbDS3eCcg098f8SsPxquh\n" +
|
||||
"RRAkwzGCCgqZsJ0sUhkStdGXifzRGHAq7dPuuwe0ABAn2WNXYjeFjcYtQqkhnUFH\n" +
|
||||
"tYURsOXdfQAOZEdDqos691GrxjHSraO7bECL6Y3VE+Oyq3jbCFsSgU+kn28CgYBT\n" +
|
||||
"mrXZO6FJqVK33FlAns1YEgsSjeJKapklHEDkxNroF9Zz6ifkhgKwX6SGMefbORd/\n" +
|
||||
"zsNZsBKIYdI3+52pIf+uS8BeV5tiEkCmeEUZ3AYv1LDP3rX1zc++xmn/rI97o8EN\n" +
|
||||
"sZ2JRtyK3OV9RtL/MYmYzPLqm1Ah02+GXLVNnvKWmwKBgE8Ble8CzrXYuuPdGxXz\n" +
|
||||
"BZU6HnXQrmTUcgeze0tj8SDHzCfsGsaG6pHrVNkT7CKsRuCHTZLM0kXmUijLFKuP\n" +
|
||||
"5xyE257z4IbbEbs+tcbB3p28n4/47MzZkSR3kt8+FrsEMZq5oOHbFTGzgp9dhZCC\n" +
|
||||
"dKUqlw5BPHdbxoWB/JpSHGCV"
|
||||
};
|
||||
|
||||
// Private key names of endEntityPrivateKeys.
|
||||
private final static String[] endEntityPrivateKeyNames = {
|
||||
"EC",
|
||||
"RSA"
|
||||
};
|
||||
|
||||
/*
|
||||
* Run the test case.
|
||||
*/
|
||||
public void run() throws Exception {
|
||||
SSLEngine serverEngine = createServerEngine();
|
||||
|
||||
//
|
||||
// Create and size the buffers appropriately.
|
||||
//
|
||||
SSLSession session = serverEngine.getSession();
|
||||
ByteBuffer serverAppInbound =
|
||||
ByteBuffer.allocate(session.getApplicationBufferSize());
|
||||
ByteBuffer clientHello =
|
||||
ByteBuffer.allocate(session.getPacketBufferSize());
|
||||
|
||||
//
|
||||
// Generate a ClientHello message, and check if the server
|
||||
// engine can read it or not.
|
||||
//
|
||||
clientHello.put(createClientHelloMessage());
|
||||
clientHello.flip();
|
||||
|
||||
SSLEngineResult serverResult =
|
||||
serverEngine.unwrap(clientHello, serverAppInbound);
|
||||
log("Server unwrap: ", serverResult);
|
||||
runDelegatedTasks(serverResult, serverEngine);
|
||||
|
||||
//
|
||||
// Generate server responses to the ClientHello request.
|
||||
//
|
||||
ByteBuffer clientNetInbound =
|
||||
ByteBuffer.allocate(session.getPacketBufferSize());
|
||||
ByteBuffer clientAppInbound =
|
||||
ByteBuffer.wrap("Hello Client, I'm Server".getBytes());
|
||||
|
||||
serverResult = serverEngine.wrap(clientAppInbound, clientNetInbound);
|
||||
log("Server wrap: ", serverResult);
|
||||
runDelegatedTasks(serverResult, serverEngine);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a ClientHello message.
|
||||
*/
|
||||
abstract protected byte[] createClientHelloMessage();
|
||||
|
||||
/*
|
||||
* Create an instance of SSLContext for client use.
|
||||
*/
|
||||
protected SSLContext createClientSSLContext() throws Exception {
|
||||
return createSSLContext(trustedCertStrs, null, null, null);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an instance of SSLContext for server use.
|
||||
*/
|
||||
protected SSLContext createServerSSLContext() throws Exception {
|
||||
return createSSLContext(null,
|
||||
endEntityCertStrs, endEntityPrivateKeys,
|
||||
endEntityPrivateKeyNames);
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an instance of SSLContext with the specified trust/key materials.
|
||||
*/
|
||||
protected SSLContext createSSLContext(
|
||||
String[] trustedMaterials,
|
||||
String[] keyMaterialCerts,
|
||||
String[] keyMaterialKeys,
|
||||
String[] keyMaterialKeyAlgs) throws Exception {
|
||||
|
||||
KeyStore ts = null; // trust store
|
||||
KeyStore ks = null; // key store
|
||||
char passphrase[] = "passphrase".toCharArray();
|
||||
|
||||
// Generate certificate from cert string.
|
||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||
|
||||
// Import the trused certs.
|
||||
ByteArrayInputStream is;
|
||||
if (trustedMaterials != null && trustedMaterials.length != 0) {
|
||||
ts = KeyStore.getInstance("JKS");
|
||||
ts.load(null, null);
|
||||
|
||||
Certificate[] trustedCert =
|
||||
new Certificate[trustedMaterials.length];
|
||||
for (int i = 0; i < trustedMaterials.length; i++) {
|
||||
String trustedCertStr = trustedMaterials[i];
|
||||
|
||||
is = new ByteArrayInputStream(trustedCertStr.getBytes());
|
||||
try {
|
||||
trustedCert[i] = cf.generateCertificate(is);
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
|
||||
ts.setCertificateEntry("trusted-cert-" + i, trustedCert[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Import the key materials.
|
||||
//
|
||||
// Note that certification pathes bigger than one are not supported yet.
|
||||
boolean hasKeyMaterials =
|
||||
(keyMaterialCerts != null) && (keyMaterialCerts.length != 0) &&
|
||||
(keyMaterialKeys != null) && (keyMaterialKeys.length != 0) &&
|
||||
(keyMaterialKeyAlgs != null) && (keyMaterialKeyAlgs.length != 0) &&
|
||||
(keyMaterialCerts.length == keyMaterialKeys.length) &&
|
||||
(keyMaterialCerts.length == keyMaterialKeyAlgs.length);
|
||||
if (hasKeyMaterials) {
|
||||
ks = KeyStore.getInstance("JKS");
|
||||
ks.load(null, null);
|
||||
|
||||
for (int i = 0; i < keyMaterialCerts.length; i++) {
|
||||
String keyCertStr = keyMaterialCerts[i];
|
||||
|
||||
// generate the private key.
|
||||
PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec(
|
||||
Base64.getMimeDecoder().decode(keyMaterialKeys[i]));
|
||||
KeyFactory kf =
|
||||
KeyFactory.getInstance(keyMaterialKeyAlgs[i]);
|
||||
PrivateKey priKey = kf.generatePrivate(priKeySpec);
|
||||
|
||||
// generate certificate chain
|
||||
is = new ByteArrayInputStream(keyCertStr.getBytes());
|
||||
Certificate keyCert = null;
|
||||
try {
|
||||
keyCert = cf.generateCertificate(is);
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
|
||||
Certificate[] chain = new Certificate[] { keyCert };
|
||||
|
||||
// import the key entry.
|
||||
ks.setKeyEntry("cert-" + i, priKey, passphrase, chain);
|
||||
}
|
||||
}
|
||||
|
||||
// Create an SSLContext object.
|
||||
TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
|
||||
tmf.init(ts);
|
||||
|
||||
SSLContext context = SSLContext.getInstance("TLS");
|
||||
if (hasKeyMaterials && ks != null) {
|
||||
KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509");
|
||||
kmf.init(ks, passphrase);
|
||||
|
||||
context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
|
||||
} else {
|
||||
context.init(null, tmf.getTrustManagers(), null);
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an instance of SSLEngine in client mode.
|
||||
*/
|
||||
protected SSLEngine createClientEngine() throws Exception {
|
||||
return createClientEngine(createClientSSLContext());
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an instance of SSLEngine in client mode with the
|
||||
* specified SSLContext object.
|
||||
*/
|
||||
protected SSLEngine createClientEngine(
|
||||
SSLContext context) throws Exception {
|
||||
|
||||
SSLEngine engine = context.createSSLEngine();
|
||||
engine.setUseClientMode(true);
|
||||
|
||||
/*
|
||||
* Customize the SSLEngine object.
|
||||
*/
|
||||
// blank
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an instance of SSLEngine in server mode.
|
||||
*/
|
||||
protected SSLEngine createServerEngine() throws Exception {
|
||||
return createServerEngine(createServerSSLContext());
|
||||
}
|
||||
|
||||
/*
|
||||
* Create an instance of SSLEngine in server mode with the
|
||||
* specified SSLContext object.
|
||||
*/
|
||||
protected SSLEngine createServerEngine(
|
||||
SSLContext context) throws Exception {
|
||||
|
||||
SSLEngine engine = context.createSSLEngine();
|
||||
engine.setUseClientMode(false);
|
||||
|
||||
/*
|
||||
* Customize the SSLEngine object.
|
||||
*/
|
||||
engine.setNeedClientAuth(false);
|
||||
|
||||
return engine;
|
||||
}
|
||||
|
||||
/*
|
||||
* Run the delagayed tasks if any.
|
||||
*
|
||||
* If the result indicates that we have outstanding tasks to do,
|
||||
* go ahead and run them in this thread.
|
||||
*/
|
||||
protected static void runDelegatedTasks(SSLEngineResult result,
|
||||
SSLEngine engine) throws Exception {
|
||||
|
||||
if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) {
|
||||
Runnable runnable;
|
||||
while ((runnable = engine.getDelegatedTask()) != null) {
|
||||
log("\trunning delegated task...");
|
||||
runnable.run();
|
||||
}
|
||||
HandshakeStatus hsStatus = engine.getHandshakeStatus();
|
||||
if (hsStatus == HandshakeStatus.NEED_TASK) {
|
||||
throw new Exception(
|
||||
"handshake shouldn't need additional tasks");
|
||||
}
|
||||
log("\tnew HandshakeStatus: " + hsStatus);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Logging the specificated message and the SSLEngine operation result.
|
||||
*/
|
||||
protected static void log(String str, SSLEngineResult result) {
|
||||
HandshakeStatus hsStatus = result.getHandshakeStatus();
|
||||
log(str +
|
||||
result.getStatus() + "/" + hsStatus + ", consumed: " +
|
||||
result.bytesConsumed() + "/produced: " + result.bytesProduced() +
|
||||
" bytes");
|
||||
|
||||
if (hsStatus == HandshakeStatus.FINISHED) {
|
||||
log("\t...ready for application data");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Logging the specificated message.
|
||||
*/
|
||||
protected static void log(String str) {
|
||||
System.out.println(str);
|
||||
}
|
||||
}
|
122
jdk/test/lib/security/SecurityTools.java
Normal file
122
jdk/test/lib/security/SecurityTools.java
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import jdk.testlibrary.JDKToolLauncher;
|
||||
import jdk.testlibrary.OutputAnalyzer;
|
||||
import jdk.testlibrary.ProcessTools;
|
||||
|
||||
public class SecurityTools {
|
||||
|
||||
public static final String NO_ALIAS = null;
|
||||
|
||||
// keytool
|
||||
|
||||
public static OutputAnalyzer keytool(List<String> options)
|
||||
throws Throwable {
|
||||
|
||||
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("keytool")
|
||||
.addVMArg("-Duser.language=en")
|
||||
.addVMArg("-Duser.country=US");
|
||||
for (String option : options) {
|
||||
if (option.startsWith("-J")) {
|
||||
launcher.addVMArg(option.substring(2));
|
||||
} else {
|
||||
launcher.addToolArg(option);
|
||||
}
|
||||
}
|
||||
return ProcessTools.executeCommand(launcher.getCommand());
|
||||
}
|
||||
|
||||
public static OutputAnalyzer keytool(String options) throws Throwable {
|
||||
return keytool(options.split("\\s+"));
|
||||
}
|
||||
|
||||
public static OutputAnalyzer keytool(String... options) throws Throwable {
|
||||
return keytool(List.of(options));
|
||||
}
|
||||
|
||||
// jarsigner
|
||||
|
||||
public static OutputAnalyzer jarsigner(String jar, String alias,
|
||||
List<String> options) throws Throwable {
|
||||
JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jarsigner")
|
||||
.addVMArg("-Duser.language=en")
|
||||
.addVMArg("-Duser.country=US");
|
||||
for (String option : options) {
|
||||
if (option.startsWith("-J")) {
|
||||
launcher.addVMArg(option.substring(2));
|
||||
} else {
|
||||
launcher.addToolArg(option);
|
||||
}
|
||||
}
|
||||
launcher.addToolArg(jar);
|
||||
if (alias != null) {
|
||||
launcher.addToolArg(alias);
|
||||
}
|
||||
return ProcessTools.executeCommand(launcher.getCommand());
|
||||
}
|
||||
|
||||
public static OutputAnalyzer jarsigner(String jar, String alias,
|
||||
String options) throws Throwable {
|
||||
|
||||
return jarsigner(jar, alias, options.split("\\s+"));
|
||||
}
|
||||
|
||||
public static OutputAnalyzer jarsigner(String jar, String alias,
|
||||
String... options) throws Throwable {
|
||||
|
||||
return jarsigner(jar, alias, List.of(options));
|
||||
}
|
||||
|
||||
public static OutputAnalyzer sign(String jar, String alias, String... options)
|
||||
throws Throwable {
|
||||
|
||||
return jarsigner(jar, alias,
|
||||
mergeOptions("-J-Djava.security.egd=file:/dev/./urandom", options));
|
||||
}
|
||||
|
||||
public static OutputAnalyzer verify(String jar, String... options)
|
||||
throws Throwable {
|
||||
|
||||
return jarsigner(jar, NO_ALIAS, mergeOptions("-verify", options));
|
||||
}
|
||||
|
||||
// helper methods
|
||||
|
||||
private static List<String> mergeOptions(
|
||||
String firstOption, String... secondPart) {
|
||||
|
||||
return mergeOptions(List.of(firstOption), secondPart);
|
||||
}
|
||||
|
||||
private static List<String> mergeOptions(
|
||||
List<String> firstPart, String... secondPart) {
|
||||
|
||||
List<String> options = new ArrayList<>(firstPart);
|
||||
Collections.addAll(options, secondPart);
|
||||
return options;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -21,10 +21,25 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
import com.sun.net.httpserver.*;
|
||||
/*
|
||||
* @test
|
||||
* @bug 6427251 6382788
|
||||
* @modules jdk.httpserver
|
||||
* @run main RetryPost
|
||||
* @run main/othervm -Dsun.net.http.retryPost=false RetryPost noRetry
|
||||
* @summary HttpURLConnection automatically retries non-idempotent method POST
|
||||
*/
|
||||
|
||||
import com.sun.net.httpserver.HttpContext;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.net.SocketException;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
|
@ -1,68 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @bug 6427251 6382788
|
||||
# @run shell/timeout=140 RetryPost.sh
|
||||
# @summary HttpURLConnection automatically retries non-idempotent method POST
|
||||
|
||||
OS=`uname -s`
|
||||
case "$OS" in
|
||||
SunOS | Linux | Darwin | AIX )
|
||||
PS=":"
|
||||
FS="/"
|
||||
;;
|
||||
CYGWIN* )
|
||||
PS=";"
|
||||
FS="/"
|
||||
;;
|
||||
Windows* )
|
||||
PS=";"
|
||||
FS="\\"
|
||||
;;
|
||||
* )
|
||||
echo "Unrecognized system!"
|
||||
exit 1;
|
||||
;;
|
||||
esac
|
||||
|
||||
# compile
|
||||
${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}RetryPost.java
|
||||
|
||||
# run with no option specified. Should retry POST request.
|
||||
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RetryPost
|
||||
result=$?
|
||||
if [ "$result" -ne "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# run with option specified. Should not retry POST request.
|
||||
${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dsun.net.http.retryPost=false RetryPost noRetry
|
||||
result=$?
|
||||
if [ "$result" -ne "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# no failures, exit.
|
||||
exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,14 +24,19 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8004863
|
||||
* @modules jdk.httpserver
|
||||
* @summary Checks for proper close code in KeepAliveStream
|
||||
*/
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import java.io.*;
|
||||
import java.net.*;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URL;
|
||||
import java.util.concurrent.Phaser;
|
||||
|
||||
// Racey test, will not always fail, but if it does then we have a problem.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,11 +26,19 @@
|
||||
* @summary Sanity check that NTLM will not be selected by the http protocol
|
||||
* handler when running on a profile that does not support NTLM
|
||||
* @modules java.base/sun.net.www
|
||||
* java.base/sun.net.www.protocol.http
|
||||
* @run main/othervm NoNTLM
|
||||
*/
|
||||
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Authenticator;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.net.URL;
|
||||
import sun.net.www.MessageHeader;
|
||||
|
||||
public class NoNTLM {
|
||||
@ -208,11 +216,14 @@ public class NoNTLM {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// assume NTLM is not supported when Kerberos is not available
|
||||
try {
|
||||
Class.forName("javax.security.auth.kerberos.KerberosPrincipal");
|
||||
System.out.println("Kerberos is present, assuming NTLM is supported too");
|
||||
return;
|
||||
Class<?> ntlmProxyClass = Class.forName("sun.net.www.protocol.http.NTLMAuthenticationProxy", true, NoNTLM.class.getClassLoader());
|
||||
Field ntlmSupportedField = ntlmProxyClass.getDeclaredField("supported");
|
||||
ntlmSupportedField.setAccessible(true);
|
||||
if (ntlmSupportedField.getBoolean(null)) {
|
||||
System.out.println("NTLM is supported. Nothing to do. Exiting.");
|
||||
return;
|
||||
}
|
||||
} catch (ClassNotFoundException okay) { }
|
||||
|
||||
// setup Authenticator
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -1211,18 +1211,26 @@ public class KeyToolTest {
|
||||
void sqePrintcertTest() throws Exception {
|
||||
remove("x.jks");
|
||||
remove("mykey.cert");
|
||||
remove("myweakkey.cert");
|
||||
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
|
||||
"-keypass changeit -genkeypair -dname CN=olala");
|
||||
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
|
||||
"-export -file mykey.cert -alias mykey");
|
||||
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
|
||||
"-keypass changeit -genkeypair -dname CN=weak -keyalg rsa " +
|
||||
"-keysize 512 -sigalg MD5withRSA -alias myweakkey");
|
||||
testOK("", "-keystore x.jks -storetype JKS -storepass changeit " +
|
||||
"-export -file myweakkey.cert -alias myweakkey");
|
||||
testFail("", "-printcert -file badkeystore");
|
||||
testFail("", "-printcert -file a/b/c/d");
|
||||
testOK("", "-printcert -file mykey.cert");
|
||||
testOK("", "-printcert -file myweakkey.cert");
|
||||
FileInputStream fin = new FileInputStream("mykey.cert");
|
||||
testOK(fin, "-printcert");
|
||||
fin.close();
|
||||
remove("x.jks");
|
||||
remove("mykey.cert");
|
||||
remove("myweakkey.cert");
|
||||
}
|
||||
|
||||
// 8074935: jdk8 keytool doesn't validate pem files for RFC 1421 correctness
|
||||
|
@ -24,20 +24,32 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 6480981 8160624
|
||||
* @modules java.base/sun.security.tools.keytool
|
||||
* @summary keytool should be able to import certificates from remote SSL server
|
||||
* @library /lib/security
|
||||
* @library /lib/testlibrary
|
||||
* @run main/othervm PrintSSL
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import javax.net.ssl.SSLServerSocketFactory;
|
||||
import javax.net.ssl.SSLSocket;
|
||||
import jdk.testlibrary.OutputAnalyzer;
|
||||
|
||||
public class PrintSSL {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
public static void main(String[] args) throws Throwable {
|
||||
Files.deleteIfExists(Paths.get("keystore"));
|
||||
|
||||
// make sure that "-printcert" works with weak algorithms
|
||||
OutputAnalyzer out = SecurityTools.keytool("-genkeypair "
|
||||
+ "-keystore keystore -storepass passphrase "
|
||||
+ "-keypass passphrase -keyalg rsa -keysize 512 "
|
||||
+ "-sigalg MD5withRSA -alias rsa_alias -dname CN=Server");
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
int port = new Server().start();
|
||||
if(port == -1) {
|
||||
@ -47,7 +59,10 @@ public class PrintSSL {
|
||||
String cmd = String.format(
|
||||
"-debug %s -printcert -sslserver localhost:%s",
|
||||
((vmOpt == null) ? "" : vmOpt ), port);
|
||||
sun.security.tools.keytool.Main.main(cmd.split("\\s+"));
|
||||
|
||||
out = SecurityTools.keytool(cmd);
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
}
|
||||
|
||||
private static class Server implements Runnable {
|
||||
@ -68,9 +83,7 @@ public class PrintSSL {
|
||||
public void run() {
|
||||
|
||||
System.setProperty("javax.net.ssl.keyStorePassword", "passphrase");
|
||||
System.setProperty("javax.net.ssl.keyStore",
|
||||
System.getProperty("test.src", "./")
|
||||
+ "/../../../../javax/net/ssl/etc/keystore");
|
||||
System.setProperty("javax.net.ssl.keyStore", "keystore");
|
||||
SSLServerSocketFactory sslssf =
|
||||
(SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
|
||||
try (ServerSocket server = sslssf.createServerSocket(0)) {
|
||||
|
86
jdk/test/sun/security/tools/keytool/ReadJar.java
Normal file
86
jdk/test/sun/security/tools/keytool/ReadJar.java
Normal file
@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 6890872 8168882
|
||||
* @summary keytool -printcert to recognize signed jar files
|
||||
* @library /lib/security
|
||||
* @library /lib/testlibrary
|
||||
*/
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import jdk.testlibrary.JarUtils;
|
||||
import jdk.testlibrary.OutputAnalyzer;
|
||||
|
||||
public class ReadJar {
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
testWithMD5();
|
||||
}
|
||||
|
||||
// make sure that -printcert option works
|
||||
// if a weak algorithm was used for signing a jar
|
||||
private static void testWithMD5() throws Throwable {
|
||||
// create jar files
|
||||
JarUtils.createJar("test_md5.jar", "test");
|
||||
JarUtils.createJar("test_rsa.jar", "test");
|
||||
|
||||
// create a keystore and generate keys for jar signing
|
||||
Files.deleteIfExists(Paths.get("keystore"));
|
||||
|
||||
OutputAnalyzer out = SecurityTools.keytool("-genkeypair "
|
||||
+ "-keystore keystore -storepass password "
|
||||
+ "-keypass password -keyalg rsa -alias rsa_alias -dname CN=A");
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
out = SecurityTools.jarsigner("test_rsa.jar", "rsa_alias",
|
||||
"-keystore keystore -storepass password ");
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
printCert("test_rsa.jar");
|
||||
|
||||
out = SecurityTools.jarsigner("test_md5.jar", "rsa_alias",
|
||||
"-keystore keystore -storepass password "
|
||||
+ "-sigalg MD5withRSA -digestalg MD5");
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
printCert("test_md5.jar");
|
||||
}
|
||||
|
||||
private static void printCert(String jar) throws Throwable {
|
||||
OutputAnalyzer out = SecurityTools.keytool("-printcert -jarfile " + jar);
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
out.shouldNotContain("Not a signed jar file");
|
||||
|
||||
out = SecurityTools.keytool("-printcert -rfc -jarfile " + jar);
|
||||
System.out.println(out.getOutput());
|
||||
out.shouldHaveExitValue(0);
|
||||
out.shouldNotContain("Not a signed jar file");
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
# @test
|
||||
# @bug 6890872
|
||||
# @summary keytool -printcert to recognize signed jar files
|
||||
#
|
||||
|
||||
if [ "${TESTJAVA}" = "" ] ; then
|
||||
JAVAC_CMD=`which javac`
|
||||
TESTJAVA=`dirname $JAVAC_CMD`/..
|
||||
COMPILEJAVA=${TESTJAVA}
|
||||
fi
|
||||
|
||||
# set platform-dependent variables
|
||||
OS=`uname -s`
|
||||
case "$OS" in
|
||||
Windows_* )
|
||||
FS="\\"
|
||||
;;
|
||||
* )
|
||||
FS="/"
|
||||
;;
|
||||
esac
|
||||
|
||||
KS=readjar.jks
|
||||
rm $KS
|
||||
$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -storepass changeit -keypass changeit -keystore $KS \
|
||||
-keyalg rsa -alias x -dname CN=X -genkeypair
|
||||
$COMPILEJAVA${FS}bin${FS}jar ${TESTTOOLVMOPTS} cvf readjar.jar $KS
|
||||
$COMPILEJAVA${FS}bin${FS}jarsigner ${TESTTOOLVMOPTS} -storepass changeit -keystore $KS readjar.jar x
|
||||
|
||||
$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -jarfile readjar.jar || exit 1
|
||||
$TESTJAVA${FS}bin${FS}keytool ${TESTTOOLVMOPTS} -printcert -jarfile readjar.jar -rfc || exit 1
|
||||
|
||||
exit 0
|
||||
|
@ -21,4 +21,4 @@
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
tzdata2016h
|
||||
tzdata2016i
|
||||
|
@ -87,13 +87,18 @@
|
||||
# Background:
|
||||
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
|
||||
|
||||
# From Steffen Thorsen (2016-10-28):
|
||||
# Australian Antarctica Division informed us that Casey changed time
|
||||
# zone to UTC+11 in "the morning of 22nd October 2016".
|
||||
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Antarctica/Casey 0 - -00 1969
|
||||
8:00 - +08 2009 Oct 18 2:00
|
||||
11:00 - +11 2010 Mar 5 2:00
|
||||
8:00 - +08 2011 Oct 28 2:00
|
||||
11:00 - +11 2012 Feb 21 17:00u
|
||||
8:00 - +08
|
||||
8:00 - +08 2016 Oct 22
|
||||
11:00 - +11
|
||||
Zone Antarctica/Davis 0 - -00 1957 Jan 13
|
||||
7:00 - +07 1964 Nov
|
||||
0 - -00 1969 Feb
|
||||
|
@ -794,9 +794,19 @@ Zone Asia/Macau 7:34:20 - LMT 1912 Jan 1
|
||||
###############################################################################
|
||||
|
||||
# Cyprus
|
||||
#
|
||||
|
||||
# Milne says the Eastern Telegraph Company used 2:14:00. Stick with LMT.
|
||||
# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
|
||||
|
||||
# From Paul Eggert (2016-09-09):
|
||||
# Yesterday's Cyprus Mail reports that Northern Cyprus followed Turkey's
|
||||
# lead and switched from +02/+03 to +03 year-round.
|
||||
# http://cyprus-mail.com/2016/09/08/two-time-zones-cyprus-turkey-will-not-turn-clocks-back-next-month/
|
||||
#
|
||||
# From Even Scharning (2016-10-31):
|
||||
# Looks like the time zone split in Cyprus went through last night.
|
||||
# http://cyprus-mail.com/2016/10/30/cyprus-new-division-two-time-zones-now-reality/
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Cyprus 1975 only - Apr 13 0:00 1:00 S
|
||||
Rule Cyprus 1975 only - Oct 12 0:00 0 -
|
||||
@ -811,7 +821,10 @@ Rule Cyprus 1981 1998 - Mar lastSun 0:00 1:00 S
|
||||
Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14
|
||||
2:00 Cyprus EE%sT 1998 Sep
|
||||
2:00 EUAsia EE%sT
|
||||
# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
|
||||
Zone Asia/Famagusta 2:15:48 - LMT 1921 Nov 14
|
||||
2:00 Cyprus EE%sT 1998 Sep
|
||||
2:00 EUAsia EE%sT 2016 Sep 8
|
||||
3:00 - +03
|
||||
|
||||
# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
|
||||
# However, for various reasons many users expect to find it under Europe.
|
||||
|
@ -725,11 +725,13 @@ Rule Tonga 1999 only - Oct 7 2:00s 1:00 S
|
||||
Rule Tonga 2000 only - Mar 19 2:00s 0 -
|
||||
Rule Tonga 2000 2001 - Nov Sun>=1 2:00 1:00 S
|
||||
Rule Tonga 2001 2002 - Jan lastSun 2:00 0 -
|
||||
Rule Tonga 2016 max - Nov Sun>=1 2:00 1:00 S
|
||||
Rule Tonga 2017 max - Jan Sun>=15 3:00 0 -
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Pacific/Tongatapu 12:19:20 - LMT 1901
|
||||
12:20 - TOT 1941 # Tonga Time
|
||||
13:00 - TOT 1999
|
||||
13:00 Tonga TO%sT
|
||||
12:20 - +1220 1941
|
||||
13:00 - +13 1999
|
||||
13:00 Tonga +13/+14
|
||||
|
||||
# Tuvalu
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
@ -1735,9 +1737,17 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901
|
||||
# of January the standard time in the Kingdom shall be moved backward by one
|
||||
# hour to 1:00am.
|
||||
|
||||
# From Pulu 'Anau (2002-11-05):
|
||||
# From Pulu ʻAnau (2002-11-05):
|
||||
# The law was for 3 years, supposedly to get renewed. It wasn't.
|
||||
|
||||
# From Pulu ʻAnau (2016-10-27):
|
||||
# http://mic.gov.to/news-today/press-releases/6375-daylight-saving-set-to-run-from-6-november-2016-to-15-january-2017
|
||||
# Cannot find anyone who knows the rules, has seen the duration or has seen
|
||||
# the cabinet decision, but it appears we are following Fiji's rule set.
|
||||
#
|
||||
# From Tim Parenti (2016-10-26):
|
||||
# Assume Tonga will observe DST from the first Sunday in November at 02:00
|
||||
# through the third Sunday in January at 03:00, like Fiji, for now.
|
||||
|
||||
# Wake
|
||||
|
||||
|
@ -1523,73 +1523,84 @@ Zone Atlantic/Reykjavik -1:28 - LMT 1908
|
||||
# But these events all occurred before the 1970 cutoff,
|
||||
# so record only the time in Rome.
|
||||
#
|
||||
# From Paul Eggert (2006-03-22):
|
||||
# For Italian DST we have three sources: Shanks & Pottenger, Whitman, and
|
||||
# F. Pollastri
|
||||
# Day-light Saving Time in Italy (2006-02-03)
|
||||
# http://toi.iriti.cnr.it/uk/ienitlt.html
|
||||
# ('FP' below), taken from an Italian National Electrotechnical Institute
|
||||
# publication. When the three sources disagree, guess who's right, as follows:
|
||||
# From Michael Deckers (2016-10-24):
|
||||
# http://www.ac-ilsestante.it/MERIDIANE/ora_legale quotes a law of 1893-08-10
|
||||
# ... [translated as] "The preceding dispositions will enter into
|
||||
# force at the instant at which, according to the time specified in
|
||||
# the 1st article, the 1st of November 1893 will begin...."
|
||||
#
|
||||
# year FP Shanks&P. (S) Whitman (W) Go with:
|
||||
# 1916 06-03 06-03 24:00 06-03 00:00 FP & W
|
||||
# 09-30 09-30 24:00 09-30 01:00 FP; guess 24:00s
|
||||
# 1917 04-01 03-31 24:00 03-31 00:00 FP & S
|
||||
# 09-30 09-29 24:00 09-30 01:00 FP & W
|
||||
# 1918 03-09 03-09 24:00 03-09 00:00 FP & S
|
||||
# 10-06 10-05 24:00 10-06 01:00 FP & W
|
||||
# 1919 03-01 03-01 24:00 03-01 00:00 FP & S
|
||||
# 10-04 10-04 24:00 10-04 01:00 FP; guess 24:00s
|
||||
# 1920 03-20 03-20 24:00 03-20 00:00 FP & S
|
||||
# 09-18 09-18 24:00 10-01 01:00 FP; guess 24:00s
|
||||
# 1944 04-02 04-03 02:00 S (see C-Eur)
|
||||
# 09-16 10-02 03:00 FP; guess 24:00s
|
||||
# 1945 09-14 09-16 24:00 FP; guess 24:00s
|
||||
# 1970 05-21 05-31 00:00 S
|
||||
# 09-20 09-27 00:00 S
|
||||
# From Pierpaolo Bernardi (2016-10-20):
|
||||
# The authoritative source for time in Italy is the national metrological
|
||||
# institute, which has a summary page of historical DST data at
|
||||
# http://www.inrim.it/res/tf/ora_legale_i.shtml
|
||||
# (2016-10-24):
|
||||
# http://www.renzobaldini.it/le-ore-legali-in-italia/
|
||||
# has still different data for 1944. It divides Italy in two, as
|
||||
# there were effectively two governments at the time, north of Gothic
|
||||
# Line German controlled territory, official government RSI, and south
|
||||
# of the Gothic Line, controlled by allied armies.
|
||||
#
|
||||
# From Brian Inglis (2016-10-23):
|
||||
# Viceregal LEGISLATIVE DECREE. 14 September 1944, no. 219.
|
||||
# Restoration of Standard Time. (044U0219) (OJ 62 of 30.9.1944) ...
|
||||
# Given the R. law decreed on 1944-03-29, no. 92, by which standard time is
|
||||
# advanced to sixty minutes later starting at hour two on 1944-04-02; ...
|
||||
# Starting at hour three on the date 1944-09-17 standard time will be resumed.
|
||||
#
|
||||
# From Paul Eggert (2016-10-27):
|
||||
# Go with INRiM for DST rules, except as corrected by Inglis for 1944
|
||||
# for the Kingdom of Italy. This is consistent with Renzo Baldini.
|
||||
# Model Rome's occupation by using using C-Eur rules from 1943-09-10
|
||||
# to 1944-06-04; although Rome was an open city during this period, it
|
||||
# was effectively controlled by Germany.
|
||||
#
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Italy 1916 only - Jun 3 0:00s 1:00 S
|
||||
Rule Italy 1916 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1917 only - Apr 1 0:00s 1:00 S
|
||||
Rule Italy 1917 only - Sep 30 0:00s 0 -
|
||||
Rule Italy 1918 only - Mar 10 0:00s 1:00 S
|
||||
Rule Italy 1918 1919 - Oct Sun>=1 0:00s 0 -
|
||||
Rule Italy 1919 only - Mar 2 0:00s 1:00 S
|
||||
Rule Italy 1920 only - Mar 21 0:00s 1:00 S
|
||||
Rule Italy 1920 only - Sep 19 0:00s 0 -
|
||||
Rule Italy 1940 only - Jun 15 0:00s 1:00 S
|
||||
Rule Italy 1944 only - Sep 17 0:00s 0 -
|
||||
Rule Italy 1945 only - Apr 2 2:00 1:00 S
|
||||
Rule Italy 1945 only - Sep 15 0:00s 0 -
|
||||
Rule Italy 1946 only - Mar 17 2:00s 1:00 S
|
||||
Rule Italy 1946 only - Oct 6 2:00s 0 -
|
||||
Rule Italy 1947 only - Mar 16 0:00s 1:00 S
|
||||
Rule Italy 1947 only - Oct 5 0:00s 0 -
|
||||
Rule Italy 1948 only - Feb 29 2:00s 1:00 S
|
||||
Rule Italy 1948 only - Oct 3 2:00s 0 -
|
||||
Rule Italy 1966 1968 - May Sun>=22 0:00 1:00 S
|
||||
Rule Italy 1966 1969 - Sep Sun>=22 0:00 0 -
|
||||
Rule Italy 1969 only - Jun 1 0:00 1:00 S
|
||||
Rule Italy 1970 only - May 31 0:00 1:00 S
|
||||
Rule Italy 1970 only - Sep lastSun 0:00 0 -
|
||||
Rule Italy 1971 1972 - May Sun>=22 0:00 1:00 S
|
||||
Rule Italy 1971 only - Sep lastSun 1:00 0 -
|
||||
Rule Italy 1972 only - Oct 1 0:00 0 -
|
||||
Rule Italy 1973 only - Jun 3 0:00 1:00 S
|
||||
Rule Italy 1973 1974 - Sep lastSun 0:00 0 -
|
||||
Rule Italy 1974 only - May 26 0:00 1:00 S
|
||||
Rule Italy 1975 only - Jun 1 0:00s 1:00 S
|
||||
Rule Italy 1975 1977 - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1976 only - May 30 0:00s 1:00 S
|
||||
Rule Italy 1977 1979 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1978 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1979 only - Sep 30 0:00s 0 -
|
||||
Rule Italy 1916 only - Jun 3 24:00 1:00 S
|
||||
Rule Italy 1916 1917 - Sep 30 24:00 0 -
|
||||
Rule Italy 1917 only - Mar 31 24:00 1:00 S
|
||||
Rule Italy 1918 only - Mar 9 24:00 1:00 S
|
||||
Rule Italy 1918 only - Oct 6 24:00 0 -
|
||||
Rule Italy 1919 only - Mar 1 24:00 1:00 S
|
||||
Rule Italy 1919 only - Oct 4 24:00 0 -
|
||||
Rule Italy 1920 only - Mar 20 24:00 1:00 S
|
||||
Rule Italy 1920 only - Sep 18 24:00 0 -
|
||||
Rule Italy 1940 only - Jun 14 24:00 1:00 S
|
||||
Rule Italy 1942 only - Nov 2 2:00s 0 -
|
||||
Rule Italy 1943 only - Mar 29 2:00s 1:00 S
|
||||
Rule Italy 1943 only - Oct 4 2:00s 0 -
|
||||
Rule Italy 1944 only - Apr 2 2:00s 1:00 S
|
||||
Rule Italy 1944 only - Sep 17 2:00s 0 -
|
||||
Rule Italy 1945 only - Apr 2 2:00 1:00 S
|
||||
Rule Italy 1945 only - Sep 15 1:00 0 -
|
||||
Rule Italy 1946 only - Mar 17 2:00s 1:00 S
|
||||
Rule Italy 1946 only - Oct 6 2:00s 0 -
|
||||
Rule Italy 1947 only - Mar 16 0:00s 1:00 S
|
||||
Rule Italy 1947 only - Oct 5 0:00s 0 -
|
||||
Rule Italy 1948 only - Feb 29 2:00s 1:00 S
|
||||
Rule Italy 1948 only - Oct 3 2:00s 0 -
|
||||
Rule Italy 1966 1968 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1966 only - Sep 24 24:00 0 -
|
||||
Rule Italy 1967 1969 - Sep Sun>=22 0:00s 0 -
|
||||
Rule Italy 1969 only - Jun 1 0:00s 1:00 S
|
||||
Rule Italy 1970 only - May 31 0:00s 1:00 S
|
||||
Rule Italy 1970 only - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1971 1972 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1971 only - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1972 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1973 only - Jun 3 0:00s 1:00 S
|
||||
Rule Italy 1973 1974 - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1974 only - May 26 0:00s 1:00 S
|
||||
Rule Italy 1975 only - Jun 1 0:00s 1:00 S
|
||||
Rule Italy 1975 1977 - Sep lastSun 0:00s 0 -
|
||||
Rule Italy 1976 only - May 30 0:00s 1:00 S
|
||||
Rule Italy 1977 1979 - May Sun>=22 0:00s 1:00 S
|
||||
Rule Italy 1978 only - Oct 1 0:00s 0 -
|
||||
Rule Italy 1979 only - Sep 30 0:00s 0 -
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Europe/Rome 0:49:56 - LMT 1866 Sep 22
|
||||
0:49:56 - RMT 1893 Nov 1 0:00s # Rome Mean
|
||||
1:00 Italy CE%sT 1942 Nov 2 2:00s
|
||||
1:00 C-Eur CE%sT 1944 Jul
|
||||
0:49:56 - RMT 1893 Oct 31 23:49:56 # Rome Mean
|
||||
1:00 Italy CE%sT 1943 Sep 10
|
||||
1:00 C-Eur CE%sT 1944 Jun 4
|
||||
1:00 Italy CE%sT 1980
|
||||
1:00 EU CE%sT
|
||||
|
||||
@ -1788,6 +1799,10 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun
|
||||
# See Europe/Belgrade.
|
||||
|
||||
# Malta
|
||||
#
|
||||
# From Paul Eggert (2016-10-21):
|
||||
# Assume 1900-1972 was like Rome, overriding Shanks.
|
||||
#
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Malta 1973 only - Mar 31 0:00s 1:00 S
|
||||
Rule Malta 1973 only - Sep 29 0:00s 0 -
|
||||
@ -1798,8 +1813,6 @@ Rule Malta 1975 1980 - Sep Sun>=15 2:00 0 -
|
||||
Rule Malta 1980 only - Mar 31 2:00 1:00 S
|
||||
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
||||
Zone Europe/Malta 0:58:04 - LMT 1893 Nov 2 0:00s # Valletta
|
||||
1:00 Italy CE%sT 1942 Nov 2 2:00s
|
||||
1:00 C-Eur CE%sT 1945 Apr 2 2:00s
|
||||
1:00 Italy CE%sT 1973 Mar 31
|
||||
1:00 Malta CE%sT 1981
|
||||
1:00 EU CE%sT
|
||||
@ -1931,7 +1944,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
|
||||
# Amsterdam mean time.
|
||||
|
||||
# The data entries before 1945 are taken from
|
||||
# http://www.staff.science.uu.nl/~gent0113/idl/idl.htm
|
||||
# http://www.staff.science.uu.nl/~gent0113/wettijd/wettijd.htm
|
||||
|
||||
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
|
||||
Rule Neth 1916 only - May 1 0:00 1:00 NST # Netherlands Summer Time
|
||||
|
@ -175,7 +175,8 @@ CU +2308-08222 America/Havana
|
||||
CV +1455-02331 Atlantic/Cape_Verde
|
||||
CW +1211-06900 America/Curacao
|
||||
CX -1025+10543 Indian/Christmas
|
||||
CY +3510+03322 Asia/Nicosia
|
||||
CY +3510+03322 Asia/Nicosia Cyprus (most areas)
|
||||
CY +3507+03357 Asia/Famagusta Northern Cyprus
|
||||
CZ +5005+01426 Europe/Prague
|
||||
DE +5230+01322 Europe/Berlin Germany (most areas)
|
||||
DE +4742+00841 Europe/Busingen Busingen
|
||||
|
@ -386,3 +386,4 @@ dd56c243c199a540c9f1fbff4855f0934b32a9d0 jdk-9+137
|
||||
296c875051187918f8f3f87e9432036d13013d39 jdk-9+141
|
||||
d245e56f4a79a8a8d18bd143c08f079ee98ab638 jdk-9+142
|
||||
6ef8a1453577832626b0efb7f70a3102b721ebbf jdk-9+143
|
||||
47871e348144bafddea0ede3a44299461e254a2d jdk-9+144
|
||||
|
@ -137,12 +137,18 @@ public abstract class Scope {
|
||||
/** Returns true iff the given Symbol is in this scope or any outward scope.
|
||||
*/
|
||||
public boolean includes(final Symbol sym) {
|
||||
return includes(sym, RECURSIVE);
|
||||
}
|
||||
|
||||
/** Returns true iff the given Symbol is in this scope, optionally checking outward scopes.
|
||||
*/
|
||||
public boolean includes(final Symbol sym, LookupKind lookupKind) {
|
||||
return getSymbolsByName(sym.name, new Filter<Symbol>() {
|
||||
@Override
|
||||
public boolean accepts(Symbol t) {
|
||||
return t == sym;
|
||||
}
|
||||
}).iterator().hasNext();
|
||||
}, lookupKind).iterator().hasNext();
|
||||
}
|
||||
|
||||
/** Returns true iff this scope does not contain any Symbol. Does not inspect outward scopes.
|
||||
|
@ -383,7 +383,19 @@ public class Symtab {
|
||||
addRootPackageFor(unnamedModule);
|
||||
unnamedModule.enclosedPackages = unnamedModule.enclosedPackages.prepend(unnamedModule.unnamedPackage);
|
||||
|
||||
errModule = new ModuleSymbol(names.empty, null) { };
|
||||
errModule = new ModuleSymbol(names.empty, null) {
|
||||
{
|
||||
directives = List.nil();
|
||||
exports = List.nil();
|
||||
provides = List.nil();
|
||||
uses = List.nil();
|
||||
ModuleSymbol java_base = enterModule(names.java_base);
|
||||
com.sun.tools.javac.code.Directive.RequiresDirective d =
|
||||
new com.sun.tools.javac.code.Directive.RequiresDirective(java_base,
|
||||
EnumSet.of(com.sun.tools.javac.code.Directive.RequiresFlag.MANDATED));
|
||||
requires = List.of(d);
|
||||
}
|
||||
};
|
||||
addRootPackageFor(errModule);
|
||||
|
||||
noModule = new ModuleSymbol(names.empty, null) {
|
||||
|
@ -293,8 +293,11 @@ public class Modules extends JCTree.Visitor {
|
||||
private void enterModule(JCCompilationUnit toplevel, ClassSymbol c, Set<ModuleSymbol> modules) {
|
||||
boolean isModuleInfo = toplevel.sourcefile.isNameCompatible("module-info", Kind.SOURCE);
|
||||
boolean isModuleDecl = toplevel.defs.nonEmpty() && toplevel.defs.head.hasTag(MODULEDEF);
|
||||
if (isModuleInfo && isModuleDecl) {
|
||||
if (isModuleDecl) {
|
||||
JCModuleDecl decl = (JCModuleDecl) toplevel.defs.head;
|
||||
if (!isModuleInfo) {
|
||||
log.error(decl.pos(), Errors.ModuleDeclSbInModuleInfoJava);
|
||||
}
|
||||
Name name = TreeInfo.fullName(decl.qualId);
|
||||
ModuleSymbol sym;
|
||||
if (c != null) {
|
||||
@ -330,9 +333,6 @@ public class Modules extends JCTree.Visitor {
|
||||
JCTree tree = toplevel.defs.isEmpty() ? toplevel : toplevel.defs.head;
|
||||
log.error(tree.pos(), Errors.ExpectedModule);
|
||||
}
|
||||
} else if (isModuleDecl) {
|
||||
JCTree tree = toplevel.defs.head;
|
||||
log.error(tree.pos(), Errors.ModuleDeclSbInModuleInfoJava);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,7 @@ import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
|
||||
|
||||
import static com.sun.tools.javac.code.Flags.*;
|
||||
import static com.sun.tools.javac.code.Kinds.Kind.*;
|
||||
import com.sun.tools.javac.code.Scope.LookupKind;
|
||||
import static com.sun.tools.javac.code.TypeTag.ARRAY;
|
||||
import static com.sun.tools.javac.code.TypeTag.CLASS;
|
||||
import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
|
||||
@ -2186,7 +2187,11 @@ public class ClassReader {
|
||||
// Sometimes anonymous classes don't have an outer
|
||||
// instance, however, there is no reliable way to tell so
|
||||
// we never strip this$n
|
||||
if (!currentOwner.name.isEmpty())
|
||||
// ditto for local classes. Local classes that have an enclosing method set
|
||||
// won't pass the "hasOuterInstance" check above, but those that don't have an
|
||||
// enclosing method (i.e. from initializers) will pass that check.
|
||||
boolean local = !currentOwner.owner.members().includes(currentOwner, LookupKind.NON_RECURSIVE);
|
||||
if (!currentOwner.name.isEmpty() && !local)
|
||||
type = new MethodType(adjustMethodParams(flags, type.getParameterTypes()),
|
||||
type.getReturnType(),
|
||||
type.getThrownTypes(),
|
||||
|
@ -35,6 +35,7 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
@ -43,6 +44,7 @@ import java.util.Map;
|
||||
import java.util.ServiceLoader;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
@ -200,31 +202,37 @@ public enum Option {
|
||||
// The standard file manager code knows to split apart the NULL-separated components.
|
||||
@Override
|
||||
public boolean process(OptionHelper helper, String option, String arg) {
|
||||
if (!arg.contains("=")) { // could be more strict regeex, e.g. "(?i)[a-z0-9_.]+=.*"
|
||||
helper.error(Errors.LocnInvalidArgForXpatch(arg));
|
||||
if (arg.isEmpty()) {
|
||||
helper.error("err.no.value.for.option", option);
|
||||
return true;
|
||||
} else if (getPattern().matcher(arg).matches()) {
|
||||
String prev = helper.get(PATCH_MODULE);
|
||||
if (prev == null) {
|
||||
super.process(helper, option, arg);
|
||||
return false;
|
||||
} else {
|
||||
String argModulePackage = arg.substring(0, arg.indexOf('='));
|
||||
boolean isRepeated = Arrays.stream(prev.split("\0"))
|
||||
.map(s -> s.substring(0, s.indexOf('=')))
|
||||
.collect(Collectors.toSet())
|
||||
.contains(argModulePackage);
|
||||
if (isRepeated) {
|
||||
helper.error("err.repeated.value.for.patch.module", argModulePackage);
|
||||
return true;
|
||||
} else {
|
||||
super.process(helper, option, prev + '\0' + arg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
helper.error("err.bad.value.for.option", option, arg);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
String previous = helper.get(this);
|
||||
if (previous == null) {
|
||||
return super.process(helper, option, arg);
|
||||
}
|
||||
|
||||
Map<String,String> map = new LinkedHashMap<>();
|
||||
for (String s : previous.split("\0")) {
|
||||
int sep = s.indexOf('=');
|
||||
map.put(s.substring(0, sep), s.substring(sep + 1));
|
||||
}
|
||||
|
||||
int sep = arg.indexOf('=');
|
||||
map.put(arg.substring(0, sep), arg.substring(sep + 1));
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
map.forEach((m, p) -> {
|
||||
if (sb.length() > 0)
|
||||
sb.append('\0');
|
||||
sb.append(m).append('=').append(p);
|
||||
});
|
||||
return super.process(helper, option, sb.toString());
|
||||
@Override
|
||||
public Pattern getPattern() {
|
||||
return Pattern.compile("([^/]+)=(,*[^,].*)");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -361,6 +361,8 @@ javac.err.bad.value.for.option=\
|
||||
bad value for {0} option: ''{1}''
|
||||
javac.err.no.value.for.option=\
|
||||
no value for {0} option
|
||||
javac.err.repeated.value.for.patch.module=\
|
||||
--patch-module specified more than once for {0}
|
||||
|
||||
## messages
|
||||
|
||||
|
@ -535,7 +535,7 @@ public abstract class AbstractMemberWriter {
|
||||
|
||||
TypeElement superClass = utils.getSuperClass(typeElement);
|
||||
while (superClass != null) {
|
||||
if (visibleMemberMap.hasMembersFor(superClass)) {
|
||||
if (visibleMemberMap.hasMembers(superClass)) {
|
||||
liNav.addContent(getNavSummaryLink(superClass, true));
|
||||
return;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user