--- a/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
a2cf4d4a484378caea2e827ed604b2bbae58bdba jdk8-b65
17820b958ae84f7c1cc6719319c8e2232f7a4f1d jdk8-b66
76cc9bd3ece407d3a15d3bea537b57927973c5e7 jdk8-b67
+cb33628d4e8f11e879c371959e5948b66a53376f jdk8-b68
--- a/.hgtags-top-repo Thu Dec 20 10:22:19 2012 +0100
+++ b/.hgtags-top-repo Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
b772de306dc24c17f7bd1398531ddeb58723b804 jdk8-b65
13bb8c326e7b7b0b19d78c8088033e3932e3f7ca jdk8-b66
9a6ec97ec45c1a62d5233cefa91e8390e380e13a jdk8-b67
+cdb401a60cea6ad5ef3f498725ed1decf8dda1ea jdk8-b68
--- a/common/autoconf/basics.m4 Thu Dec 20 10:22:19 2012 +0100
+++ b/common/autoconf/basics.m4 Mon Dec 24 11:46:38 2012 -0800
@@ -90,13 +90,25 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.])
+ new_path="$path"
+ fi
+
if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- AC_MSG_NOTICE([Resolving $1 (as $path) with 'which' failed, using $path directly.])
- new_path="$path"
- else
AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
has_space=`$ECHO "$complete" | $GREP " "`
if test "x$has_space" != x; then
@@ -104,20 +116,19 @@
fi
AC_MSG_ERROR([Cannot locate the the path of $1])
fi
- fi
fi
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- $1="$new_complete"
- AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
- fi
+ $1="$new_complete"
+ AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
+ fi
])
AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
--- a/common/autoconf/generated-configure.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/common/autoconf/generated-configure.sh Mon Dec 24 11:46:38 2012 -0800
@@ -3674,7 +3674,7 @@
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1355221914
+DATE_WHEN_GENERATED=1355849613
###############################################################################
#
@@ -8165,14 +8165,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -8182,21 +8194,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -8511,14 +8522,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -8528,21 +8551,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -8854,14 +8876,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -8871,21 +8905,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -9202,14 +9235,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -9219,21 +9264,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -9544,14 +9588,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -9561,21 +9617,20 @@
fi
as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- FOUND_MAKE="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+ FOUND_MAKE="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -16373,14 +16428,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving VS_ENV_CMD (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -16390,21 +16457,20 @@
fi
as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- VS_ENV_CMD="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
+ VS_ENV_CMD="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;}
- fi
+ fi
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
@@ -16962,14 +17028,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving BUILD_CC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -16979,21 +17057,20 @@
fi
as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- BUILD_CC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
+ BUILD_CC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;}
- fi
+ fi
for ac_prog in cl CC g++
do
@@ -17262,14 +17339,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving BUILD_CXX (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -17279,21 +17368,20 @@
fi
as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- BUILD_CXX="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
+ BUILD_CXX="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;}
- fi
+ fi
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
@@ -17557,14 +17645,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving BUILD_LD (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -17574,21 +17674,20 @@
fi
as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- BUILD_LD="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
+ BUILD_LD="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -18144,14 +18243,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -18161,21 +18272,20 @@
fi
as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
+ CC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;}
- fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5
$as_echo_n "checking resolved symbolic links for CC... " >&6; }
@@ -18569,14 +18679,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -18586,21 +18708,20 @@
fi
as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- PROPER_COMPILER_CC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
+ PROPER_COMPILER_CC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;}
- fi
+ fi
PATH="$RETRY_COMPILER_SAVED_PATH"
@@ -19691,14 +19812,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CXX (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CXX (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -19708,21 +19841,20 @@
fi
as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CXX="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
+ CXX="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;}
- fi
+ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5
$as_echo_n "checking resolved symbolic links for CXX... " >&6; }
@@ -20116,14 +20248,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -20133,21 +20277,20 @@
fi
as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- PROPER_COMPILER_CXX="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
+ PROPER_COMPILER_CXX="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;}
- fi
+ fi
PATH="$RETRY_COMPILER_SAVED_PATH"
@@ -21006,14 +21149,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving OBJC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -21023,21 +21178,20 @@
fi
as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- OBJC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
+ OBJC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;}
- fi
+ fi
else
OBJC=
@@ -21376,14 +21530,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving AR (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving AR (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -21393,21 +21559,20 @@
fi
as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- AR="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
+ AR="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;}
- fi
+ fi
fi
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
@@ -21712,14 +21877,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving WINLD (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -21729,21 +21906,20 @@
fi
as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- WINLD="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5
+ WINLD="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting WINLD to \"$new_complete\"" >&6;}
- fi
+ fi
printf "Windows linker was found at $WINLD\n"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5
@@ -22038,14 +22214,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving MT (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving MT (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -22055,21 +22243,20 @@
fi
as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- MT="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
+ MT="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;}
- fi
+ fi
# The resource compiler
# Extract the first word of "rc", so it can be a program name with args.
@@ -22348,14 +22535,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving RC (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving RC (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -22365,21 +22564,20 @@
fi
as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- RC="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
+ RC="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;}
- fi
+ fi
# For hotspot, we need these in Windows mixed path,
@@ -22711,14 +22909,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving WINAR (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -22728,21 +22938,20 @@
fi
as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- WINAR="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5
+ WINAR="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;}
- fi
+ fi
AR="$WINAR"
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
@@ -23006,14 +23215,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving DUMPBIN (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -23023,21 +23244,20 @@
fi
as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- DUMPBIN="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
+ DUMPBIN="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;}
- fi
+ fi
COMPILER_TYPE=CL
@@ -23406,14 +23626,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CPP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CPP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -23423,21 +23655,20 @@
fi
as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CPP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
+ CPP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;}
- fi
+ fi
ac_ext=cpp
@@ -23795,14 +24026,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving CXXCPP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -23812,21 +24055,20 @@
fi
as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- CXXCPP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
+ CXXCPP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;}
- fi
+ fi
if test "x$COMPILE_TYPE" != "xcross"; then
@@ -24113,14 +24355,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving AS (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving AS (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -24130,21 +24384,20 @@
fi
as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- AS="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
+ AS="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;}
- fi
+ fi
else
AS="$CC -c"
@@ -24419,14 +24672,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -24436,21 +24701,20 @@
fi
as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- NM="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+ NM="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
- fi
+ fi
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
@@ -24714,14 +24978,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -24731,21 +25007,20 @@
fi
as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- STRIP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+ STRIP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
- fi
+ fi
# Extract the first word of "mcs", so it can be a program name with args.
set dummy mcs; ac_word=$2
@@ -25009,14 +25284,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving MCS (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving MCS (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -25026,21 +25313,20 @@
fi
as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- MCS="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
+ MCS="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;}
- fi
+ fi
elif test "x$OPENJDK_TARGET_OS" != xwindows; then
if test -n "$ac_tool_prefix"; then
@@ -25357,14 +25643,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -25374,21 +25672,20 @@
fi
as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- NM="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+ NM="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
- fi
+ fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -25704,14 +26001,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -25721,21 +26030,20 @@
fi
as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- STRIP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+ STRIP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -26066,14 +26374,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving OBJCOPY (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -26083,21 +26403,20 @@
fi
as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- OBJCOPY="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
+ OBJCOPY="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;}
- fi
+ fi
fi
fi
@@ -26426,14 +26745,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving OBJDUMP (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -26443,21 +26774,20 @@
fi
as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- OBJDUMP="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
+ OBJDUMP="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;}
- fi
+ fi
fi
@@ -26724,14 +27054,26 @@
tmp="$complete EOL"
arguments="${tmp#* }"
- new_path=`$WHICH $path 2> /dev/null`
- if test "x$new_path" = x; then
- is_absolute_path=`$ECHO "$path" | $GREP ^/`
- if test "x$is_absolute_path" != x; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&5
-$as_echo "$as_me: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&6;}
- new_path="$path"
- else
+ # Cannot rely on the command "which" here since it doesn't always work.
+ is_absolute_path=`$ECHO "$path" | $GREP ^/`
+ if test -z "$is_absolute_path"; then
+ # Path to executable is not absolute. Find it.
+ IFS_save="$IFS"
+ IFS=:
+ for p in $PATH; do
+ if test -f "$p/$path" && test -x "$p/$path"; then
+ new_path="$p/$path"
+ break
+ fi
+ done
+ IFS="$IFS_save"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) failed, using $path directly." >&5
+$as_echo "$as_me: Resolving LIPO (as $path) failed, using $path directly." >&6;}
+ new_path="$path"
+ fi
+
+ if test "x$new_path" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
has_space=`$ECHO "$complete" | $GREP " "`
@@ -26741,21 +27083,20 @@
fi
as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
fi
- fi
- fi
-
- # Now join together the path and the arguments once again
- if test "x$arguments" != xEOL; then
- new_complete="$new_path ${arguments% *}"
- else
- new_complete="$new_path"
- fi
+ fi
+
+ # Now join together the path and the arguments once again
+ if test "x$arguments" != xEOL; then
+ new_complete="$new_path ${arguments% *}"
+ else
+ new_complete="$new_path"
+ fi
if test "x$complete" != "x$new_complete"; then
- LIPO="$new_complete"
- { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
+ LIPO="$new_complete"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
$as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;}
- fi
+ fi
fi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/common/bin/hgforest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,194 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# 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.
+#
+
+# Shell script for a fast parallel forest command
+command="$1"
+pull_extra_base="$2"
+
+# Python always buffers stdout significantly, thus we will not see any output from hg clone jdk,
+# until a lot of time has passed! By passing -u to python, we get incremental updates
+# on stdout. Much nicer.
+whichhg="`which hg`"
+
+if [ "${whichhg}" = "" ] ; then
+ echo Cannot find hg!
+ exit 1
+fi
+
+if [ "" = "$command" ] ; then
+ echo No command to hg supplied!
+ exit 1
+fi
+
+has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`"
+python=""
+bpython=""
+
+if [ "#!" = "$has_hash_bang" ] ; then
+ python="`head -n 1 ${whichhg} | cut -b 3-`"
+ bpython="`basename "$python"`"
+fi
+
+if [ "python" = "$bpython" -a -x "$python" ] ; then
+ hg="${python} -u ${whichhg}"
+else
+ echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout.
+ hg="hg"
+fi
+
+# Clean out the temporary directory that stores the pid files.
+tmp=/tmp/forest.$$
+rm -f -r ${tmp}
+mkdir -p ${tmp}
+
+safe_interrupt () {
+ if [ -d ${tmp} ]; then
+ if [ "`ls ${tmp}`" != "" ]; then
+ echo "Waiting for processes ( `cat ${tmp}/* | tr '\n' ' '`) to terminate nicely!"
+ sleep 1
+ # Pipe stderr to dev/null to silence kill, that complains when trying to kill
+ # a subprocess that has already exited.
+ kill -TERM `cat ${tmp}/* | tr '\n' ' '` 2> /dev/null
+ wait
+ echo Interrupt complete!
+ fi
+ fi
+ rm -f -r ${tmp}
+ exit 1
+}
+
+nice_exit () {
+ if [ -d ${tmp} ]; then
+ if [ "`ls ${tmp}`" != "" ]; then
+ wait
+ fi
+ fi
+ rm -f -r ${tmp}
+}
+
+trap 'safe_interrupt' INT QUIT
+trap 'nice_exit' EXIT
+
+# Only look in specific locations for possible forests (avoids long searches)
+pull_default=""
+repos=""
+repos_extra=""
+if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+ subrepos="corba jaxp jaxws langtools jdk hotspot"
+ if [ -f .hg/hgrc ] ; then
+ pull_default=`hg paths default`
+ if [ "${pull_default}" = "" ] ; then
+ echo "ERROR: Need initial clone with 'hg paths default' defined"
+ exit 1
+ fi
+ fi
+ if [ "${pull_default}" = "" ] ; then
+ echo "ERROR: Need initial repository to use this script"
+ exit 1
+ fi
+ for i in ${subrepos} ; do
+ if [ ! -f ${i}/.hg/hgrc ] ; then
+ repos="${repos} ${i}"
+ fi
+ done
+ if [ "${pull_extra_base}" != "" ] ; then
+ subrepos_extra="jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
+ pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
+ pull_extra="${pull_extra_base}/${pull_default_tail}"
+ for i in ${subrepos_extra} ; do
+ if [ ! -f ${i}/.hg/hgrc ] ; then
+ repos_extra="${repos_extra} ${i}"
+ fi
+ done
+ fi
+ at_a_time=2
+ # Any repos to deal with?
+ if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
+ exit
+ fi
+else
+ hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
+ # Derive repository names from the .hg directory locations
+ for i in ${hgdirs} ; do
+ repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
+ done
+ for i in ${repos} ; do
+ if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
+ locked="${i} ${locked}"
+ fi
+ done
+ at_a_time=8
+ # Any repos to deal with?
+ if [ "${repos}" = "" ] ; then
+ echo "No repositories to process."
+ exit
+ fi
+ if [ "${locked}" != "" ] ; then
+ echo "These repositories are locked: ${locked}"
+ exit
+ fi
+fi
+
+# Echo out what repositories we do a command on.
+echo "# Repositories: ${repos} ${repos_extra}"
+echo
+
+# Run the supplied command on all repos in parallel.
+n=0
+for i in ${repos} ${repos_extra} ; do
+ n=`expr ${n} '+' 1`
+ repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
+ reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
+ pull_base="${pull_default}"
+ for j in $repos_extra ; do
+ if [ "$i" = "$j" ] ; then
+ pull_base="${pull_extra}"
+ fi
+ done
+ (
+ (
+ if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+ pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
+ echo ${hg} clone ${pull_newrepo} ${i}
+ ${hg} clone ${pull_newrepo} ${i} &
+ else
+ echo "cd ${i} && ${hg} $*"
+ cd ${i} && ${hg} "$@" &
+ fi
+ echo $! > ${tmp}/${repopidfile}.pid
+ ) 2>&1 | sed -e "s@^@${reponame}: @") &
+
+ if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
+ sleep 2
+ echo Waiting 5 secs before spawning next background command.
+ sleep 3
+ fi
+done
+# Wait for all hg commands to complete
+wait
+
+# Terminate with exit 0 all the time (hard to know when to say "failed")
+exit 0
+
--- a/common/makefiles/javadoc/CORE_PKGS.gmk Thu Dec 20 10:22:19 2012 +0100
+++ b/common/makefiles/javadoc/CORE_PKGS.gmk Mon Dec 24 11:46:38 2012 -0800
@@ -131,6 +131,7 @@
java.util.concurrent \
java.util.concurrent.atomic \
java.util.concurrent.locks \
+ java.util.function \
java.util.jar \
java.util.logging \
java.util.prefs \
--- a/corba/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/corba/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
5132f7900a8f0c30c3ca7f7a32f9433f4fee7745 jdk8-b65
65771ad1ca557ca26e4979d4dc633cf685435cb8 jdk8-b66
394515ad2a55d4d54df990b36065505d3e7a3cbb jdk8-b67
+82000531feaa7baef76b6406099e5cd88943d635 jdk8-b68
--- a/get_source.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/get_source.sh Mon Dec 24 11:46:38 2012 -0800
@@ -26,8 +26,8 @@
#
# Get clones of all nested repositories
-sh ./make/scripts/hgforest.sh clone $*
+sh ./common/bin/hgforest.sh clone "$@"
# Update all existing repositories to the latest sources
-sh ./make/scripts/hgforest.sh pull -u
+sh ./common/bin/hgforest.sh pull -u
--- a/hotspot/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -299,3 +299,7 @@
b61d9c88b759d1594b8af1655598e8fa00393672 hs25-b11
25bdce771bb3a7ae9825261a284d292cda700122 jdk8-b67
a35a72dd2e1255239d31f796f9f693e49b36bc9f hs25-b12
+121aa71316af6cd877bf455e775fa3fdbcdd4b65 jdk8-b68
+b6c9c0109a608eedbb6b868d260952990e3c91fe hs25-b13
+cb8a4e04bc8c104de8a2f67463c7e31232bf8d68 jdk8-b69
+990bbd393c239d95310ccc38094e57923bbf1d4a hs25-b14
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Mon Dec 24 11:46:38 2012 -0800
@@ -69,6 +69,8 @@
signatureIndex = new CIntField(type.getCIntegerField("_signature_index"), 0);
idnum = new CIntField(type.getCIntegerField("_method_idnum"), 0);
maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0);
+ maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
+ sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0);
// start of byte code
bytecodeOffset = type.getSize();
@@ -96,6 +98,8 @@
private static CIntField signatureIndex;
private static CIntField idnum;
private static CIntField maxStack;
+ private static CIntField maxLocals;
+ private static CIntField sizeOfParameters;
// start of bytecode
private static long bytecodeOffset;
@@ -151,6 +155,14 @@
return maxStack.getValue(this);
}
+ public long getMaxLocals() {
+ return maxLocals.getValue(this);
+ }
+
+ public long getSizeOfParameters() {
+ return sizeOfParameters.getValue(this);
+ }
+
public Symbol getName() {
return getMethod().getName();
}
@@ -247,6 +259,8 @@
visitor.doCInt(signatureIndex, true);
visitor.doCInt(codeSize, true);
visitor.doCInt(maxStack, true);
+ visitor.doCInt(maxLocals, true);
+ visitor.doCInt(sizeOfParameters, true);
}
// Accessors
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Mon Dec 24 11:46:38 2012 -0800
@@ -50,8 +50,6 @@
constMethod = type.getAddressField("_constMethod");
methodData = type.getAddressField("_method_data");
methodSize = new CIntField(type.getCIntegerField("_method_size"), 0);
- maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0);
- sizeOfParameters = new CIntField(type.getCIntegerField("_size_of_parameters"), 0);
accessFlags = new CIntField(type.getCIntegerField("_access_flags"), 0);
code = type.getAddressField("_code");
vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0);
@@ -83,8 +81,6 @@
private static AddressField constMethod;
private static AddressField methodData;
private static CIntField methodSize;
- private static CIntField maxLocals;
- private static CIntField sizeOfParameters;
private static CIntField accessFlags;
private static CIntField vtableIndex;
private static CIntField invocationCounter;
@@ -134,8 +130,8 @@
/** WARNING: this is in words, not useful in this system; use getObjectSize() instead */
public long getMethodSize() { return methodSize.getValue(this); }
public long getMaxStack() { return getConstMethod().getMaxStack(); }
- public long getMaxLocals() { return maxLocals.getValue(this); }
- public long getSizeOfParameters() { return sizeOfParameters.getValue(this); }
+ public long getMaxLocals() { return getConstMethod().getMaxLocals(); }
+ public long getSizeOfParameters() { return getConstMethod().getSizeOfParameters(); }
public long getNameIndex() { return getConstMethod().getNameIndex(); }
public long getSignatureIndex() { return getConstMethod().getSignatureIndex(); }
public long getGenericSignatureIndex() { return getConstMethod().getGenericSignatureIndex(); }
@@ -282,8 +278,6 @@
public void iterateFields(MetadataVisitor visitor) {
visitor.doCInt(methodSize, true);
- visitor.doCInt(maxLocals, true);
- visitor.doCInt(sizeOfParameters, true);
visitor.doCInt(accessFlags, true);
}
--- a/hotspot/make/hotspot_version Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/make/hotspot_version Mon Dec 24 11:46:38 2012 -0800
@@ -35,7 +35,7 @@
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=13
+HS_BUILD_NUMBER=15
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
--- a/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -298,7 +298,7 @@
for (int i = 0; i < _bytes_to_copy; i++) {
address ptr = (address)(_pc_start + i);
int a_byte = (*ptr) & 0xFF;
- __ a_byte (a_byte);
+ __ emit_int8 (a_byte);
}
}
@@ -340,10 +340,10 @@
int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record;
// Emit the patch record. We need to emit a full word, so emit an extra empty byte
- __ a_byte(0);
- __ a_byte(being_initialized_entry_offset);
- __ a_byte(bytes_to_skip);
- __ a_byte(_bytes_to_copy);
+ __ emit_int8(0);
+ __ emit_int8(being_initialized_entry_offset);
+ __ emit_int8(bytes_to_skip);
+ __ emit_int8(_bytes_to_copy);
address patch_info_pc = __ pc();
assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info");
--- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -582,7 +582,9 @@
// the following temporary registers are used during frame creation
const Register Gtmp1 = G3_scratch ;
const Register Gtmp2 = G1_scratch;
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
+ const Register RconstMethod = Gtmp1;
+ const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
bool inc_counter = UseCompiler || CountCompiledCalls;
@@ -618,6 +620,7 @@
}
#endif // ASSERT
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, Gtmp1);
__ sll(Gtmp1, LogBytesPerWord, Gtmp2); // parameter size in bytes
__ add(Gargs, Gtmp2, Gargs); // points to first local + BytesPerWord
@@ -1047,8 +1050,6 @@
const Register Gtmp = G3_scratch;
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
// slop factor is two extra slots on the expression stack so that
// we always have room to store a result when returning from a call without parameters
@@ -1066,6 +1067,9 @@
// Now compute new frame size
if (native) {
+ const Register RconstMethod = Gtmp;
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh( size_of_parameters, Gtmp );
__ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words
} else {
@@ -1236,9 +1240,13 @@
}
if (init_value != noreg) {
Label clear_loop;
+ const Register RconstMethod = O1;
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
// NOTE: If you change the frame layout, this code will need to
// be updated!
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_locals, O2 );
__ lduh( size_of_parameters, O1 );
__ sll( O2, LogBytesPerWord, O2);
@@ -1483,13 +1491,16 @@
//
// assert_different_registers(state, prev_state);
const Register Gtmp = G3_scratch;
+ const RconstMethod = G3_scratch;
const Register tmp = O2;
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
+ const Address constMethod(G5_method, 0, in_bytes(Method::const_offset()));
+ const Address size_of_parameters(RconstMethod, 0, in_bytes(ConstMethod::size_of_parameters_offset()));
+ const Address size_of_locals (RconstMethod, 0, in_bytes(ConstMethod::size_of_locals_offset()));
+ __ ld_ptr(constMethod, RconstMethod);
__ lduh(size_of_parameters, tmp);
- __ sll(tmp, LogBytesPerWord, Gtmp); // parameter size in bytes
- __ add(args, Gtmp, Gargs); // points to first local + BytesPerWord
+ __ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes
+ __ add(args, Gargs, Gargs); // points to first local + BytesPerWord
// NEW
__ add(Gargs, -wordSize, Gargs); // points to first local[0]
// determine extra space for non-argument locals & adjust caller's SP
@@ -1541,8 +1552,6 @@
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
- const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
address entry_point = __ pc();
__ mov(G0, prevState); // no current activation
@@ -1750,7 +1759,9 @@
__ ld_ptr(STATE(_result._to_call._callee), L4_scratch); // called method
__ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack
- __ lduh(L4_scratch, in_bytes(Method::size_of_parameters_offset()), L2_scratch); // get parameter size
+ // get parameter size
+ __ ld_ptr(L4_scratch, in_bytes(Method::const_offset()), L2_scratch);
+ __ lduh(L2_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), L2_scratch);
__ sll(L2_scratch, LogBytesPerWord, L2_scratch ); // parameter size in bytes
__ add(L1_scratch, L2_scratch, L1_scratch); // stack destination for result
__ ld(L4_scratch, in_bytes(Method::result_index_offset()), L3_scratch); // called method result type index
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -100,34 +100,6 @@
bool AbstractAssembler::pd_check_instruction_mark() { return false; }
#endif
-
-void MacroAssembler::print_instruction(int inst) {
- const char* s;
- switch (inv_op(inst)) {
- default: s = "????"; break;
- case call_op: s = "call"; break;
- case branch_op:
- switch (inv_op2(inst)) {
- case fb_op2: s = "fb"; break;
- case fbp_op2: s = "fbp"; break;
- case br_op2: s = "br"; break;
- case bp_op2: s = "bp"; break;
- case cb_op2: s = "cb"; break;
- case bpr_op2: {
- if (is_cbcond(inst)) {
- s = is_cxb(inst) ? "cxb" : "cwb";
- } else {
- s = "bpr";
- }
- break;
- }
- default: s = "????"; break;
- }
- }
- ::tty->print("%s", s);
-}
-
-
// Patch instruction inst at offset inst_pos to refer to dest_pos
// and return the resulting instruction.
// We should have pcs, not offsets, but since all is relative, it will work out
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -603,7 +603,6 @@
friend class Label;
protected:
- static void print_instruction(int inst);
static int patched_branch(int dest_pos, int inst, int inst_pos);
static int branch_destination(int inst, int pos);
@@ -759,9 +758,6 @@
// Required platform-specific helpers for Label::patch_instructions.
// They _shadow_ the declarations in AbstractAssembler, which are undefined.
void pd_patch_instruction(address branch, address target);
-#ifndef PRODUCT
- static void pd_print_patched_instruction(address branch);
-#endif
// sethi Macro handles optimizations and relocations
private:
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -43,14 +43,6 @@
stub_inst = patched_branch(target - branch, stub_inst, 0);
}
-#ifndef PRODUCT
-inline void MacroAssembler::pd_print_patched_instruction(address branch) {
- jint stub_inst = *(jint*) branch;
- print_instruction(stub_inst);
- ::tty->print("%s", " (unresolved)");
-}
-#endif // PRODUCT
-
// Use the right loads/stores for the platform
inline void MacroAssembler::ld_ptr( Register s1, Register s2, Register d ) {
#ifdef _LP64
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -171,7 +171,8 @@
if (VerifyMethodHandles && !for_compiler_entry) {
// make sure recv is already on stack
- __ load_sized_value(Address(method_temp, Method::size_of_parameters_offset()),
+ __ ld_ptr(method_temp, in_bytes(Method::const_offset()), temp2);
+ __ load_sized_value(Address(temp2, ConstMethod::size_of_parameters_offset()),
temp2,
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
@@ -233,7 +234,8 @@
int ref_kind = signature_polymorphic_intrinsic_ref_kind(iid);
assert(ref_kind != 0 || iid == vmIntrinsics::_invokeBasic, "must be _invokeBasic or a linkTo intrinsic");
if (ref_kind == 0 || MethodHandles::ref_kind_has_receiver(ref_kind)) {
- __ load_sized_value(Address(G5_method, Method::size_of_parameters_offset()),
+ __ ld_ptr(G5_method, in_bytes(Method::const_offset()), O4_param_size);
+ __ load_sized_value(Address(O4_param_size, ConstMethod::size_of_parameters_offset()),
O4_param_size,
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
--- a/hotspot/src/cpu/sparc/vm/sparc.ad Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad Mon Dec 24 11:46:38 2012 -0800
@@ -10224,7 +10224,7 @@
//---------- Zeros Count Instructions ------------------------------------------
-instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{
+instruct countLeadingZerosI(iRegIsafe dst, iRegI src, iRegI tmp, flagsReg cr) %{
predicate(UsePopCountInstruction); // See Matcher::match_rule_supported
match(Set dst (CountLeadingZerosI src));
effect(TEMP dst, TEMP tmp, KILL cr);
@@ -10321,7 +10321,7 @@
ins_pipe(ialu_reg);
%}
-instruct countTrailingZerosI(iRegI dst, iRegI src, flagsReg cr) %{
+instruct countTrailingZerosI(iRegIsafe dst, iRegI src, flagsReg cr) %{
predicate(UsePopCountInstruction); // See Matcher::match_rule_supported
match(Set dst (CountTrailingZerosI src));
effect(TEMP dst, KILL cr);
@@ -10364,19 +10364,21 @@
//---------- Population Count Instructions -------------------------------------
-instruct popCountI(iRegI dst, iRegI src) %{
+instruct popCountI(iRegIsafe dst, iRegI src) %{
predicate(UsePopCountInstruction);
match(Set dst (PopCountI src));
- format %{ "POPC $src, $dst" %}
- ins_encode %{
- __ popc($src$$Register, $dst$$Register);
+ format %{ "SRL $src, G0, $dst\t! clear upper word for 64 bit POPC\n\t"
+ "POPC $dst, $dst" %}
+ ins_encode %{
+ __ srl($src$$Register, G0, $dst$$Register);
+ __ popc($dst$$Register, $dst$$Register);
%}
ins_pipe(ialu_reg);
%}
// Note: Long.bitCount(long) returns an int.
-instruct popCountL(iRegI dst, iRegL src) %{
+instruct popCountL(iRegIsafe dst, iRegL src) %{
predicate(UsePopCountInstruction);
match(Set dst (PopCountL src));
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -434,7 +434,7 @@
// the frame is greater than one page in size, so check against
// the bottom of the stack
- __ cmp_and_brx_short(SP, Rscratch, Assembler::greater, Assembler::pt, after_frame_check);
+ __ cmp_and_brx_short(SP, Rscratch, Assembler::greaterUnsigned, Assembler::pt, after_frame_check);
// the stack will overflow, throw an exception
@@ -494,9 +494,6 @@
// (gri - 2/25/2000)
- const Address size_of_parameters(G5_method, Method::size_of_parameters_offset());
- const Address size_of_locals (G5_method, Method::size_of_locals_offset());
- const Address constMethod (G5_method, Method::const_offset());
int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong );
const int extra_space =
@@ -506,11 +503,15 @@
(native_call ? frame::interpreter_frame_extra_outgoing_argument_words : 0);
const Register Glocals_size = G3;
+ const Register RconstMethod = Glocals_size;
const Register Otmp1 = O3;
const Register Otmp2 = O4;
// Lscratch can't be used as a temporary because the call_stub uses
// it to assert that the stack frame was setup correctly.
+ const Address constMethod (G5_method, Method::const_offset());
+ const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset());
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_parameters, Glocals_size);
// Gargs points to first local + BytesPerWord
@@ -530,6 +531,8 @@
//
// Compute number of locals in method apart from incoming parameters
//
+ const Address size_of_locals (Otmp1, ConstMethod::size_of_locals_offset());
+ __ ld_ptr( constMethod, Otmp1 );
__ lduh( size_of_locals, Otmp1 );
__ sub( Otmp1, Glocals_size, Glocals_size );
__ round_to( Glocals_size, WordsPerLong );
@@ -1256,8 +1259,7 @@
// make sure registers are different!
assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2);
- const Address size_of_parameters(G5_method, Method::size_of_parameters_offset());
- const Address size_of_locals (G5_method, Method::size_of_locals_offset());
+ const Address constMethod (G5_method, Method::const_offset());
// Seems like G5_method is live at the point this is used. So we could make this look consistent
// and use in the asserts.
const Address access_flags (Lmethod, Method::access_flags_offset());
@@ -1307,8 +1309,13 @@
init_value = G0;
Label clear_loop;
+ const Register RconstMethod = O1;
+ const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals (RconstMethod, ConstMethod::size_of_locals_offset());
+
// NOTE: If you change the frame layout, this code will need to
// be updated!
+ __ ld_ptr( constMethod, RconstMethod );
__ lduh( size_of_locals, O2 );
__ lduh( size_of_parameters, O1 );
__ sll( O2, Interpreter::logStackElementSize, O2);
@@ -1823,9 +1830,13 @@
const Register Gtmp1 = G3_scratch;
const Register Gtmp2 = G1_scratch;
+ const Register RconstMethod = Gtmp1;
+ const Address constMethod(Lmethod, Method::const_offset());
+ const Address size_of_parameters(RconstMethod, ConstMethod::size_of_parameters_offset());
// Compute size of arguments for saving when returning to deoptimized caller
- __ lduh(Lmethod, in_bytes(Method::size_of_parameters_offset()), Gtmp1);
+ __ ld_ptr(constMethod, RconstMethod);
+ __ lduh(size_of_parameters, Gtmp1);
__ sll(Gtmp1, Interpreter::logStackElementSize, Gtmp1);
__ sub(Llocals, Gtmp1, Gtmp2);
__ add(Gtmp2, wordSize, Gtmp2);
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -3040,7 +3040,8 @@
Register Rtemp = G4_scratch;
// Load receiver from stack slot
- __ lduh(G5_method, in_bytes(Method::size_of_parameters_offset()), G4_scratch);
+ __ ld_ptr(G5_method, in_bytes(Method::const_offset()), G4_scratch);
+ __ lduh(G4_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), G4_scratch);
__ load_receiver(G4_scratch, O0);
// receiver NULL check
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -226,9 +226,9 @@
assert(isByte(op1) && isByte(op2), "wrong opcode");
assert(isByte(imm8), "not a byte");
assert((op1 & 0x01) == 0, "should be 8bit operation");
- emit_byte(op1);
- emit_byte(op2 | encode(dst));
- emit_byte(imm8);
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst));
+ emit_int8(imm8);
}
@@ -237,12 +237,12 @@
assert((op1 & 0x01) == 1, "should be 32bit operation");
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
if (is8bit(imm32)) {
- emit_byte(op1 | 0x02); // set sign bit
- emit_byte(op2 | encode(dst));
- emit_byte(imm32 & 0xFF);
+ emit_int8(op1 | 0x02); // set sign bit
+ emit_int8(op2 | encode(dst));
+ emit_int8(imm32 & 0xFF);
} else {
- emit_byte(op1);
- emit_byte(op2 | encode(dst));
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst));
emit_long(imm32);
}
}
@@ -252,8 +252,8 @@
assert(isByte(op1) && isByte(op2), "wrong opcode");
assert((op1 & 0x01) == 1, "should be 32bit operation");
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
- emit_byte(op1);
- emit_byte(op2 | encode(dst));
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst));
emit_long(imm32);
}
@@ -262,11 +262,11 @@
assert((op1 & 0x01) == 1, "should be 32bit operation");
assert((op1 & 0x02) == 0, "sign-extension bit should not be set");
if (is8bit(imm32)) {
- emit_byte(op1 | 0x02); // set sign bit
+ emit_int8(op1 | 0x02); // set sign bit
emit_operand(rm, adr, 1);
- emit_byte(imm32 & 0xFF);
+ emit_int8(imm32 & 0xFF);
} else {
- emit_byte(op1);
+ emit_int8(op1);
emit_operand(rm, adr, 4);
emit_long(imm32);
}
@@ -275,8 +275,8 @@
void Assembler::emit_arith(int op1, int op2, Register dst, Register src) {
assert(isByte(op1) && isByte(op2), "wrong opcode");
- emit_byte(op1);
- emit_byte(op2 | encode(dst) << 3 | encode(src));
+ emit_int8(op1);
+ emit_int8(op2 | encode(dst) << 3 | encode(src));
}
@@ -301,21 +301,21 @@
// [base + index*scale]
// [00 reg 100][ss index base]
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x04 | regenc);
- emit_byte(scale << 6 | indexenc | baseenc);
+ emit_int8(0x04 | regenc);
+ emit_int8(scale << 6 | indexenc | baseenc);
} else if (is8bit(disp) && rtype == relocInfo::none) {
// [base + index*scale + imm8]
// [01 reg 100][ss index base] imm8
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x44 | regenc);
- emit_byte(scale << 6 | indexenc | baseenc);
- emit_byte(disp & 0xFF);
+ emit_int8(0x44 | regenc);
+ emit_int8(scale << 6 | indexenc | baseenc);
+ emit_int8(disp & 0xFF);
} else {
// [base + index*scale + disp32]
// [10 reg 100][ss index base] disp32
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x84 | regenc);
- emit_byte(scale << 6 | indexenc | baseenc);
+ emit_int8(0x84 | regenc);
+ emit_int8(scale << 6 | indexenc | baseenc);
emit_data(disp, rspec, disp32_operand);
}
} else if (base == rsp LP64_ONLY(|| base == r12)) {
@@ -323,19 +323,19 @@
if (disp == 0 && rtype == relocInfo::none) {
// [rsp]
// [00 reg 100][00 100 100]
- emit_byte(0x04 | regenc);
- emit_byte(0x24);
+ emit_int8(0x04 | regenc);
+ emit_int8(0x24);
} else if (is8bit(disp) && rtype == relocInfo::none) {
// [rsp + imm8]
// [01 reg 100][00 100 100] disp8
- emit_byte(0x44 | regenc);
- emit_byte(0x24);
- emit_byte(disp & 0xFF);
+ emit_int8(0x44 | regenc);
+ emit_int8(0x24);
+ emit_int8(disp & 0xFF);
} else {
// [rsp + imm32]
// [10 reg 100][00 100 100] disp32
- emit_byte(0x84 | regenc);
- emit_byte(0x24);
+ emit_int8(0x84 | regenc);
+ emit_int8(0x24);
emit_data(disp, rspec, disp32_operand);
}
} else {
@@ -345,16 +345,16 @@
base != rbp LP64_ONLY(&& base != r13)) {
// [base]
// [00 reg base]
- emit_byte(0x00 | regenc | baseenc);
+ emit_int8(0x00 | regenc | baseenc);
} else if (is8bit(disp) && rtype == relocInfo::none) {
// [base + disp8]
// [01 reg base] disp8
- emit_byte(0x40 | regenc | baseenc);
- emit_byte(disp & 0xFF);
+ emit_int8(0x40 | regenc | baseenc);
+ emit_int8(disp & 0xFF);
} else {
// [base + disp32]
// [10 reg base] disp32
- emit_byte(0x80 | regenc | baseenc);
+ emit_int8(0x80 | regenc | baseenc);
emit_data(disp, rspec, disp32_operand);
}
}
@@ -364,14 +364,14 @@
// [index*scale + disp]
// [00 reg 100][ss index 101] disp32
assert(index != rsp, "illegal addressing mode");
- emit_byte(0x04 | regenc);
- emit_byte(scale << 6 | indexenc | 0x05);
+ emit_int8(0x04 | regenc);
+ emit_int8(scale << 6 | indexenc | 0x05);
emit_data(disp, rspec, disp32_operand);
} else if (rtype != relocInfo::none ) {
// [disp] (64bit) RIP-RELATIVE (32bit) abs
// [00 000 101] disp32
- emit_byte(0x05 | regenc);
+ emit_int8(0x05 | regenc);
// Note that the RIP-rel. correction applies to the generated
// disp field, but _not_ to the target address in the rspec.
@@ -391,8 +391,8 @@
// 32bit never did this, did everything as the rip-rel/disp code above
// [disp] ABSOLUTE
// [00 reg 100][00 100 101] disp32
- emit_byte(0x04 | regenc);
- emit_byte(0x25);
+ emit_int8(0x04 | regenc);
+ emit_int8(0x25);
emit_data(disp, rspec, disp32_operand);
}
}
@@ -883,8 +883,8 @@
void Assembler::emit_farith(int b1, int b2, int i) {
assert(isByte(b1) && isByte(b2), "wrong opcode");
assert(0 <= i && i < 8, "illegal stack offset");
- emit_byte(b1);
- emit_byte(b2 + i);
+ emit_int8(b1);
+ emit_int8(b2 + i);
}
@@ -899,7 +899,7 @@
void Assembler::adcl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x11);
+ emit_int8(0x11);
emit_operand(src, dst);
}
@@ -911,7 +911,7 @@
void Assembler::adcl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x13);
+ emit_int8(0x13);
emit_operand(dst, src);
}
@@ -929,7 +929,7 @@
void Assembler::addl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x01);
+ emit_int8(0x01);
emit_operand(src, dst);
}
@@ -941,7 +941,7 @@
void Assembler::addl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x03);
+ emit_int8(0x03);
emit_operand(dst, src);
}
@@ -953,38 +953,40 @@
void Assembler::addr_nop_4() {
assert(UseAddressNop, "no CPU support");
// 4 bytes: NOP DWORD PTR [EAX+0]
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x40); // emit_rm(cbuf, 0x1, EAX_enc, EAX_enc);
- emit_byte(0); // 8-bits offset (1 byte)
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8(0x40); // emit_rm(cbuf, 0x1, EAX_enc, EAX_enc);
+ emit_int8(0); // 8-bits offset (1 byte)
}
void Assembler::addr_nop_5() {
assert(UseAddressNop, "no CPU support");
// 5 bytes: NOP DWORD PTR [EAX+EAX*0+0] 8-bits offset
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x44); // emit_rm(cbuf, 0x1, EAX_enc, 0x4);
- emit_byte(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
- emit_byte(0); // 8-bits offset (1 byte)
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8(0x44); // emit_rm(cbuf, 0x1, EAX_enc, 0x4);
+ emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
+ emit_int8(0); // 8-bits offset (1 byte)
}
void Assembler::addr_nop_7() {
assert(UseAddressNop, "no CPU support");
// 7 bytes: NOP DWORD PTR [EAX+0] 32-bits offset
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x80); // emit_rm(cbuf, 0x2, EAX_enc, EAX_enc);
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8((unsigned char)0x80);
+ // emit_rm(cbuf, 0x2, EAX_enc, EAX_enc);
emit_long(0); // 32-bits offset (4 bytes)
}
void Assembler::addr_nop_8() {
assert(UseAddressNop, "no CPU support");
// 8 bytes: NOP DWORD PTR [EAX+EAX*0+0] 32-bits offset
- emit_byte(0x0F);
- emit_byte(0x1F);
- emit_byte(0x84); // emit_rm(cbuf, 0x2, EAX_enc, 0x4);
- emit_byte(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
+ emit_int8(0x0F);
+ emit_int8(0x1F);
+ emit_int8((unsigned char)0x84);
+ // emit_rm(cbuf, 0x2, EAX_enc, 0x4);
+ emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc);
emit_long(0); // 32-bits offset (4 bytes)
}
@@ -1012,67 +1014,67 @@
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xde);
+ emit_int8((unsigned char)0xDE);
emit_operand(dst, src);
}
void Assembler::aesdec(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xde);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDE);
+ emit_int8(0xC0 | encode);
}
void Assembler::aesdeclast(XMMRegister dst, Address src) {
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdf);
+ emit_int8((unsigned char)0xDF);
emit_operand(dst, src);
}
void Assembler::aesdeclast(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdf);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::aesenc(XMMRegister dst, Address src) {
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdc);
+ emit_int8((unsigned char)0xDC);
emit_operand(dst, src);
}
void Assembler::aesenc(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdc);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDC);
+ emit_int8(0xC0 | encode);
}
void Assembler::aesenclast(XMMRegister dst, Address src) {
assert(VM_Version::supports_aes(), "");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdd);
+ emit_int8((unsigned char)0xDD);
emit_operand(dst, src);
}
void Assembler::aesenclast(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_aes(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0xdd);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xDD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::andl(Address dst, int32_t imm32) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rsp, dst, 4);
emit_long(imm32);
}
@@ -1085,7 +1087,7 @@
void Assembler::andl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x23);
+ emit_int8(0x23);
emit_operand(dst, src);
}
@@ -1096,23 +1098,23 @@
void Assembler::bsfl(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBC);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBC);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bsrl(Register dst, Register src) {
assert(!VM_Version::supports_lzcnt(), "encoding is treated as LZCNT");
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bswapl(Register reg) { // bswap
int encode = prefix_and_encode(reg->encoding());
- emit_byte(0x0F);
- emit_byte(0xC8 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0xC8 | encode));
}
void Assembler::call(Label& L, relocInfo::relocType rtype) {
@@ -1125,36 +1127,36 @@
assert(offs <= 0, "assembler error");
InstructionMark im(this);
// 1110 1000 #32-bit disp
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xE8);
emit_data(offs - long_size, rtype, operand);
} else {
InstructionMark im(this);
// 1110 1000 #32-bit disp
L.add_patch_at(code(), locator());
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xE8);
emit_data(int(0), rtype, operand);
}
}
void Assembler::call(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xD0 | encode));
}
void Assembler::call(Address adr) {
InstructionMark im(this);
prefix(adr);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rdx, adr);
}
void Assembler::call_literal(address entry, RelocationHolder const& rspec) {
assert(entry != NULL, "call most probably wrong");
InstructionMark im(this);
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xE8);
intptr_t disp = entry - (pc() + sizeof(int32_t));
assert(is_simm32(disp), "must be 32bit offset (call2)");
// Technically, should use call32_operand, but this format is
@@ -1165,42 +1167,42 @@
}
void Assembler::cdql() {
- emit_byte(0x99);
+ emit_int8((unsigned char)0x99);
}
void Assembler::cld() {
- emit_byte(0xfc);
+ emit_int8((unsigned char)0xFC);
}
void Assembler::cmovl(Condition cc, Register dst, Register src) {
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction"));
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cmovl(Condition cc, Register dst, Address src) {
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction"));
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
emit_operand(dst, src);
}
void Assembler::cmpb(Address dst, int imm8) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0x80);
+ emit_int8((unsigned char)0x80);
emit_operand(rdi, dst, 1);
- emit_byte(imm8);
+ emit_int8(imm8);
}
void Assembler::cmpl(Address dst, int32_t imm32) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, dst, 4);
emit_long(imm32);
}
@@ -1219,17 +1221,17 @@
void Assembler::cmpl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x3B);
+ emit_int8((unsigned char)0x3B);
emit_operand(dst, src);
}
void Assembler::cmpw(Address dst, int imm16) {
InstructionMark im(this);
assert(!dst.base_needs_rex() && !dst.index_needs_rex(), "no extended registers");
- emit_byte(0x66);
- emit_byte(0x81);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, dst, 2);
- emit_word(imm16);
+ emit_int16(imm16);
}
// The 32-bit cmpxchg compares the value at adr with the contents of rax,
@@ -1238,8 +1240,8 @@
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg
InstructionMark im(this);
prefix(adr, reg);
- emit_byte(0x0F);
- emit_byte(0xB1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB1);
emit_operand(reg, adr);
}
@@ -1266,8 +1268,8 @@
}
void Assembler::cpuid() {
- emit_byte(0x0F);
- emit_byte(0xA2);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xA2);
}
void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) {
@@ -1293,8 +1295,8 @@
void Assembler::cvtsi2sdl(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2sdl(XMMRegister dst, Address src) {
@@ -1305,8 +1307,8 @@
void Assembler::cvtsi2ssl(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2ssl(XMMRegister dst, Address src) {
@@ -1328,22 +1330,22 @@
void Assembler::cvttsd2sil(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F2);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvttss2sil(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F3);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::decl(Address dst) {
// Don't use it directly. Use MacroAssembler::decrement() instead.
InstructionMark im(this);
prefix(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rcx, dst);
}
@@ -1369,43 +1371,43 @@
void Assembler::emms() {
NOT_LP64(assert(VM_Version::supports_mmx(), ""));
- emit_byte(0x0F);
- emit_byte(0x77);
+ emit_int8(0x0F);
+ emit_int8(0x77);
}
void Assembler::hlt() {
- emit_byte(0xF4);
+ emit_int8((unsigned char)0xF4);
}
void Assembler::idivl(Register src) {
int encode = prefix_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::divl(Register src) { // Unsigned
int encode = prefix_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xF0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xF0 | encode));
}
void Assembler::imull(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xAF);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::imull(Register dst, Register src, int value) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
if (is8bit(value)) {
- emit_byte(0x6B);
- emit_byte(0xC0 | encode);
- emit_byte(value & 0xFF);
+ emit_int8(0x6B);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(value & 0xFF);
} else {
- emit_byte(0x69);
- emit_byte(0xC0 | encode);
+ emit_int8(0x69);
+ emit_int8((unsigned char)(0xC0 | encode));
emit_long(value);
}
}
@@ -1414,7 +1416,7 @@
// Don't use it directly. Use MacroAssembler::increment() instead.
InstructionMark im(this);
prefix(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rax, dst);
}
@@ -1430,14 +1432,14 @@
intptr_t offs = (intptr_t)dst - (intptr_t)pc();
if (maybe_short && is8bit(offs - short_size)) {
// 0111 tttn #8-bit disp
- emit_byte(0x70 | cc);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8(0x70 | cc);
+ emit_int8((offs - short_size) & 0xFF);
} else {
// 0000 1111 1000 tttn #32-bit disp
assert(is_simm32(offs - long_size),
"must be 32bit offset (call4)");
- emit_byte(0x0F);
- emit_byte(0x80 | cc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0x80 | cc));
emit_long(offs - long_size);
}
} else {
@@ -1446,8 +1448,8 @@
// Note: use jccb() if label to be bound is very close to get
// an 8-bit displacement
L.add_patch_at(code(), locator());
- emit_byte(0x0F);
- emit_byte(0x80 | cc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0x80 | cc));
emit_long(0);
}
}
@@ -1466,20 +1468,20 @@
#endif
intptr_t offs = (intptr_t)entry - (intptr_t)pc();
// 0111 tttn #8-bit disp
- emit_byte(0x70 | cc);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8(0x70 | cc);
+ emit_int8((offs - short_size) & 0xFF);
} else {
InstructionMark im(this);
L.add_patch_at(code(), locator());
- emit_byte(0x70 | cc);
- emit_byte(0);
+ emit_int8(0x70 | cc);
+ emit_int8(0);
}
}
void Assembler::jmp(Address adr) {
InstructionMark im(this);
prefix(adr);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rsp, adr);
}
@@ -1492,10 +1494,10 @@
const int long_size = 5;
intptr_t offs = entry - pc();
if (maybe_short && is8bit(offs - short_size)) {
- emit_byte(0xEB);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8((unsigned char)0xEB);
+ emit_int8((offs - short_size) & 0xFF);
} else {
- emit_byte(0xE9);
+ emit_int8((unsigned char)0xE9);
emit_long(offs - long_size);
}
} else {
@@ -1505,20 +1507,20 @@
// force an 8-bit displacement.
InstructionMark im(this);
L.add_patch_at(code(), locator());
- emit_byte(0xE9);
+ emit_int8((unsigned char)0xE9);
emit_long(0);
}
}
void Assembler::jmp(Register entry) {
int encode = prefix_and_encode(entry->encoding());
- emit_byte(0xFF);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) {
InstructionMark im(this);
- emit_byte(0xE9);
+ emit_int8((unsigned char)0xE9);
assert(dest != NULL, "must have a target");
intptr_t disp = dest - (pc() + sizeof(int32_t));
assert(is_simm32(disp), "must be 32bit offset (jmp)");
@@ -1539,13 +1541,13 @@
assert(is8bit(dist), "Dispacement too large for a short jmp");
#endif
intptr_t offs = entry - pc();
- emit_byte(0xEB);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8((unsigned char)0xEB);
+ emit_int8((offs - short_size) & 0xFF);
} else {
InstructionMark im(this);
L.add_patch_at(code(), locator());
- emit_byte(0xEB);
- emit_byte(0);
+ emit_int8((unsigned char)0xEB);
+ emit_int8(0);
}
}
@@ -1553,46 +1555,46 @@
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
prefix(src);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(2), src);
}
void Assembler::leal(Register dst, Address src) {
InstructionMark im(this);
#ifdef _LP64
- emit_byte(0x67); // addr32
+ emit_int8(0x67); // addr32
prefix(src, dst);
#endif // LP64
- emit_byte(0x8D);
+ emit_int8((unsigned char)0x8D);
emit_operand(dst, src);
}
void Assembler::lfence() {
- emit_byte(0x0F);
- emit_byte(0xAE);
- emit_byte(0xE8);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
+ emit_int8((unsigned char)0xE8);
}
void Assembler::lock() {
- emit_byte(0xF0);
+ emit_int8((unsigned char)0xF0);
}
void Assembler::lzcntl(Register dst, Register src) {
assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// Emit mfence instruction
void Assembler::mfence() {
NOT_LP64(assert(VM_Version::supports_sse2(), "unsupported");)
- emit_byte( 0x0F );
- emit_byte( 0xAE );
- emit_byte( 0xF0 );
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
+ emit_int8((unsigned char)0xF0);
}
void Assembler::mov(Register dst, Register src) {
@@ -1612,15 +1614,15 @@
void Assembler::movlhps(XMMRegister dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode(dst, src, src, VEX_SIMD_NONE);
- emit_byte(0x16);
- emit_byte(0xC0 | encode);
+ emit_int8(0x16);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movb(Register dst, Address src) {
NOT_LP64(assert(dst->has_byte_register(), "must have byte register"));
InstructionMark im(this);
prefix(src, dst, true);
- emit_byte(0x8A);
+ emit_int8((unsigned char)0x8A);
emit_operand(dst, src);
}
@@ -1628,9 +1630,9 @@
void Assembler::movb(Address dst, int imm8) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0xC6);
+ emit_int8((unsigned char)0xC6);
emit_operand(rax, dst, 1);
- emit_byte(imm8);
+ emit_int8(imm8);
}
@@ -1638,30 +1640,30 @@
assert(src->has_byte_register(), "must have byte register");
InstructionMark im(this);
prefix(dst, src, true);
- emit_byte(0x88);
+ emit_int8((unsigned char)0x88);
emit_operand(src, dst);
}
void Assembler::movdl(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_66);
- emit_byte(0x6E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x6E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdl(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// swap src/dst to get correct prefix
int encode = simd_prefix_and_encode(src, dst, VEX_SIMD_66);
- emit_byte(0x7E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x7E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdl(XMMRegister dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0x6E);
+ emit_int8(0x6E);
emit_operand(dst, src);
}
@@ -1669,7 +1671,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0x7E);
+ emit_int8(0x7E);
emit_operand(src, dst);
}
@@ -1692,7 +1694,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F3);
- emit_byte(0x7F);
+ emit_int8(0x7F);
emit_operand(src, dst);
}
@@ -1701,8 +1703,8 @@
assert(UseAVX, "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256);
- emit_byte(0x6F);
- emit_byte(0xC0 | encode);
+ emit_int8(0x6F);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vmovdqu(XMMRegister dst, Address src) {
@@ -1710,7 +1712,7 @@
InstructionMark im(this);
bool vector256 = true;
vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256);
- emit_byte(0x6F);
+ emit_int8(0x6F);
emit_operand(dst, src);
}
@@ -1721,7 +1723,7 @@
// swap src<->dst for encoding
assert(src != xnoreg, "sanity");
vex_prefix(src, xnoreg, dst, VEX_SIMD_F3, vector256);
- emit_byte(0x7F);
+ emit_int8(0x7F);
emit_operand(src, dst);
}
@@ -1729,27 +1731,27 @@
void Assembler::movl(Register dst, int32_t imm32) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_long(imm32);
}
void Assembler::movl(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x8B);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x8B);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x8B);
+ emit_int8((unsigned char)0x8B);
emit_operand(dst, src);
}
void Assembler::movl(Address dst, int32_t imm32) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 4);
emit_long(imm32);
}
@@ -1757,7 +1759,7 @@
void Assembler::movl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x89);
+ emit_int8((unsigned char)0x89);
emit_operand(src, dst);
}
@@ -1771,15 +1773,15 @@
void Assembler::movq( MMXRegister dst, Address src ) {
assert( VM_Version::supports_mmx(), "" );
- emit_byte(0x0F);
- emit_byte(0x6F);
+ emit_int8(0x0F);
+ emit_int8(0x6F);
emit_operand(dst, src);
}
void Assembler::movq( Address dst, MMXRegister src ) {
assert( VM_Version::supports_mmx(), "" );
- emit_byte(0x0F);
- emit_byte(0x7F);
+ emit_int8(0x0F);
+ emit_int8(0x7F);
// workaround gcc (3.2.1-7a) bug
// In that version of gcc with only an emit_operand(MMX, Address)
// gcc will tail jump and try and reverse the parameters completely
@@ -1793,7 +1795,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F3);
- emit_byte(0x7E);
+ emit_int8(0x7E);
emit_operand(dst, src);
}
@@ -1801,24 +1803,24 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0xD6);
+ emit_int8((unsigned char)0xD6);
emit_operand(src, dst);
}
void Assembler::movsbl(Register dst, Address src) { // movsxb
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
emit_operand(dst, src);
}
void Assembler::movsbl(Register dst, Register src) { // movsxb
NOT_LP64(assert(src->has_byte_register(), "must have byte register"));
int encode = prefix_and_encode(dst->encoding(), src->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0xBE);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movsd(XMMRegister dst, XMMRegister src) {
@@ -1835,7 +1837,7 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F2);
- emit_byte(0x11);
+ emit_int8(0x11);
emit_operand(src, dst);
}
@@ -1853,93 +1855,93 @@
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F3);
- emit_byte(0x11);
+ emit_int8(0x11);
emit_operand(src, dst);
}
void Assembler::movswl(Register dst, Address src) { // movsxw
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBF);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBF);
emit_operand(dst, src);
}
void Assembler::movswl(Register dst, Register src) { // movsxw
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBF);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movw(Address dst, int imm16) {
InstructionMark im(this);
- emit_byte(0x66); // switch to 16-bit mode
+ emit_int8(0x66); // switch to 16-bit mode
prefix(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 2);
- emit_word(imm16);
+ emit_int16(imm16);
}
void Assembler::movw(Register dst, Address src) {
InstructionMark im(this);
- emit_byte(0x66);
+ emit_int8(0x66);
prefix(src, dst);
- emit_byte(0x8B);
+ emit_int8((unsigned char)0x8B);
emit_operand(dst, src);
}
void Assembler::movw(Address dst, Register src) {
InstructionMark im(this);
- emit_byte(0x66);
+ emit_int8(0x66);
prefix(dst, src);
- emit_byte(0x89);
+ emit_int8((unsigned char)0x89);
emit_operand(src, dst);
}
void Assembler::movzbl(Register dst, Address src) { // movzxb
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB6);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB6);
emit_operand(dst, src);
}
void Assembler::movzbl(Register dst, Register src) { // movzxb
NOT_LP64(assert(src->has_byte_register(), "must have byte register"));
int encode = prefix_and_encode(dst->encoding(), src->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0xB6);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB6);
+ emit_int8(0xC0 | encode);
}
void Assembler::movzwl(Register dst, Address src) { // movzxw
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB7);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB7);
emit_operand(dst, src);
}
void Assembler::movzwl(Register dst, Register src) { // movzxw
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB7);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB7);
+ emit_int8(0xC0 | encode);
}
void Assembler::mull(Address src) {
InstructionMark im(this);
prefix(src);
- emit_byte(0xF7);
+ emit_int8((unsigned char)0xF7);
emit_operand(rsp, src);
}
void Assembler::mull(Register src) {
int encode = prefix_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::mulsd(XMMRegister dst, Address src) {
@@ -1964,8 +1966,8 @@
void Assembler::negl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD8 | encode));
}
void Assembler::nop(int i) {
@@ -1976,7 +1978,7 @@
// speed is not an issue so simply use the single byte traditional nop
// to do alignment.
- for (; i > 0 ; i--) emit_byte(0x90);
+ for (; i > 0 ; i--) emit_int8((unsigned char)0x90);
return;
#endif // ASSERT
@@ -2006,33 +2008,35 @@
while(i >= 15) {
// For Intel don't generate consecutive addess nops (mix with regular nops)
i -= 15;
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
addr_nop_8();
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x90); // nop
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8((unsigned char)0x90);
+ // nop
}
switch (i) {
case 14:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 13:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 12:
addr_nop_8();
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x90); // nop
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8((unsigned char)0x90);
+ // nop
break;
case 11:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 10:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 9:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 8:
addr_nop_8();
break;
@@ -2040,7 +2044,7 @@
addr_nop_7();
break;
case 6:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 5:
addr_nop_5();
break;
@@ -2049,11 +2053,12 @@
break;
case 3:
// Don't use "0x0F 0x1F 0x00" - need patching safe padding
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 2:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 1:
- emit_byte(0x90); // nop
+ emit_int8((unsigned char)0x90);
+ // nop
break;
default:
assert(i == 0, " ");
@@ -2086,24 +2091,24 @@
while(i >= 22) {
i -= 11;
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66); // size prefix
addr_nop_8();
}
// Generate first nop for size between 21-12
switch (i) {
case 21:
i -= 1;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 20:
case 19:
i -= 1;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 18:
case 17:
i -= 1;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 16:
case 15:
i -= 8;
@@ -2116,7 +2121,7 @@
break;
case 12:
i -= 6;
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
addr_nop_5();
break;
default:
@@ -2126,11 +2131,11 @@
// Generate second nop for size between 11-1
switch (i) {
case 11:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 10:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 9:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 8:
addr_nop_8();
break;
@@ -2138,7 +2143,7 @@
addr_nop_7();
break;
case 6:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 5:
addr_nop_5();
break;
@@ -2147,11 +2152,12 @@
break;
case 3:
// Don't use "0x0F 0x1F 0x00" - need patching safe padding
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 2:
- emit_byte(0x66); // size prefix
+ emit_int8(0x66); // size prefix
case 1:
- emit_byte(0x90); // nop
+ emit_int8((unsigned char)0x90);
+ // nop
break;
default:
assert(i == 0, " ");
@@ -2174,42 +2180,43 @@
//
while(i > 12) {
i -= 4;
- emit_byte(0x66); // size prefix
- emit_byte(0x66);
- emit_byte(0x66);
- emit_byte(0x90); // nop
+ emit_int8(0x66); // size prefix
+ emit_int8(0x66);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x90);
+ // nop
}
// 1 - 12 nops
if(i > 8) {
if(i > 9) {
i -= 1;
- emit_byte(0x66);
+ emit_int8(0x66);
}
i -= 3;
- emit_byte(0x66);
- emit_byte(0x66);
- emit_byte(0x90);
+ emit_int8(0x66);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x90);
}
// 1 - 8 nops
if(i > 4) {
if(i > 6) {
i -= 1;
- emit_byte(0x66);
+ emit_int8(0x66);
}
i -= 3;
- emit_byte(0x66);
- emit_byte(0x66);
- emit_byte(0x90);
+ emit_int8(0x66);
+ emit_int8(0x66);
+ emit_int8((unsigned char)0x90);
}
switch (i) {
case 4:
- emit_byte(0x66);
+ emit_int8(0x66);
case 3:
- emit_byte(0x66);
+ emit_int8(0x66);
case 2:
- emit_byte(0x66);
+ emit_int8(0x66);
case 1:
- emit_byte(0x90);
+ emit_int8((unsigned char)0x90);
break;
default:
assert(i == 0, " ");
@@ -2218,8 +2225,8 @@
void Assembler::notl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD0 | encode );
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD0 | encode));
}
void Assembler::orl(Address dst, int32_t imm32) {
@@ -2236,7 +2243,7 @@
void Assembler::orl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x0B);
+ emit_int8(0x0B);
emit_operand(dst, src);
}
@@ -2260,61 +2267,61 @@
assert(VM_Version::supports_sse4_2(), "");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A);
- emit_byte(0x61);
+ emit_int8(0x61);
emit_operand(dst, src);
- emit_byte(imm8);
+ emit_int8(imm8);
}
void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) {
assert(VM_Version::supports_sse4_2(), "");
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A);
- emit_byte(0x61);
- emit_byte(0xC0 | encode);
- emit_byte(imm8);
+ emit_int8(0x61);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(imm8);
}
void Assembler::pmovzxbw(XMMRegister dst, Address src) {
assert(VM_Version::supports_sse4_1(), "");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x30);
+ emit_int8(0x30);
emit_operand(dst, src);
}
void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_sse4_1(), "");
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x30);
- emit_byte(0xC0 | encode);
+ emit_int8(0x30);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// generic
void Assembler::pop(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0x58 | encode);
+ emit_int8(0x58 | encode);
}
void Assembler::popcntl(Register dst, Address src) {
assert(VM_Version::supports_popcnt(), "must support");
InstructionMark im(this);
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
prefix(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB8);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB8);
emit_operand(dst, src);
}
void Assembler::popcntl(Register dst, Register src) {
assert(VM_Version::supports_popcnt(), "must support");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB8);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB8);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::popf() {
- emit_byte(0x9D);
+ emit_int8((unsigned char)0x9D);
}
#ifndef _LP64 // no 32bit push/pop on amd64
@@ -2322,21 +2329,21 @@
// NOTE: this will adjust stack by 8byte on 64bits
InstructionMark im(this);
prefix(dst);
- emit_byte(0x8F);
+ emit_int8((unsigned char)0x8F);
emit_operand(rax, dst);
}
#endif
void Assembler::prefetch_prefix(Address src) {
prefix(src);
- emit_byte(0x0F);
+ emit_int8(0x0F);
}
void Assembler::prefetchnta(Address src) {
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rax, src); // 0, src
}
@@ -2344,7 +2351,7 @@
assert(VM_Version::supports_3dnow_prefetch(), "must support");
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x0D);
+ emit_int8(0x0D);
emit_operand(rax, src); // 0, src
}
@@ -2352,7 +2359,7 @@
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rcx, src); // 1, src
}
@@ -2360,7 +2367,7 @@
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rdx, src); // 2, src
}
@@ -2368,7 +2375,7 @@
NOT_LP64(assert(VM_Version::supports_sse(), "must support"));
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(rbx, src); // 3, src
}
@@ -2376,27 +2383,26 @@
assert(VM_Version::supports_3dnow_prefetch(), "must support");
InstructionMark im(this);
prefetch_prefix(src);
- emit_byte(0x0D);
+ emit_int8(0x0D);
emit_operand(rcx, src); // 1, src
}
void Assembler::prefix(Prefix p) {
- a_byte(p);
+ emit_int8(p);
}
void Assembler::pshufb(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_ssse3(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x00);
- emit_byte(0xC0 | encode);
+ emit_int8(0x00);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::pshufb(XMMRegister dst, Address src) {
assert(VM_Version::supports_ssse3(), "");
- assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x00);
+ emit_int8(0x00);
emit_operand(dst, src);
}
@@ -2404,7 +2410,7 @@
assert(isByte(mode), "invalid value");
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_66);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
@@ -2414,16 +2420,16 @@
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66);
- emit_byte(0x70);
+ emit_int8(0x70);
emit_operand(dst, src);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) {
assert(isByte(mode), "invalid value");
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_F2);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
void Assembler::pshuflw(XMMRegister dst, Address src, int mode) {
@@ -2432,18 +2438,18 @@
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_F2);
- emit_byte(0x70);
+ emit_int8(0x70);
emit_operand(dst, src);
- emit_byte(mode & 0xFF);
+ emit_int8(mode & 0xFF);
}
void Assembler::psrldq(XMMRegister dst, int shift) {
// Shift 128 bit value in xmm register by number of bytes.
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode(xmm3, dst, dst, VEX_SIMD_66);
- emit_byte(0x73);
- emit_byte(0xC0 | encode);
- emit_byte(shift);
+ emit_int8(0x73);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift);
}
void Assembler::ptest(XMMRegister dst, Address src) {
@@ -2451,15 +2457,15 @@
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes");
InstructionMark im(this);
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x17);
+ emit_int8(0x17);
emit_operand(dst, src);
}
void Assembler::ptest(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_sse4_1(), "");
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x17);
- emit_byte(0xC0 | encode);
+ emit_int8(0x17);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::punpcklbw(XMMRegister dst, Address src) {
@@ -2492,18 +2498,18 @@
void Assembler::push(int32_t imm32) {
// in 64bits we push 64bits onto the stack but only
// take a 32bit immediate
- emit_byte(0x68);
+ emit_int8(0x68);
emit_long(imm32);
}
void Assembler::push(Register src) {
int encode = prefix_and_encode(src->encoding());
- emit_byte(0x50 | encode);
+ emit_int8(0x50 | encode);
}
void Assembler::pushf() {
- emit_byte(0x9C);
+ emit_int8((unsigned char)0x9C);
}
#ifndef _LP64 // no 32bit push/pop on amd64
@@ -2511,7 +2517,7 @@
// Note this will push 64bit on 64bit
InstructionMark im(this);
prefix(src);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rsi, src);
}
#endif
@@ -2520,58 +2526,58 @@
assert(isShiftCount(imm8), "illegal shift count");
int encode = prefix_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xD0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xD0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)0xD0 | encode);
+ emit_int8(imm8);
}
}
// copies data from [esi] to [edi] using rcx pointer sized words
// generic
void Assembler::rep_mov() {
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
// MOVSQ
LP64_ONLY(prefix(REX_W));
- emit_byte(0xA5);
+ emit_int8((unsigned char)0xA5);
}
// sets rcx pointer sized words with rax, value at [edi]
// generic
void Assembler::rep_set() { // rep_set
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
// STOSQ
LP64_ONLY(prefix(REX_W));
- emit_byte(0xAB);
+ emit_int8((unsigned char)0xAB);
}
// scans rcx pointer sized words at [edi] for occurance of rax,
// generic
void Assembler::repne_scan() { // repne_scan
- emit_byte(0xF2);
+ emit_int8((unsigned char)0xF2);
// SCASQ
LP64_ONLY(prefix(REX_W));
- emit_byte(0xAF);
+ emit_int8((unsigned char)0xAF);
}
#ifdef _LP64
// scans rcx 4 byte words at [edi] for occurance of rax,
// generic
void Assembler::repne_scanl() { // repne_scan
- emit_byte(0xF2);
+ emit_int8((unsigned char)0xF2);
// SCASL
- emit_byte(0xAF);
+ emit_int8((unsigned char)0xAF);
}
#endif
void Assembler::ret(int imm16) {
if (imm16 == 0) {
- emit_byte(0xC3);
+ emit_int8((unsigned char)0xC3);
} else {
- emit_byte(0xC2);
- emit_word(imm16);
+ emit_int8((unsigned char)0xC2);
+ emit_int16(imm16);
}
}
@@ -2580,26 +2586,26 @@
// Not supported in 64bit mode
ShouldNotReachHere();
#endif
- emit_byte(0x9E);
+ emit_int8((unsigned char)0x9E);
}
void Assembler::sarl(Register dst, int imm8) {
int encode = prefix_and_encode(dst->encoding());
assert(isShiftCount(imm8), "illegal shift count");
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xF8 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xF8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xF8 | encode));
+ emit_int8(imm8);
}
}
void Assembler::sarl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::sbbl(Address dst, int32_t imm32) {
@@ -2617,7 +2623,7 @@
void Assembler::sbbl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x1B);
+ emit_int8(0x1B);
emit_operand(dst, src);
}
@@ -2629,47 +2635,47 @@
void Assembler::setb(Condition cc, Register dst) {
assert(0 <= cc && cc < 16, "illegal cc");
int encode = prefix_and_encode(dst->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0x90 | cc);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0x90 | cc);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::shll(Register dst, int imm8) {
assert(isShiftCount(imm8), "illegal shift count");
int encode = prefix_and_encode(dst->encoding());
if (imm8 == 1 ) {
- emit_byte(0xD1);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xE0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xE0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE0 | encode));
+ emit_int8(imm8);
}
}
void Assembler::shll(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::shrl(Register dst, int imm8) {
assert(isShiftCount(imm8), "illegal shift count");
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xC1);
- emit_byte(0xE8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE8 | encode));
+ emit_int8(imm8);
}
void Assembler::shrl(Register dst) {
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xE8 | encode));
}
// copies a single word from [esi] to [edi]
void Assembler::smovl() {
- emit_byte(0xA5);
+ emit_int8((unsigned char)0xA5);
}
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) {
@@ -2688,7 +2694,7 @@
}
void Assembler::std() {
- emit_byte(0xfd);
+ emit_int8((unsigned char)0xFD);
}
void Assembler::sqrtss(XMMRegister dst, Address src) {
@@ -2700,8 +2706,8 @@
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
prefix(dst);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(3), dst);
}
@@ -2714,7 +2720,7 @@
void Assembler::subl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x29);
+ emit_int8(0x29);
emit_operand(src, dst);
}
@@ -2732,7 +2738,7 @@
void Assembler::subl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x2B);
+ emit_int8(0x2B);
emit_operand(dst, src);
}
@@ -2773,11 +2779,11 @@
// 8bit operands
int encode = dst->encoding();
if (encode == 0) {
- emit_byte(0xA9);
+ emit_int8((unsigned char)0xA9);
} else {
encode = prefix_and_encode(encode);
- emit_byte(0xF7);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xC0 | encode));
}
emit_long(imm32);
}
@@ -2790,7 +2796,7 @@
void Assembler::testl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x85);
+ emit_int8((unsigned char)0x85);
emit_operand(dst, src);
}
@@ -2818,28 +2824,28 @@
void Assembler::xaddl(Address dst, Register src) {
InstructionMark im(this);
prefix(dst, src);
- emit_byte(0x0F);
- emit_byte(0xC1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xC1);
emit_operand(src, dst);
}
void Assembler::xchgl(Register dst, Address src) { // xchg
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x87);
+ emit_int8((unsigned char)0x87);
emit_operand(dst, src);
}
void Assembler::xchgl(Register dst, Register src) {
int encode = prefix_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x87);
- emit_byte(0xc0 | encode);
+ emit_int8((unsigned char)0x87);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::xgetbv() {
- emit_byte(0x0F);
- emit_byte(0x01);
- emit_byte(0xD0);
+ emit_int8(0x0F);
+ emit_int8(0x01);
+ emit_int8((unsigned char)0xD0);
}
void Assembler::xorl(Register dst, int32_t imm32) {
@@ -2850,7 +2856,7 @@
void Assembler::xorl(Register dst, Address src) {
InstructionMark im(this);
prefix(src, dst);
- emit_byte(0x33);
+ emit_int8(0x33);
emit_operand(dst, src);
}
@@ -3276,8 +3282,8 @@
void Assembler::pmulld(XMMRegister dst, XMMRegister src) {
assert(VM_Version::supports_sse4_1(), "");
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38);
- emit_byte(0x40);
- emit_byte(0xC0 | encode);
+ emit_int8(0x40);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) {
@@ -3288,8 +3294,8 @@
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38);
- emit_byte(0x40);
- emit_byte(0xC0 | encode);
+ emit_int8(0x40);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) {
@@ -3303,7 +3309,7 @@
int dst_enc = dst->encoding();
int nds_enc = nds->is_valid() ? nds->encoding() : 0;
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, false, vector256);
- emit_byte(0x40);
+ emit_int8(0x40);
emit_operand(dst, src);
}
@@ -3312,27 +3318,27 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM6 is for /6 encoding: 66 0F 71 /6 ib
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66);
- emit_byte(0x71);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x71);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::pslld(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM6 is for /6 encoding: 66 0F 72 /6 ib
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66);
- emit_byte(0x72);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x72);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psllq(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM6 is for /6 encoding: 66 0F 73 /6 ib
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66);
- emit_byte(0x73);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x73);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psllw(XMMRegister dst, XMMRegister shift) {
@@ -3354,21 +3360,21 @@
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM6 is for /6 encoding: 66 0F 71 /6 ib
emit_vex_arith(0x71, xmm6, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM6 is for /6 encoding: 66 0F 72 /6 ib
emit_vex_arith(0x72, xmm6, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM6 is for /6 encoding: 66 0F 73 /6 ib
emit_vex_arith(0x73, xmm6, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) {
@@ -3391,18 +3397,18 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM2 is for /2 encoding: 66 0F 71 /2 ib
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66);
- emit_byte(0x71);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x71);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrld(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM2 is for /2 encoding: 66 0F 72 /2 ib
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66);
- emit_byte(0x72);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x72);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrlq(XMMRegister dst, int shift) {
@@ -3411,9 +3417,9 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66);
- emit_byte(0x73);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x73);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrlw(XMMRegister dst, XMMRegister shift) {
@@ -3435,21 +3441,21 @@
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
emit_vex_arith(0x71, xmm2, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
emit_vex_arith(0x72, xmm2, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM2 is for /2 encoding: 66 0F 73 /2 ib
emit_vex_arith(0x73, xmm2, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) {
@@ -3472,18 +3478,18 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM4 is for /4 encoding: 66 0F 71 /4 ib
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66);
- emit_byte(0x71);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x71);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psrad(XMMRegister dst, int shift) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// XMM4 is for /4 encoding: 66 0F 72 /4 ib
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66);
- emit_byte(0x72);
- emit_byte(0xC0 | encode);
- emit_byte(shift & 0xFF);
+ emit_int8(0x72);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(shift & 0xFF);
}
void Assembler::psraw(XMMRegister dst, XMMRegister shift) {
@@ -3500,14 +3506,14 @@
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM4 is for /4 encoding: 66 0F 71 /4 ib
emit_vex_arith(0x71, xmm4, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, bool vector256) {
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2");
// XMM4 is for /4 encoding: 66 0F 71 /4 ib
emit_vex_arith(0x72, xmm4, dst, src, VEX_SIMD_66, vector256);
- emit_byte(shift & 0xFF);
+ emit_int8(shift & 0xFF);
}
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) {
@@ -3572,11 +3578,11 @@
assert(VM_Version::supports_avx(), "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A);
- emit_byte(0x18);
- emit_byte(0xC0 | encode);
+ emit_int8(0x18);
+ emit_int8((unsigned char)(0xC0 | encode));
// 0x00 - insert into lower 128 bits
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vinsertf128h(XMMRegister dst, Address src) {
@@ -3587,10 +3593,10 @@
int dst_enc = dst->encoding();
// swap src<->dst for encoding
vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x18);
+ emit_int8(0x18);
emit_operand(dst, src);
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vextractf128h(Address dst, XMMRegister src) {
@@ -3600,21 +3606,21 @@
assert(src != xnoreg, "sanity");
int src_enc = src->encoding();
vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x19);
+ emit_int8(0x19);
emit_operand(src, dst);
// 0x01 - extract from upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) {
assert(VM_Version::supports_avx2(), "");
bool vector256 = true;
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A);
- emit_byte(0x38);
- emit_byte(0xC0 | encode);
+ emit_int8(0x38);
+ emit_int8((unsigned char)(0xC0 | encode));
// 0x00 - insert into lower 128 bits
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vinserti128h(XMMRegister dst, Address src) {
@@ -3625,10 +3631,10 @@
int dst_enc = dst->encoding();
// swap src<->dst for encoding
vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x38);
+ emit_int8(0x38);
emit_operand(dst, src);
// 0x01 - insert into upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vextracti128h(Address dst, XMMRegister src) {
@@ -3638,16 +3644,16 @@
assert(src != xnoreg, "sanity");
int src_enc = src->encoding();
vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
- emit_byte(0x39);
+ emit_int8(0x39);
emit_operand(src, dst);
// 0x01 - extract from upper 128 bits
- emit_byte(0x01);
+ emit_int8(0x01);
}
void Assembler::vzeroupper() {
assert(VM_Version::supports_avx(), "");
(void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE);
- emit_byte(0x77);
+ emit_int8(0x77);
}
@@ -3657,15 +3663,15 @@
void Assembler::cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec) {
// NO PREFIX AS NEVER 64BIT
InstructionMark im(this);
- emit_byte(0x81);
- emit_byte(0xF8 | src1->encoding());
+ emit_int8((unsigned char)0x81);
+ emit_int8((unsigned char)(0xF8 | src1->encoding()));
emit_data(imm32, rspec, 0);
}
void Assembler::cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec) {
// NO PREFIX AS NEVER 64BIT (not even 32bit versions of 64bit regs
InstructionMark im(this);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, src1);
emit_data(imm32, rspec, 0);
}
@@ -3675,14 +3681,14 @@
// into rdx:rax. The ZF is set if the compared values were equal, and cleared otherwise.
void Assembler::cmpxchg8(Address adr) {
InstructionMark im(this);
- emit_byte(0x0F);
- emit_byte(0xc7);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xC7);
emit_operand(rcx, adr);
}
void Assembler::decl(Register dst) {
// Don't use it directly. Use MacroAssembler::decrementl() instead.
- emit_byte(0x48 | dst->encoding());
+ emit_int8(0x48 | dst->encoding());
}
#endif // _LP64
@@ -3690,8 +3696,8 @@
// 64bit typically doesn't use the x87 but needs to for the trig funcs
void Assembler::fabs() {
- emit_byte(0xD9);
- emit_byte(0xE1);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE1);
}
void Assembler::fadd(int i) {
@@ -3700,13 +3706,13 @@
void Assembler::fadd_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rax, src);
}
void Assembler::fadd_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rax, src);
}
@@ -3719,8 +3725,8 @@
}
void Assembler::fchs() {
- emit_byte(0xD9);
- emit_byte(0xE0);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE0);
}
void Assembler::fcom(int i) {
@@ -3733,29 +3739,29 @@
void Assembler::fcomp_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rbx, src);
}
void Assembler::fcomp_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rbx, src);
}
void Assembler::fcompp() {
- emit_byte(0xDE);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xDE);
+ emit_int8((unsigned char)0xD9);
}
void Assembler::fcos() {
- emit_byte(0xD9);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFF);
}
void Assembler::fdecstp() {
- emit_byte(0xD9);
- emit_byte(0xF6);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF6);
}
void Assembler::fdiv(int i) {
@@ -3764,13 +3770,13 @@
void Assembler::fdiv_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rsi, src);
}
void Assembler::fdiv_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rsi, src);
}
@@ -3791,13 +3797,13 @@
void Assembler::fdivr_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rdi, src);
}
void Assembler::fdivr_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rdi, src);
}
@@ -3815,59 +3821,59 @@
void Assembler::fild_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDF);
+ emit_int8((unsigned char)0xDF);
emit_operand32(rbp, adr);
}
void Assembler::fild_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rax, adr);
}
void Assembler::fincstp() {
- emit_byte(0xD9);
- emit_byte(0xF7);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF7);
}
void Assembler::finit() {
- emit_byte(0x9B);
- emit_byte(0xDB);
- emit_byte(0xE3);
+ emit_int8((unsigned char)0x9B);
+ emit_int8((unsigned char)0xDB);
+ emit_int8((unsigned char)0xE3);
}
void Assembler::fist_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rdx, adr);
}
void Assembler::fistp_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDF);
+ emit_int8((unsigned char)0xDF);
emit_operand32(rdi, adr);
}
void Assembler::fistp_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rbx, adr);
}
void Assembler::fld1() {
- emit_byte(0xD9);
- emit_byte(0xE8);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE8);
}
void Assembler::fld_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rax, adr);
}
void Assembler::fld_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rax, adr);
}
@@ -3878,35 +3884,35 @@
void Assembler::fld_x(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rbp, adr);
}
void Assembler::fldcw(Address src) {
InstructionMark im(this);
- emit_byte(0xd9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rbp, src);
}
void Assembler::fldenv(Address src) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rsp, src);
}
void Assembler::fldlg2() {
- emit_byte(0xD9);
- emit_byte(0xEC);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xEC);
}
void Assembler::fldln2() {
- emit_byte(0xD9);
- emit_byte(0xED);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xED);
}
void Assembler::fldz() {
- emit_byte(0xD9);
- emit_byte(0xEE);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xEE);
}
void Assembler::flog() {
@@ -3927,13 +3933,13 @@
void Assembler::fmul_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rcx, src);
}
void Assembler::fmul_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rcx, src);
}
@@ -3947,63 +3953,63 @@
void Assembler::fnsave(Address dst) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rsi, dst);
}
void Assembler::fnstcw(Address src) {
InstructionMark im(this);
- emit_byte(0x9B);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0x9B);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rdi, src);
}
void Assembler::fnstsw_ax() {
- emit_byte(0xdF);
- emit_byte(0xE0);
+ emit_int8((unsigned char)0xDF);
+ emit_int8((unsigned char)0xE0);
}
void Assembler::fprem() {
- emit_byte(0xD9);
- emit_byte(0xF8);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF8);
}
void Assembler::fprem1() {
- emit_byte(0xD9);
- emit_byte(0xF5);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF5);
}
void Assembler::frstor(Address src) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rsp, src);
}
void Assembler::fsin() {
- emit_byte(0xD9);
- emit_byte(0xFE);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFE);
}
void Assembler::fsqrt() {
- emit_byte(0xD9);
- emit_byte(0xFA);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFA);
}
void Assembler::fst_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rdx, adr);
}
void Assembler::fst_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rdx, adr);
}
void Assembler::fstp_d(Address adr) {
InstructionMark im(this);
- emit_byte(0xDD);
+ emit_int8((unsigned char)0xDD);
emit_operand32(rbx, adr);
}
@@ -4013,13 +4019,13 @@
void Assembler::fstp_s(Address adr) {
InstructionMark im(this);
- emit_byte(0xD9);
+ emit_int8((unsigned char)0xD9);
emit_operand32(rbx, adr);
}
void Assembler::fstp_x(Address adr) {
InstructionMark im(this);
- emit_byte(0xDB);
+ emit_int8((unsigned char)0xDB);
emit_operand32(rdi, adr);
}
@@ -4029,13 +4035,13 @@
void Assembler::fsub_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rsp, src);
}
void Assembler::fsub_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rsp, src);
}
@@ -4053,13 +4059,13 @@
void Assembler::fsubr_d(Address src) {
InstructionMark im(this);
- emit_byte(0xDC);
+ emit_int8((unsigned char)0xDC);
emit_operand32(rbp, src);
}
void Assembler::fsubr_s(Address src) {
InstructionMark im(this);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD8);
emit_operand32(rbp, src);
}
@@ -4072,15 +4078,15 @@
}
void Assembler::ftan() {
- emit_byte(0xD9);
- emit_byte(0xF2);
- emit_byte(0xDD);
- emit_byte(0xD8);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF2);
+ emit_int8((unsigned char)0xDD);
+ emit_int8((unsigned char)0xD8);
}
void Assembler::ftst() {
- emit_byte(0xD9);
- emit_byte(0xE4);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xE4);
}
void Assembler::fucomi(int i) {
@@ -4096,7 +4102,7 @@
}
void Assembler::fwait() {
- emit_byte(0x9B);
+ emit_int8((unsigned char)0x9B);
}
void Assembler::fxch(int i) {
@@ -4104,23 +4110,23 @@
}
void Assembler::fyl2x() {
- emit_byte(0xD9);
- emit_byte(0xF1);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF1);
}
void Assembler::frndint() {
- emit_byte(0xD9);
- emit_byte(0xFC);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xFC);
}
void Assembler::f2xm1() {
- emit_byte(0xD9);
- emit_byte(0xF0);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xF0);
}
void Assembler::fldl2e() {
- emit_byte(0xD9);
- emit_byte(0xEA);
+ emit_int8((unsigned char)0xD9);
+ emit_int8((unsigned char)0xEA);
}
// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding.
@@ -4131,7 +4137,7 @@
// Generate SSE legacy REX prefix and SIMD opcode based on VEX encoding.
void Assembler::rex_prefix(Address adr, XMMRegister xreg, VexSimdPrefix pre, VexOpcode opc, bool rex_w) {
if (pre > 0) {
- emit_byte(simd_pre[pre]);
+ emit_int8(simd_pre[pre]);
}
if (rex_w) {
prefixq(adr, xreg);
@@ -4139,25 +4145,25 @@
prefix(adr, xreg);
}
if (opc > 0) {
- emit_byte(0x0F);
+ emit_int8(0x0F);
int opc2 = simd_opc[opc];
if (opc2 > 0) {
- emit_byte(opc2);
+ emit_int8(opc2);
}
}
}
int Assembler::rex_prefix_and_encode(int dst_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool rex_w) {
if (pre > 0) {
- emit_byte(simd_pre[pre]);
+ emit_int8(simd_pre[pre]);
}
int encode = (rex_w) ? prefixq_and_encode(dst_enc, src_enc) :
prefix_and_encode(dst_enc, src_enc);
if (opc > 0) {
- emit_byte(0x0F);
+ emit_int8(0x0F);
int opc2 = simd_opc[opc];
if (opc2 > 0) {
- emit_byte(opc2);
+ emit_int8(opc2);
}
}
return encode;
@@ -4171,11 +4177,11 @@
int byte1 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0);
byte1 = (~byte1) & 0xE0;
byte1 |= opc;
- a_byte(byte1);
+ emit_int8(byte1);
int byte2 = ((~nds_enc) & 0xf) << 3;
byte2 |= (vex_w ? VEX_W : 0) | (vector256 ? 4 : 0) | pre;
- emit_byte(byte2);
+ emit_int8(byte2);
} else {
prefix(VEX_2bytes);
@@ -4183,7 +4189,7 @@
byte1 = (~byte1) & 0x80;
byte1 |= ((~nds_enc) & 0xf) << 3;
byte1 |= (vector256 ? 4 : 0) | pre;
- emit_byte(byte1);
+ emit_int8(byte1);
}
}
@@ -4229,28 +4235,28 @@
void Assembler::emit_simd_arith(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) {
InstructionMark im(this);
simd_prefix(dst, dst, src, pre);
- emit_byte(opcode);
+ emit_int8(opcode);
emit_operand(dst, src);
}
void Assembler::emit_simd_arith(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) {
int encode = simd_prefix_and_encode(dst, dst, src, pre);
- emit_byte(opcode);
- emit_byte(0xC0 | encode);
+ emit_int8(opcode);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// Versions with no second source register (non-destructive source).
void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) {
InstructionMark im(this);
simd_prefix(dst, xnoreg, src, pre);
- emit_byte(opcode);
+ emit_int8(opcode);
emit_operand(dst, src);
}
void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) {
int encode = simd_prefix_and_encode(dst, xnoreg, src, pre);
- emit_byte(opcode);
- emit_byte(0xC0 | encode);
+ emit_int8(opcode);
+ emit_int8((unsigned char)(0xC0 | encode));
}
// 3-operands AVX instructions
@@ -4258,22 +4264,22 @@
Address src, VexSimdPrefix pre, bool vector256) {
InstructionMark im(this);
vex_prefix(dst, nds, src, pre, vector256);
- emit_byte(opcode);
+ emit_int8(opcode);
emit_operand(dst, src);
}
void Assembler::emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds,
XMMRegister src, VexSimdPrefix pre, bool vector256) {
int encode = vex_prefix_and_encode(dst, nds, src, pre, vector256);
- emit_byte(opcode);
- emit_byte(0xC0 | encode);
+ emit_int8(opcode);
+ emit_int8((unsigned char)(0xC0 | encode));
}
#ifndef _LP64
void Assembler::incl(Register dst) {
// Don't use it directly. Use MacroAssembler::incrementl() instead.
- emit_byte(0x40 | dst->encoding());
+ emit_int8(0x40 | dst->encoding());
}
void Assembler::lea(Register dst, Address src) {
@@ -4282,7 +4288,7 @@
void Assembler::mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst);
emit_data((int)imm32, rspec, 0);
}
@@ -4290,49 +4296,49 @@
void Assembler::mov_literal32(Register dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_data((int)imm32, rspec, 0);
}
void Assembler::popa() { // 32bit
- emit_byte(0x61);
+ emit_int8(0x61);
}
void Assembler::push_literal32(int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
- emit_byte(0x68);
+ emit_int8(0x68);
emit_data(imm32, rspec, 0);
}
void Assembler::pusha() { // 32bit
- emit_byte(0x60);
+ emit_int8(0x60);
}
void Assembler::set_byte_if_not_zero(Register dst) {
- emit_byte(0x0F);
- emit_byte(0x95);
- emit_byte(0xE0 | dst->encoding());
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0x95);
+ emit_int8((unsigned char)(0xE0 | dst->encoding()));
}
void Assembler::shldl(Register dst, Register src) {
- emit_byte(0x0F);
- emit_byte(0xA5);
- emit_byte(0xC0 | src->encoding() << 3 | dst->encoding());
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xA5);
+ emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding()));
}
void Assembler::shrdl(Register dst, Register src) {
- emit_byte(0x0F);
- emit_byte(0xAD);
- emit_byte(0xC0 | src->encoding() << 3 | dst->encoding());
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAD);
+ emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding()));
}
#else // LP64
void Assembler::set_byte_if_not_zero(Register dst) {
int enc = prefix_and_encode(dst->encoding(), true);
- emit_byte(0x0F);
- emit_byte(0x95);
- emit_byte(0xE0 | enc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0x95);
+ emit_int8((unsigned char)(0xE0 | enc));
}
// 64bit only pieces of the assembler
@@ -4670,7 +4676,7 @@
void Assembler::adcq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x13);
+ emit_int8(0x13);
emit_operand(dst, src);
}
@@ -4688,7 +4694,7 @@
void Assembler::addq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x01);
+ emit_int8(0x01);
emit_operand(src, dst);
}
@@ -4700,7 +4706,7 @@
void Assembler::addq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x03);
+ emit_int8(0x03);
emit_operand(dst, src);
}
@@ -4712,7 +4718,7 @@
void Assembler::andq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rsp, dst, 4);
emit_long(imm32);
}
@@ -4725,7 +4731,7 @@
void Assembler::andq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x23);
+ emit_int8(0x23);
emit_operand(dst, src);
}
@@ -4736,56 +4742,56 @@
void Assembler::bsfq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBC);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBC);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bsrq(Register dst, Register src) {
assert(!VM_Version::supports_lzcnt(), "encoding is treated as LZCNT");
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::bswapq(Register reg) {
int encode = prefixq_and_encode(reg->encoding());
- emit_byte(0x0F);
- emit_byte(0xC8 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0xC8 | encode));
}
void Assembler::cdqq() {
prefix(REX_W);
- emit_byte(0x99);
+ emit_int8((unsigned char)0x99);
}
void Assembler::clflush(Address adr) {
prefix(adr);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(rdi, adr);
}
void Assembler::cmovq(Condition cc, Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cmovq(Condition cc, Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0x40 | cc);
+ emit_int8(0x0F);
+ emit_int8(0x40 | cc);
emit_operand(dst, src);
}
void Assembler::cmpq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rdi, dst, 4);
emit_long(imm32);
}
@@ -4798,7 +4804,7 @@
void Assembler::cmpq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x3B);
+ emit_int8(0x3B);
emit_operand(src, dst);
}
@@ -4810,122 +4816,122 @@
void Assembler::cmpq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x3B);
+ emit_int8(0x3B);
emit_operand(dst, src);
}
void Assembler::cmpxchgq(Register reg, Address adr) {
InstructionMark im(this);
prefixq(adr, reg);
- emit_byte(0x0F);
- emit_byte(0xB1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB1);
emit_operand(reg, adr);
}
void Assembler::cvtsi2sdq(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F2);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2sdq(XMMRegister dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
InstructionMark im(this);
simd_prefix_q(dst, dst, src, VEX_SIMD_F2);
- emit_byte(0x2A);
+ emit_int8(0x2A);
emit_operand(dst, src);
}
void Assembler::cvtsi2ssq(XMMRegister dst, Register src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F3);
- emit_byte(0x2A);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2A);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvtsi2ssq(XMMRegister dst, Address src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
InstructionMark im(this);
simd_prefix_q(dst, dst, src, VEX_SIMD_F3);
- emit_byte(0x2A);
+ emit_int8(0x2A);
emit_operand(dst, src);
}
void Assembler::cvttsd2siq(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F2);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::cvttss2siq(Register dst, XMMRegister src) {
NOT_LP64(assert(VM_Version::supports_sse(), ""));
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F3);
- emit_byte(0x2C);
- emit_byte(0xC0 | encode);
+ emit_int8(0x2C);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::decl(Register dst) {
// Don't use it directly. Use MacroAssembler::decrementl() instead.
// Use two-byte form (one-byte form is a REX prefix in 64-bit mode)
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC8 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xC8 | encode));
}
void Assembler::decq(Register dst) {
// Don't use it directly. Use MacroAssembler::decrementq() instead.
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC8 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8(0xC8 | encode);
}
void Assembler::decq(Address dst) {
// Don't use it directly. Use MacroAssembler::decrementq() instead.
InstructionMark im(this);
prefixq(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rcx, dst);
}
void Assembler::fxrstor(Address src) {
prefixq(src);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(1), src);
}
void Assembler::fxsave(Address dst) {
prefixq(dst);
- emit_byte(0x0F);
- emit_byte(0xAE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAE);
emit_operand(as_Register(0), dst);
}
void Assembler::idivq(Register src) {
int encode = prefixq_and_encode(src->encoding());
- emit_byte(0xF7);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::imulq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xAF);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xAF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::imulq(Register dst, Register src, int value) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
if (is8bit(value)) {
- emit_byte(0x6B);
- emit_byte(0xC0 | encode);
- emit_byte(value & 0xFF);
+ emit_int8(0x6B);
+ emit_int8((unsigned char)(0xC0 | encode));
+ emit_int8(value & 0xFF);
} else {
- emit_byte(0x69);
- emit_byte(0xC0 | encode);
+ emit_int8(0x69);
+ emit_int8((unsigned char)(0xC0 | encode));
emit_long(value);
}
}
@@ -4934,23 +4940,23 @@
// Don't use it directly. Use MacroAssembler::incrementl() instead.
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::incq(Register dst) {
// Don't use it directly. Use MacroAssembler::incrementq() instead.
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode)
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xFF);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xFF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::incq(Address dst) {
// Don't use it directly. Use MacroAssembler::incrementq() instead.
InstructionMark im(this);
prefixq(dst);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rax, dst);
}
@@ -4961,35 +4967,35 @@
void Assembler::leaq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x8D);
+ emit_int8((unsigned char)0x8D);
emit_operand(dst, src);
}
void Assembler::mov64(Register dst, int64_t imm64) {
InstructionMark im(this);
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_int64(imm64);
}
void Assembler::mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8(0xB8 | encode);
emit_data64(imm64, rspec);
}
void Assembler::mov_narrow_oop(Register dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefix_and_encode(dst->encoding());
- emit_byte(0xB8 | encode);
+ emit_int8((unsigned char)(0xB8 | encode));
emit_data((int)imm32, rspec, narrow_oop_operand);
}
void Assembler::mov_narrow_oop(Address dst, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
prefix(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 4);
emit_data((int)imm32, rspec, narrow_oop_operand);
}
@@ -4997,34 +5003,34 @@
void Assembler::cmp_narrow_oop(Register src1, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
int encode = prefix_and_encode(src1->encoding());
- emit_byte(0x81);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0x81);
+ emit_int8((unsigned char)(0xF8 | encode));
emit_data((int)imm32, rspec, narrow_oop_operand);
}
void Assembler::cmp_narrow_oop(Address src1, int32_t imm32, RelocationHolder const& rspec) {
InstructionMark im(this);
prefix(src1);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rax, src1, 4);
emit_data((int)imm32, rspec, narrow_oop_operand);
}
void Assembler::lzcntq(Register dst, Register src) {
assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBD);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBD);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdq(XMMRegister dst, Register src) {
// table D-1 says MMX/SSE2
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_66);
- emit_byte(0x6E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x6E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movdq(Register dst, XMMRegister src) {
@@ -5032,43 +5038,43 @@
NOT_LP64(assert(VM_Version::supports_sse2(), ""));
// swap src/dst to get correct prefix
int encode = simd_prefix_and_encode_q(src, dst, VEX_SIMD_66);
- emit_byte(0x7E);
- emit_byte(0xC0 | encode);
+ emit_int8(0x7E);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x8B);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x8B);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x8B);
+ emit_int8((unsigned char)0x8B);
emit_operand(dst, src);
}
void Assembler::movq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x89);
+ emit_int8((unsigned char)0x89);
emit_operand(src, dst);
}
void Assembler::movsbq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBE);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
emit_operand(dst, src);
}
void Assembler::movsbq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBE);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBE);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movslq(Register dst, int32_t imm32) {
@@ -5078,7 +5084,7 @@
ShouldNotReachHere();
InstructionMark im(this);
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xC7 | encode);
+ emit_int8((unsigned char)(0xC7 | encode));
emit_long(imm32);
}
@@ -5086,7 +5092,7 @@
assert(is_simm32(imm32), "lost bits");
InstructionMark im(this);
prefixq(dst);
- emit_byte(0xC7);
+ emit_int8((unsigned char)0xC7);
emit_operand(rax, dst, 4);
emit_long(imm32);
}
@@ -5094,77 +5100,77 @@
void Assembler::movslq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x63);
+ emit_int8(0x63);
emit_operand(dst, src);
}
void Assembler::movslq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x63);
- emit_byte(0xC0 | encode);
+ emit_int8(0x63);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movswq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xBF);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xBF);
emit_operand(dst, src);
}
void Assembler::movswq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xBF);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xBF);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::movzbq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB6);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB6);
emit_operand(dst, src);
}
void Assembler::movzbq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB6);
- emit_byte(0xC0 | encode);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xB6);
+ emit_int8(0xC0 | encode);
}
void Assembler::movzwq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB7);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB7);
emit_operand(dst, src);
}
void Assembler::movzwq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB7);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB7);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::negq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD8 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD8 | encode));
}
void Assembler::notq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xF7);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xD0 | encode));
}
void Assembler::orq(Address dst, int32_t imm32) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x81);
+ emit_int8((unsigned char)0x81);
emit_operand(rcx, dst, 4);
emit_long(imm32);
}
@@ -5177,7 +5183,7 @@
void Assembler::orq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x0B);
+ emit_int8(0x0B);
emit_operand(dst, src);
}
@@ -5210,26 +5216,26 @@
void Assembler::popcntq(Register dst, Address src) {
assert(VM_Version::supports_popcnt(), "must support");
InstructionMark im(this);
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
prefixq(src, dst);
- emit_byte(0x0F);
- emit_byte(0xB8);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB8);
emit_operand(dst, src);
}
void Assembler::popcntq(Register dst, Register src) {
assert(VM_Version::supports_popcnt(), "must support");
- emit_byte(0xF3);
+ emit_int8((unsigned char)0xF3);
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x0F);
- emit_byte(0xB8);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0x0F);
+ emit_int8((unsigned char)0xB8);
+ emit_int8((unsigned char)(0xC0 | encode));
}
void Assembler::popq(Address dst) {
InstructionMark im(this);
prefixq(dst);
- emit_byte(0x8F);
+ emit_int8((unsigned char)0x8F);
emit_operand(rax, dst);
}
@@ -5261,7 +5267,7 @@
void Assembler::pushq(Address src) {
InstructionMark im(this);
prefixq(src);
- emit_byte(0xFF);
+ emit_int8((unsigned char)0xFF);
emit_operand(rsi, src);
}
@@ -5269,31 +5275,31 @@
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xD0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xD0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xD0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xD0 | encode));
+ emit_int8(imm8);
}
}
void Assembler::sarq(Register dst, int imm8) {
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xF8 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xF8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xF8 | encode));
+ emit_int8(imm8);
}
}
void Assembler::sarq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xF8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xF8 | encode));
}
void Assembler::sbbq(Address dst, int32_t imm32) {
@@ -5310,7 +5316,7 @@
void Assembler::sbbq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x1B);
+ emit_int8(0x1B);
emit_operand(dst, src);
}
@@ -5323,33 +5329,33 @@
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
if (imm8 == 1) {
- emit_byte(0xD1);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD1);
+ emit_int8((unsigned char)(0xE0 | encode));
} else {
- emit_byte(0xC1);
- emit_byte(0xE0 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE0 | encode));
+ emit_int8(imm8);
}
}
void Assembler::shlq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE0 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8((unsigned char)(0xE0 | encode));
}
void Assembler::shrq(Register dst, int imm8) {
assert(isShiftCount(imm8 >> 1), "illegal shift count");
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xC1);
- emit_byte(0xE8 | encode);
- emit_byte(imm8);
+ emit_int8((unsigned char)0xC1);
+ emit_int8((unsigned char)(0xE8 | encode));
+ emit_int8(imm8);
}
void Assembler::shrq(Register dst) {
int encode = prefixq_and_encode(dst->encoding());
- emit_byte(0xD3);
- emit_byte(0xE8 | encode);
+ emit_int8((unsigned char)0xD3);
+ emit_int8(0xE8 | encode);
}
void Assembler::subq(Address dst, int32_t imm32) {
@@ -5361,7 +5367,7 @@
void Assembler::subq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x29);
+ emit_int8(0x29);
emit_operand(src, dst);
}
@@ -5379,7 +5385,7 @@
void Assembler::subq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x2B);
+ emit_int8(0x2B);
emit_operand(dst, src);
}
@@ -5395,11 +5401,11 @@
int encode = dst->encoding();
if (encode == 0) {
prefix(REX_W);
- emit_byte(0xA9);
+ emit_int8((unsigned char)0xA9);
} else {
encode = prefixq_and_encode(encode);
- emit_byte(0xF7);
- emit_byte(0xC0 | encode);
+ emit_int8((unsigned char)0xF7);
+ emit_int8((unsigned char)(0xC0 | encode));
}
emit_long(imm32);
}
@@ -5412,22 +5418,22 @@
void Assembler::xaddq(Address dst, Register src) {
InstructionMark im(this);
prefixq(dst, src);
- emit_byte(0x0F);
- emit_byte(0xC1);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)0xC1);
emit_operand(src, dst);
}
void Assembler::xchgq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x87);
+ emit_int8((unsigned char)0x87);
emit_operand(dst, src);
}
void Assembler::xchgq(Register dst, Register src) {
int encode = prefixq_and_encode(dst->encoding(), src->encoding());
- emit_byte(0x87);
- emit_byte(0xc0 | encode);
+ emit_int8((unsigned char)0x87);
+ emit_int8((unsigned char)(0xc0 | encode));
}
void Assembler::xorq(Register dst, Register src) {
@@ -5438,7 +5444,7 @@
void Assembler::xorq(Register dst, Address src) {
InstructionMark im(this);
prefixq(src, dst);
- emit_byte(0x33);
+ emit_int8(0x33);
emit_operand(dst, src);
}
--- a/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -313,10 +313,10 @@
#endif
} else {
// make a copy the code which is going to be patched.
- for ( int i = 0; i < _bytes_to_copy; i++) {
+ for (int i = 0; i < _bytes_to_copy; i++) {
address ptr = (address)(_pc_start + i);
int a_byte = (*ptr) & 0xFF;
- __ a_byte (a_byte);
+ __ emit_int8(a_byte);
*ptr = 0x90; // make the site look like a nop
}
}
@@ -363,11 +363,11 @@
// emit the offsets needed to find the code to patch
int being_initialized_entry_offset = __ pc() - being_initialized_entry + sizeof_patch_record;
- __ a_byte(0xB8);
- __ a_byte(0);
- __ a_byte(being_initialized_entry_offset);
- __ a_byte(bytes_to_skip);
- __ a_byte(_bytes_to_copy);
+ __ emit_int8((unsigned char)0xB8);
+ __ emit_int8(0);
+ __ emit_int8(being_initialized_entry_offset);
+ __ emit_int8(bytes_to_skip);
+ __ emit_int8(_bytes_to_copy);
address patch_info_pc = __ pc();
assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info");
--- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -611,8 +611,6 @@
// C++ interpreter only
// rsi/r13 - previous interpreter state pointer
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes one argument
// indicating if the counter overflow occurs at a backwards branch (non-NULL bcp).
// The call returns the address of the verified entry point for the method or NULL
@@ -977,15 +975,16 @@
// to save/restore.
address entry_point = __ pc();
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset());
// rsi/r13 == state/locals rdi == prevstate
const Register locals = rdi;
// get parameter size (always needed)
+ __ movptr(rcx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx: Method*
@@ -994,6 +993,7 @@
// for natives the size of locals is zero
// compute beginning of parameters /locals
+
__ lea(locals, Address(rsp, rcx, Address::times_ptr, -wordSize));
// initialize fixed part of activation frame
@@ -1107,11 +1107,14 @@
const Register method = rbx;
const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rdi);
const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); // rcx|rscratch1
+ const Address constMethod (method, Method::const_offset());
+ const Address size_of_parameters(t, ConstMethod::size_of_parameters_offset());
// allocate space for parameters
__ movptr(method, STATE(_method));
__ verify_method_ptr(method);
- __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
+ __ movptr(t, constMethod);
+ __ load_unsigned_short(t, size_of_parameters);
__ shll(t, 2);
#ifdef _LP64
__ subptr(rsp, t);
@@ -1700,15 +1703,17 @@
// save sender sp
__ push(rcx);
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset());
// const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
// const Address monitor_block_bot (rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
// const Address monitor(rbp, frame::interpreter_frame_initial_sp_offset * wordSize - (int)sizeof(BasicObjectLock));
// get parameter size (always needed)
+ __ movptr(rdx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx: Method*
@@ -1989,7 +1994,9 @@
__ movptr(rbx, STATE(_result._to_call._callee));
// callee left args on top of expression stack, remove them
- __ load_unsigned_short(rcx, Address(rbx, Method::size_of_parameters_offset()));
+ __ movptr(rcx, constMethod);
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
+
__ lea(rsp, Address(rsp, rcx, Address::times_ptr));
__ movl(rcx, Address(rbx, Method::result_index_offset()));
@@ -2159,7 +2166,9 @@
// Make it look like call_stub calling conventions
// Get (potential) receiver
- __ load_unsigned_short(rcx, size_of_parameters); // get size of parameters in words
+ // get size of parameters in words
+ __ movptr(rcx, constMethod);
+ __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset()));
ExternalAddress recursive(CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation));
__ pushptr(recursive.addr()); // make it look good in the debugger
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -1023,7 +1023,7 @@
void MacroAssembler::leave() {
// %%% is this really better? Why not on 32bit too?
- emit_byte(0xC9); // LEAVE
+ emit_int8((unsigned char)0xC9); // LEAVE
}
void MacroAssembler::lneg(Register hi, Register lo) {
@@ -2112,11 +2112,11 @@
if (UseAddressNop) {
addr_nop_5();
} else {
- emit_byte(0x26); // es:
- emit_byte(0x2e); // cs:
- emit_byte(0x64); // fs:
- emit_byte(0x65); // gs:
- emit_byte(0x90);
+ emit_int8(0x26); // es:
+ emit_int8(0x2e); // cs:
+ emit_int8(0x64); // fs:
+ emit_int8(0x65); // gs:
+ emit_int8((unsigned char)0x90);
}
}
@@ -2534,12 +2534,12 @@
int offs = (intptr_t)dst.target() - ((intptr_t)pc());
if (dst.reloc() == relocInfo::none && is8bit(offs - short_size)) {
// 0111 tttn #8-bit disp
- emit_byte(0x70 | cc);
- emit_byte((offs - short_size) & 0xFF);
+ emit_int8(0x70 | cc);
+ emit_int8((offs - short_size) & 0xFF);
} else {
// 0000 1111 1000 tttn #32-bit disp
- emit_byte(0x0F);
- emit_byte(0x80 | cc);
+ emit_int8(0x0F);
+ emit_int8((unsigned char)(0x80 | cc));
emit_long(offs - long_size);
}
} else {
@@ -3085,7 +3085,8 @@
void MacroAssembler::pshufb(XMMRegister dst, AddressLiteral src) {
// Used in sign-bit flipping with aligned address.
- assert((UseAVX > 0) || (((intptr_t)src.target() & 15) == 0), "SSE mode requires address alignment 16 bytes");
+ bool aligned_adr = (((intptr_t)src.target() & 15) == 0);
+ assert((UseAVX > 0) || aligned_adr, "SSE mode requires address alignment 16 bytes");
if (reachable(src)) {
Assembler::pshufb(dst, as_Address(src));
} else {
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -126,25 +126,6 @@
}
}
-#ifndef PRODUCT
- static void pd_print_patched_instruction(address branch) {
- const char* s;
- unsigned char op = branch[0];
- if (op == 0xE8) {
- s = "call";
- } else if (op == 0xE9 || op == 0xEB) {
- s = "jmp";
- } else if ((op & 0xF0) == 0x70) {
- s = "jcc";
- } else if (op == 0x0F) {
- s = "jcc";
- } else {
- s = "????";
- }
- tty->print("%s (unresolved)", s);
- }
-#endif
-
// The following 4 methods return the offset of the appropriate move instruction
// Support for fast byte/short loading with zero extension (depending on particular CPU)
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -169,8 +169,9 @@
if (VerifyMethodHandles && !for_compiler_entry) {
// make sure recv is already on stack
+ __ movptr(temp2, Address(method_temp, Method::const_offset()));
__ load_sized_value(temp2,
- Address(method_temp, Method::size_of_parameters_offset()),
+ Address(temp2, ConstMethod::size_of_parameters_offset()),
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
Label L;
@@ -234,8 +235,9 @@
int ref_kind = signature_polymorphic_intrinsic_ref_kind(iid);
assert(ref_kind != 0 || iid == vmIntrinsics::_invokeBasic, "must be _invokeBasic or a linkTo intrinsic");
if (ref_kind == 0 || MethodHandles::ref_kind_has_receiver(ref_kind)) {
+ __ movptr(rdx_argp, Address(rbx_method, Method::const_offset()));
__ load_sized_value(rdx_argp,
- Address(rbx_method, Method::size_of_parameters_offset()),
+ Address(rdx_argp, ConstMethod::size_of_parameters_offset()),
sizeof(u2), /*is_signed*/ false);
// assert(sizeof(u2) == sizeof(Method::_size_of_parameters), "");
rdx_first_arg_addr = __ argument_address(rdx_argp, -1);
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2174,13 +2174,13 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_encryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_encryptBlock");
Label L_doLast;
address start = __ pc();
- const Register from = rsi; // source array address
+ const Register from = rdx; // source array address
const Register to = rdx; // destination array address
const Register key = rcx; // key array address
const Register keylen = rax;
@@ -2189,47 +2189,74 @@
const Address key_param (rbp, 8+8);
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
-
- __ enter(); // required for proper stackwalking of RuntimeStub frame
- __ push(rsi);
- __ movptr(from , from_param);
- __ movptr(to , to_param);
- __ movptr(key , key_param);
-
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
+
+ __ enter(); // required for proper stackwalking of RuntimeStub frame
+ __ movptr(from, from_param);
+ __ movptr(key, key_param);
+
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0)); // get 16 bytes of input
+ __ movptr(to, to_param);
// For encryption, the java expanded key ordering is just what we need
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ pxor(xmm_result, xmm_temp);
- for (int offset = 0x10; offset <= 0x90; offset += 0x10) {
- aes_enc_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- load_key (xmm_temp, key, 0xa0, xmm_key_shuf_mask);
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 192 and 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x00, xmm_key_shuf_mask);
+ __ pxor(xmm_result, xmm_temp1);
+
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
- __ aesenclast(xmm_result, xmm_temp);
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenclast(xmm_result, xmm_temp2);
__ movdqu(Address(to, 0), xmm_result); // store the result
__ xorptr(rax, rax); // return 0
- __ pop(rsi);
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
@@ -2245,13 +2272,13 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_decryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
Label L_doLast;
address start = __ pc();
- const Register from = rsi; // source array address
+ const Register from = rdx; // source array address
const Register to = rdx; // destination array address
const Register key = rcx; // key array address
const Register keylen = rax;
@@ -2260,51 +2287,76 @@
const Address key_param (rbp, 8+8);
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
__ enter(); // required for proper stackwalking of RuntimeStub frame
- __ push(rsi);
- __ movptr(from , from_param);
- __ movptr(to , to_param);
- __ movptr(key , key_param);
-
+ __ movptr(from, from_param);
+ __ movptr(key, key_param);
+
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0));
+ __ movptr(to, to_param);
// for decryption java expanded key ordering is rotated one position from what we want
// so we start from 0x10 here and hit 0x00 last
// we don't know if the key is aligned, hence not using load-execute form
- load_key(xmm_temp, key, 0x10, xmm_key_shuf_mask);
- __ pxor (xmm_result, xmm_temp);
- for (int offset = 0x20; offset <= 0xa0; offset += 0x10) {
- aes_dec_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- // only in 192 and 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- // only in 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ pxor (xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x00, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
// for decryption the aesdeclast operation is always on key+0x00
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ aesdeclast(xmm_result, xmm_temp);
-
+ __ aesdeclast(xmm_result, xmm_temp3);
__ movdqu(Address(to, 0), xmm_result); // store the result
-
__ xorptr(rax, rax); // return 0
- __ pop(rsi);
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
@@ -2340,7 +2392,7 @@
// c_rarg4 - input length
//
address generate_cipherBlockChaining_encryptAESCrypt() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_encryptAESCrypt");
address start = __ pc();
@@ -2393,7 +2445,7 @@
__ jcc(Assembler::notEqual, L_key_192_256);
// 128 bit code follows here
- __ movptr(pos, 0);
+ __ movl(pos, 0);
__ align(OptoLoopAlignment);
__ BIND(L_loopTop_128);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
@@ -2423,15 +2475,15 @@
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
- __ BIND(L_key_192_256);
- // here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
+ __ BIND(L_key_192_256);
+ // here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
__ cmpl(rax, 52);
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be changed to use more xmm registers)
- __ movptr(pos, 0);
- __ align(OptoLoopAlignment);
- __ BIND(L_loopTop_192);
+ __ movl(pos, 0);
+ __ align(OptoLoopAlignment);
+ __ BIND(L_loopTop_192);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
@@ -2452,11 +2504,11 @@
__ jcc(Assembler::notEqual, L_loopTop_192);
__ jmp(L_exit);
- __ BIND(L_key_256);
+ __ BIND(L_key_256);
// 256-bit code follows here (could be changed to use more xmm registers)
- __ movptr(pos, 0);
- __ align(OptoLoopAlignment);
- __ BIND(L_loopTop_256);
+ __ movl(pos, 0);
+ __ align(OptoLoopAlignment);
+ __ BIND(L_loopTop_256);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
@@ -2495,7 +2547,7 @@
//
address generate_cipherBlockChaining_decryptAESCrypt() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
address start = __ pc();
@@ -2556,9 +2608,9 @@
// 128-bit code follows here, parallelized
- __ movptr(pos, 0);
- __ align(OptoLoopAlignment);
- __ BIND(L_singleBlock_loopTop_128);
+ __ movl(pos, 0);
+ __ align(OptoLoopAlignment);
+ __ BIND(L_singleBlock_loopTop_128);
__ cmpptr(len_reg, 0); // any blocks left??
__ jcc(Assembler::equal, L_exit);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
@@ -2597,7 +2649,7 @@
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be optimized to use parallelism)
- __ movptr(pos, 0);
+ __ movl(pos, 0);
__ align(OptoLoopAlignment);
__ BIND(L_singleBlock_loopTop_192);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
@@ -2622,7 +2674,7 @@
__ BIND(L_key_256);
// 256-bit code follows here (could be optimized to use parallelism)
- __ movptr(pos, 0);
+ __ movl(pos, 0);
__ align(OptoLoopAlignment);
__ BIND(L_singleBlock_loopTop_256);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2953,21 +2953,6 @@
}
}
- // aesenc using specified key+offset
- // can optionally specify that the shuffle mask is already in an xmmregister
- void aes_enc_key(XMMRegister xmmdst, XMMRegister xmmtmp, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) {
- load_key(xmmtmp, key, offset, xmm_shuf_mask);
- __ aesenc(xmmdst, xmmtmp);
- }
-
- // aesdec using specified key+offset
- // can optionally specify that the shuffle mask is already in an xmmregister
- void aes_dec_key(XMMRegister xmmdst, XMMRegister xmmtmp, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) {
- load_key(xmmtmp, key, offset, xmm_shuf_mask);
- __ aesdec(xmmdst, xmmtmp);
- }
-
-
// Arguments:
//
// Inputs:
@@ -2976,7 +2961,7 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_encryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_encryptBlock");
Label L_doLast;
@@ -2988,15 +2973,17 @@
const Register keylen = rax;
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ // On win64 xmm6-xmm15 must be preserved so don't use them.
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
__ enter(); // required for proper stackwalking of RuntimeStub frame
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0)); // get 16 bytes of input
@@ -3004,25 +2991,53 @@
// For encryption, the java expanded key ordering is just what we need
// we don't know if the key is aligned, hence not using load-execute form
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ pxor(xmm_result, xmm_temp);
- for (int offset = 0x10; offset <= 0x90; offset += 0x10) {
- aes_enc_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- load_key (xmm_temp, key, 0xa0, xmm_key_shuf_mask);
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 192 and 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- __ aesenc(xmm_result, xmm_temp); // only in 256 bit keys
- aes_enc_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- load_key(xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x00, xmm_key_shuf_mask);
+ __ pxor(xmm_result, xmm_temp1);
+
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+ __ aesenc(xmm_result, xmm_temp3);
+ __ aesenc(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenc(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
- __ aesenclast(xmm_result, xmm_temp);
+ __ aesenc(xmm_result, xmm_temp1);
+ __ aesenclast(xmm_result, xmm_temp2);
__ movdqu(Address(to, 0), xmm_result); // store the result
__ xorptr(rax, rax); // return 0
__ leave(); // required for proper stackwalking of RuntimeStub frame
@@ -3040,7 +3055,7 @@
// c_rarg2 - K (key) in little endian int array
//
address generate_aescrypt_decryptBlock() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "aescrypt_decryptBlock");
Label L_doLast;
@@ -3052,15 +3067,17 @@
const Register keylen = rax;
const XMMRegister xmm_result = xmm0;
- const XMMRegister xmm_temp = xmm1;
- const XMMRegister xmm_key_shuf_mask = xmm2;
+ const XMMRegister xmm_key_shuf_mask = xmm1;
+ // On win64 xmm6-xmm15 must be preserved so don't use them.
+ const XMMRegister xmm_temp1 = xmm2;
+ const XMMRegister xmm_temp2 = xmm3;
+ const XMMRegister xmm_temp3 = xmm4;
+ const XMMRegister xmm_temp4 = xmm5;
__ enter(); // required for proper stackwalking of RuntimeStub frame
+ // keylen could be only {11, 13, 15} * 4 = {44, 52, 60}
__ movl(keylen, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT)));
- // keylen = # of 32-bit words, convert to 128-bit words
- __ shrl(keylen, 2);
- __ subl(keylen, 11); // every key has at least 11 128-bit words, some have more
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
__ movdqu(xmm_result, Address(from, 0));
@@ -3068,29 +3085,55 @@
// for decryption java expanded key ordering is rotated one position from what we want
// so we start from 0x10 here and hit 0x00 last
// we don't know if the key is aligned, hence not using load-execute form
- load_key(xmm_temp, key, 0x10, xmm_key_shuf_mask);
- __ pxor (xmm_result, xmm_temp);
- for (int offset = 0x20; offset <= 0xa0; offset += 0x10) {
- aes_dec_key(xmm_result, xmm_temp, key, offset, xmm_key_shuf_mask);
- }
- __ cmpl(keylen, 0);
- __ jcc(Assembler::equal, L_doLast);
- // only in 192 and 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0, xmm_key_shuf_mask);
- __ subl(keylen, 2);
- __ jcc(Assembler::equal, L_doLast);
- // only in 256 bit keys
- aes_dec_key(xmm_result, xmm_temp, key, 0xd0, xmm_key_shuf_mask);
- aes_dec_key(xmm_result, xmm_temp, key, 0xe0, xmm_key_shuf_mask);
+ load_key(xmm_temp1, key, 0x10, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x20, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x30, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x40, xmm_key_shuf_mask);
+
+ __ pxor (xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x50, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0x60, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x70, xmm_key_shuf_mask);
+ load_key(xmm_temp4, key, 0x80, xmm_key_shuf_mask);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+ __ aesdec(xmm_result, xmm_temp3);
+ __ aesdec(xmm_result, xmm_temp4);
+
+ load_key(xmm_temp1, key, 0x90, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xa0, xmm_key_shuf_mask);
+ load_key(xmm_temp3, key, 0x00, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 44);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xc0, xmm_key_shuf_mask);
+
+ __ cmpl(keylen, 52);
+ __ jccb(Assembler::equal, L_doLast);
+
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
+ load_key(xmm_temp1, key, 0xd0, xmm_key_shuf_mask);
+ load_key(xmm_temp2, key, 0xe0, xmm_key_shuf_mask);
__ BIND(L_doLast);
+ __ aesdec(xmm_result, xmm_temp1);
+ __ aesdec(xmm_result, xmm_temp2);
+
// for decryption the aesdeclast operation is always on key+0x00
- load_key(xmm_temp, key, 0x00, xmm_key_shuf_mask);
- __ aesdeclast(xmm_result, xmm_temp);
-
+ __ aesdeclast(xmm_result, xmm_temp3);
__ movdqu(Address(to, 0), xmm_result); // store the result
-
__ xorptr(rax, rax); // return 0
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
@@ -3109,7 +3152,7 @@
// c_rarg4 - input length
//
address generate_cipherBlockChaining_encryptAESCrypt() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_encryptAESCrypt");
address start = __ pc();
@@ -3133,16 +3176,19 @@
const XMMRegister xmm_temp = xmm1;
// keys 0-10 preloaded into xmm2-xmm12
const int XMM_REG_NUM_KEY_FIRST = 2;
- const int XMM_REG_NUM_KEY_LAST = 12;
+ const int XMM_REG_NUM_KEY_LAST = 15;
const XMMRegister xmm_key0 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST);
- const XMMRegister xmm_key10 = as_XMMRegister(XMM_REG_NUM_KEY_LAST);
+ const XMMRegister xmm_key10 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+10);
+ const XMMRegister xmm_key11 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+11);
+ const XMMRegister xmm_key12 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+12);
+ const XMMRegister xmm_key13 = as_XMMRegister(XMM_REG_NUM_KEY_FIRST+13);
__ enter(); // required for proper stackwalking of RuntimeStub frame
#ifdef _WIN64
// on win64, fill len_reg from stack position
__ movl(len_reg, len_mem);
- // save the xmm registers which must be preserved 6-12
+ // save the xmm registers which must be preserved 6-15
__ subptr(rsp, -rsp_after_call_off * wordSize);
for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) {
__ movdqu(xmm_save(i), as_XMMRegister(i));
@@ -3151,12 +3197,11 @@
const XMMRegister xmm_key_shuf_mask = xmm_temp; // used temporarily to swap key bytes up front
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
- // load up xmm regs 2 thru 12 with key 0x00 - 0xa0
- for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x00; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
+ // load up xmm regs xmm2 thru xmm12 with key 0x00 - 0xa0
+ for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x00; rnum <= XMM_REG_NUM_KEY_FIRST+10; rnum++) {
load_key(as_XMMRegister(rnum), key, offset, xmm_key_shuf_mask);
offset += 0x10;
}
-
__ movdqu(xmm_result, Address(rvec, 0x00)); // initialize xmm_result with r vec
// now split to different paths depending on the keylen (len in ints of AESCrypt.KLE array (52=192, or 60=256))
@@ -3167,16 +3212,15 @@
// 128 bit code follows here
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_loopTop_128);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
-
__ pxor (xmm_result, xmm_key0); // do the aes rounds
- for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST - 1; rnum++) {
+ for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_FIRST + 9; rnum++) {
__ aesenc(xmm_result, as_XMMRegister(rnum));
}
__ aesenclast(xmm_result, xmm_key10);
-
__ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
__ addptr(pos, AESBlockSize);
@@ -3198,24 +3242,23 @@
__ BIND(L_key_192_256);
// here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
+ load_key(xmm_key11, key, 0xb0, xmm_key_shuf_mask);
+ load_key(xmm_key12, key, 0xc0, xmm_key_shuf_mask);
__ cmpl(rax, 52);
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be changed to use more xmm registers)
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_loopTop_192);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
-
__ pxor (xmm_result, xmm_key0); // do the aes rounds
- for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
+ for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_FIRST + 11; rnum++) {
__ aesenc(xmm_result, as_XMMRegister(rnum));
}
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0);
- load_key(xmm_temp, key, 0xc0);
- __ aesenclast(xmm_result, xmm_temp);
-
+ __ aesenclast(xmm_result, xmm_key12);
__ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
__ addptr(pos, AESBlockSize);
@@ -3225,22 +3268,19 @@
__ BIND(L_key_256);
// 256-bit code follows here (could be changed to use more xmm registers)
+ load_key(xmm_key13, key, 0xd0, xmm_key_shuf_mask);
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_loopTop_256);
__ movdqu(xmm_temp, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of input
__ pxor (xmm_result, xmm_temp); // xor with the current r vector
-
__ pxor (xmm_result, xmm_key0); // do the aes rounds
- for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
+ for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_FIRST + 13; rnum++) {
__ aesenc(xmm_result, as_XMMRegister(rnum));
}
- aes_enc_key(xmm_result, xmm_temp, key, 0xb0);
- aes_enc_key(xmm_result, xmm_temp, key, 0xc0);
- aes_enc_key(xmm_result, xmm_temp, key, 0xd0);
load_key(xmm_temp, key, 0xe0);
__ aesenclast(xmm_result, xmm_temp);
-
__ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
__ addptr(pos, AESBlockSize);
@@ -3267,7 +3307,7 @@
//
address generate_cipherBlockChaining_decryptAESCrypt_Parallel() {
- assert(UseAES && (UseAVX > 0), "need AES instructions and misaligned SSE support");
+ assert(UseAES, "need AES instructions and misaligned SSE support");
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
address start = __ pc();
@@ -3288,12 +3328,10 @@
#endif
const Register pos = rax;
- // xmm register assignments for the loops below
- const XMMRegister xmm_result = xmm0;
// keys 0-10 preloaded into xmm2-xmm12
const int XMM_REG_NUM_KEY_FIRST = 5;
const int XMM_REG_NUM_KEY_LAST = 15;
- const XMMRegister xmm_key_first = as_XMMRegister(XMM_REG_NUM_KEY_FIRST);
+ const XMMRegister xmm_key_first = as_XMMRegister(XMM_REG_NUM_KEY_FIRST);
const XMMRegister xmm_key_last = as_XMMRegister(XMM_REG_NUM_KEY_LAST);
__ enter(); // required for proper stackwalking of RuntimeStub frame
@@ -3312,13 +3350,14 @@
const XMMRegister xmm_key_shuf_mask = xmm1; // used temporarily to swap key bytes up front
__ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr()));
// load up xmm regs 5 thru 15 with key 0x10 - 0xa0 - 0x00
- for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x10; rnum <= XMM_REG_NUM_KEY_LAST; rnum++) {
- if (rnum == XMM_REG_NUM_KEY_LAST) offset = 0x00;
+ for (int rnum = XMM_REG_NUM_KEY_FIRST, offset = 0x10; rnum < XMM_REG_NUM_KEY_LAST; rnum++) {
load_key(as_XMMRegister(rnum), key, offset, xmm_key_shuf_mask);
offset += 0x10;
}
+ load_key(xmm_key_last, key, 0x00, xmm_key_shuf_mask);
const XMMRegister xmm_prev_block_cipher = xmm1; // holds cipher of previous block
+
// registers holding the four results in the parallelized loop
const XMMRegister xmm_result0 = xmm0;
const XMMRegister xmm_result1 = xmm2;
@@ -3376,8 +3415,12 @@
__ jmp(L_multiBlock_loopTop_128);
// registers used in the non-parallelized loops
+ // xmm register assignments for the loops below
+ const XMMRegister xmm_result = xmm0;
const XMMRegister xmm_prev_block_cipher_save = xmm2;
- const XMMRegister xmm_temp = xmm3;
+ const XMMRegister xmm_key11 = xmm3;
+ const XMMRegister xmm_key12 = xmm4;
+ const XMMRegister xmm_temp = xmm4;
__ align(OptoLoopAlignment);
__ BIND(L_singleBlock_loopTop_128);
@@ -3415,12 +3458,15 @@
__ BIND(L_key_192_256);
// here rax = len in ints of AESCrypt.KLE array (52=192, or 60=256)
+ load_key(xmm_key11, key, 0xb0);
__ cmpl(rax, 52);
__ jcc(Assembler::notEqual, L_key_256);
// 192-bit code follows here (could be optimized to use parallelism)
+ load_key(xmm_key12, key, 0xc0); // 192-bit key goes up to c0
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_singleBlock_loopTop_192);
__ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
__ movdqa(xmm_prev_block_cipher_save, xmm_result); // save for next r vector
@@ -3428,14 +3474,13 @@
for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST - 1; rnum++) {
__ aesdec(xmm_result, as_XMMRegister(rnum));
}
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0); // 192-bit key goes up to c0
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0);
+ __ aesdec(xmm_result, xmm_key11);
+ __ aesdec(xmm_result, xmm_key12);
__ aesdeclast(xmm_result, xmm_key_last); // xmm15 always came from key+0
__ pxor (xmm_result, xmm_prev_block_cipher); // xor with the current r vector
- __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
+ __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
- __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
-
+ __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
__ addptr(pos, AESBlockSize);
__ subptr(len_reg, AESBlockSize);
__ jcc(Assembler::notEqual,L_singleBlock_loopTop_192);
@@ -3445,23 +3490,26 @@
// 256-bit code follows here (could be optimized to use parallelism)
__ movptr(pos, 0);
__ align(OptoLoopAlignment);
+
__ BIND(L_singleBlock_loopTop_256);
- __ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
+ __ movdqu(xmm_result, Address(from, pos, Address::times_1, 0)); // get next 16 bytes of cipher input
__ movdqa(xmm_prev_block_cipher_save, xmm_result); // save for next r vector
__ pxor (xmm_result, xmm_key_first); // do the aes dec rounds
for (int rnum = XMM_REG_NUM_KEY_FIRST + 1; rnum <= XMM_REG_NUM_KEY_LAST - 1; rnum++) {
__ aesdec(xmm_result, as_XMMRegister(rnum));
}
- aes_dec_key(xmm_result, xmm_temp, key, 0xb0); // 256-bit key goes up to e0
- aes_dec_key(xmm_result, xmm_temp, key, 0xc0);
- aes_dec_key(xmm_result, xmm_temp, key, 0xd0);
- aes_dec_key(xmm_result, xmm_temp, key, 0xe0);
- __ aesdeclast(xmm_result, xmm_key_last); // xmm15 came from key+0
+ __ aesdec(xmm_result, xmm_key11);
+ load_key(xmm_temp, key, 0xc0);
+ __ aesdec(xmm_result, xmm_temp);
+ load_key(xmm_temp, key, 0xd0);
+ __ aesdec(xmm_result, xmm_temp);
+ load_key(xmm_temp, key, 0xe0); // 256-bit key goes up to e0
+ __ aesdec(xmm_result, xmm_temp);
+ __ aesdeclast(xmm_result, xmm_key_last); // xmm15 came from key+0
__ pxor (xmm_result, xmm_prev_block_cipher); // xor with the current r vector
- __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
+ __ movdqu(Address(to, pos, Address::times_1, 0), xmm_result); // store into the next 16 bytes of output
// no need to store r to memory until we exit
- __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
-
+ __ movdqa(xmm_prev_block_cipher, xmm_prev_block_cipher_save); // set up next r vector with cipher input from this block
__ addptr(pos, AESBlockSize);
__ subptr(len_reg, AESBlockSize);
__ jcc(Assembler::notEqual,L_singleBlock_loopTop_256);
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_32.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -424,8 +424,6 @@
// C++ interpreter only
// rsi - previous interpreter state pointer
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes one argument
// indicating if the counter overflow occurs at a backwards branch (non-NULL bcp).
// The call returns the address of the verified entry point for the method or NULL
@@ -868,12 +866,13 @@
// rsi: previous interpreter state (C++ interpreter) must preserve
address entry_point = __ pc();
-
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset());
// get parameter size (always needed)
+ __ movptr(rcx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// native calls don't need the stack size check since they have no expression stack
@@ -988,7 +987,9 @@
// allocate space for parameters
__ get_method(method);
- __ load_unsigned_short(t, Address(method, Method::size_of_parameters_offset()));
+ __ movptr(t, Address(method, Method::const_offset()));
+ __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset()));
+
__ shlptr(t, Interpreter::logStackElementSize);
__ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror
__ subptr(rsp, t);
@@ -1297,13 +1298,14 @@
// rsi: sender sp
address entry_point = __ pc();
-
- const Address size_of_parameters(rbx, Method::size_of_parameters_offset());
- const Address size_of_locals (rbx, Method::size_of_locals_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::invocation_counter_offset() + InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset());
// get parameter size (always needed)
+ __ movptr(rdx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx,: Method*
@@ -1734,7 +1736,8 @@
// Compute size of arguments for saving when returning to deoptimized caller
__ get_method(rax);
- __ load_unsigned_short(rax, Address(rax, in_bytes(Method::size_of_parameters_offset())));
+ __ movptr(rax, Address(rax, Method::const_offset()));
+ __ load_unsigned_short(rax, Address(rax, ConstMethod::size_of_parameters_offset()));
__ shlptr(rax, Interpreter::logStackElementSize);
__ restore_locals();
__ subptr(rdi, rax);
--- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86_64.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -369,9 +369,6 @@
// Everything as it was on entry
// rdx is not restored. Doesn't appear to really be set.
- const Address size_of_parameters(rbx,
- Method::size_of_parameters_offset());
-
// InterpreterRuntime::frequency_counter_overflow takes two
// arguments, the first (thread) is passed by call_VM, the second
// indicates if the counter overflow occurs at a backwards branch
@@ -844,14 +841,17 @@
address entry_point = __ pc();
- const Address size_of_parameters(rbx, Method::
- size_of_parameters_offset());
+ const Address constMethod (rbx, Method::const_offset());
const Address invocation_counter(rbx, Method::
invocation_counter_offset() +
InvocationCounter::counter_offset());
const Address access_flags (rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rcx, ConstMethod::
+ size_of_parameters_offset());
+
// get parameter size (always needed)
+ __ movptr(rcx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// native calls don't need the stack size check since they have no
@@ -967,9 +967,8 @@
// allocate space for parameters
__ get_method(method);
- __ load_unsigned_short(t,
- Address(method,
- Method::size_of_parameters_offset()));
+ __ movptr(t, Address(method, Method::const_offset()));
+ __ load_unsigned_short(t, Address(t, ConstMethod::size_of_parameters_offset()));
__ shll(t, Interpreter::logStackElementSize);
__ subptr(rsp, t);
@@ -1302,15 +1301,18 @@
// r13: sender sp
address entry_point = __ pc();
- const Address size_of_parameters(rbx,
- Method::size_of_parameters_offset());
- const Address size_of_locals(rbx, Method::size_of_locals_offset());
+ const Address constMethod(rbx, Method::const_offset());
const Address invocation_counter(rbx,
Method::invocation_counter_offset() +
InvocationCounter::counter_offset());
const Address access_flags(rbx, Method::access_flags_offset());
+ const Address size_of_parameters(rdx,
+ ConstMethod::size_of_parameters_offset());
+ const Address size_of_locals(rdx, ConstMethod::size_of_locals_offset());
+
// get parameter size (always needed)
+ __ movptr(rdx, constMethod);
__ load_unsigned_short(rcx, size_of_parameters);
// rbx: Method*
@@ -1752,7 +1754,8 @@
// Compute size of arguments for saving when returning to
// deoptimized caller
__ get_method(rax);
- __ load_unsigned_short(rax, Address(rax, in_bytes(Method::
+ __ movptr(rax, Address(rax, Method::const_offset()));
+ __ load_unsigned_short(rax, Address(rax, in_bytes(ConstMethod::
size_of_parameters_offset())));
__ shll(rax, Interpreter::logStackElementSize);
__ restore_locals(); // XXX do we need this?
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -489,8 +489,8 @@
}
// The AES intrinsic stubs require AES instruction support (of course)
- // but also require AVX and sse3 modes for instructions it use.
- if (UseAES && (UseAVX > 0) && (UseSSE > 2)) {
+ // but also require sse3 mode for instructions it use.
+ if (UseAES && (UseSSE > 2)) {
if (FLAG_IS_DEFAULT(UseAESIntrinsics)) {
UseAESIntrinsics = true;
}
--- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -56,15 +56,9 @@
ShouldNotCallThis();
}
-#ifndef PRODUCT
-void Assembler::pd_print_patched_instruction(address branch) {
- ShouldNotCallThis();
-}
-#endif // PRODUCT
-
void MacroAssembler::align(int modulus) {
while (offset() % modulus != 0)
- emit_byte(AbstractAssembler::code_fill_byte());
+ emit_int8(AbstractAssembler::code_fill_byte());
}
void MacroAssembler::bang_stack_with_offset(int offset) {
@@ -72,8 +66,7 @@
}
void MacroAssembler::advance(int bytes) {
- _code_pos += bytes;
- sync();
+ code_section()->set_end(code_section()->end() + bytes);
}
RegisterOrConstant MacroAssembler::delayed_value_impl(
--- a/hotspot/src/cpu/zero/vm/assembler_zero.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -37,9 +37,6 @@
public:
void pd_patch_instruction(address branch, address target);
-#ifndef PRODUCT
- static void pd_print_patched_instruction(address branch);
-#endif // PRODUCT
};
class MacroAssembler : public Assembler {
--- a/hotspot/src/os/posix/vm/os_posix.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/os/posix/vm/os_posix.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -93,6 +93,47 @@
return;
}
+// Multiple threads can race in this code, and can remap over each other with MAP_FIXED,
+// so on posix, unmap the section at the start and at the end of the chunk that we mapped
+// rather than unmapping and remapping the whole chunk to get requested alignment.
+char* os::reserve_memory_aligned(size_t size, size_t alignment) {
+ assert((alignment & (os::vm_allocation_granularity() - 1)) == 0,
+ "Alignment must be a multiple of allocation granularity (page size)");
+ assert((size & (alignment -1)) == 0, "size must be 'alignment' aligned");
+
+ size_t extra_size = size + alignment;
+ assert(extra_size >= size, "overflow, size is too large to allow alignment");
+
+ char* extra_base = os::reserve_memory(extra_size, NULL, alignment);
+
+ if (extra_base == NULL) {
+ return NULL;
+ }
+
+ // Do manual alignment
+ char* aligned_base = (char*) align_size_up((uintptr_t) extra_base, alignment);
+
+ // [ | | ]
+ // ^ extra_base
+ // ^ extra_base + begin_offset == aligned_base
+ // extra_base + begin_offset + size ^
+ // extra_base + extra_size ^
+ // |<>| == begin_offset
+ // end_offset == |<>|
+ size_t begin_offset = aligned_base - extra_base;
+ size_t end_offset = (extra_base + extra_size) - (aligned_base + size);
+
+ if (begin_offset > 0) {
+ os::release_memory(extra_base, begin_offset);
+ }
+
+ if (end_offset > 0) {
+ os::release_memory(extra_base + begin_offset + size, end_offset);
+ }
+
+ return aligned_base;
+}
+
void os::Posix::print_load_average(outputStream* st) {
st->print("load average:");
double loadavg[3];
--- a/hotspot/src/os/windows/vm/os_windows.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/os/windows/vm/os_windows.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2895,6 +2895,36 @@
}
}
+// Multiple threads can race in this code but it's not possible to unmap small sections of
+// virtual space to get requested alignment, like posix-like os's.
+// Windows prevents multiple thread from remapping over each other so this loop is thread-safe.
+char* os::reserve_memory_aligned(size_t size, size_t alignment) {
+ assert((alignment & (os::vm_allocation_granularity() - 1)) == 0,
+ "Alignment must be a multiple of allocation granularity (page size)");
+ assert((size & (alignment -1)) == 0, "size must be 'alignment' aligned");
+
+ size_t extra_size = size + alignment;
+ assert(extra_size >= size, "overflow, size is too large to allow alignment");
+
+ char* aligned_base = NULL;
+
+ do {
+ char* extra_base = os::reserve_memory(extra_size, NULL, alignment);
+ if (extra_base == NULL) {
+ return NULL;
+ }
+ // Do manual alignment
+ aligned_base = (char*) align_size_up((uintptr_t) extra_base, alignment);
+
+ os::release_memory(extra_base, extra_size);
+
+ aligned_base = os::reserve_memory(size, aligned_base);
+
+ } while (aligned_base == NULL);
+
+ return aligned_base;
+}
+
char* os::pd_reserve_memory(size_t bytes, char* addr, size_t alignment_hint) {
assert((size_t)addr % os::vm_allocation_granularity() == 0,
"reserve alignment");
--- a/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -116,7 +116,7 @@
ThreadLocalStorage::pd_tlsAccessMode tlsMode = ThreadLocalStorage::pd_getTlsAccessMode ();
if (tlsMode == ThreadLocalStorage::pd_tlsAccessIndirect) { // T1
// Use thread as a temporary: mov r, gs:[0]; mov r, [r+tlsOffset]
- emit_byte (segment);
+ emit_int8 (segment);
// ExternalAddress doesn't work because it can't take NULL
AddressLiteral null(0, relocInfo::none);
movptr (thread, null);
@@ -125,7 +125,7 @@
} else
if (tlsMode == ThreadLocalStorage::pd_tlsAccessDirect) { // T2
// mov r, gs:[tlsOffset]
- emit_byte (segment);
+ emit_int8 (segment);
AddressLiteral tls_off((address)ThreadLocalStorage::pd_getTlsOffset(), relocInfo::none);
movptr (thread, tls_off);
return ;
--- a/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/os_cpu/windows_x86/vm/assembler_windows_x86.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,7 @@
void MacroAssembler::int3() {
- emit_byte(0xCC);
+ emit_int8((unsigned char)0xCC);
}
#ifndef _LP64
--- a/hotspot/src/share/vm/asm/assembler.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/asm/assembler.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -109,37 +109,6 @@
ICache::invalidate_range(addr_at(0), offset());
}
-
-void AbstractAssembler::a_byte(int x) {
- emit_byte(x);
-}
-
-
-void AbstractAssembler::a_long(jint x) {
- emit_long(x);
-}
-
-// Labels refer to positions in the (to be) generated code. There are bound
-// and unbound
-//
-// Bound labels refer to known positions in the already generated code.
-// offset() is the position the label refers to.
-//
-// Unbound labels refer to unknown positions in the code to be generated; it
-// may contain a list of unresolved displacements that refer to it
-#ifndef PRODUCT
-void AbstractAssembler::print(Label& L) {
- if (L.is_bound()) {
- tty->print_cr("bound label to %d|%d", L.loc_pos(), L.loc_sect());
- } else if (L.is_unbound()) {
- L.print_instructions((MacroAssembler*)this);
- } else {
- tty->print_cr("label in inconsistent state (loc = %d)", L.loc());
- }
-}
-#endif // PRODUCT
-
-
void AbstractAssembler::bind(Label& L) {
if (L.is_bound()) {
// Assembler can bind a label more than once to the same place.
@@ -342,28 +311,3 @@
#endif
return offset < 0 || os::vm_page_size() <= offset;
}
-
-#ifndef PRODUCT
-void Label::print_instructions(MacroAssembler* masm) const {
- CodeBuffer* cb = masm->code();
- for (int i = 0; i < _patch_index; ++i) {
- int branch_loc;
- if (i >= PatchCacheSize) {
- branch_loc = _patch_overflow->at(i - PatchCacheSize);
- } else {
- branch_loc = _patches[i];
- }
- int branch_pos = CodeBuffer::locator_pos(branch_loc);
- int branch_sect = CodeBuffer::locator_sect(branch_loc);
- address branch = cb->locator_address(branch_loc);
- tty->print_cr("unbound label");
- tty->print("@ %d|%d ", branch_pos, branch_sect);
- if (branch_sect == CodeBuffer::SECT_CONSTS) {
- tty->print_cr(PTR_FORMAT, *(address*)branch);
- continue;
- }
- masm->pd_print_patched_instruction(branch);
- tty->cr();
- }
-}
-#endif // ndef PRODUCT
--- a/hotspot/src/share/vm/asm/assembler.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/asm/assembler.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -216,17 +216,6 @@
bool isByte(int x) const { return 0 <= x && x < 0x100; }
bool isShiftCount(int x) const { return 0 <= x && x < 32; }
- void emit_int8( int8_t x) { code_section()->emit_int8( x); }
- void emit_int16( int16_t x) { code_section()->emit_int16( x); }
- void emit_int32( int32_t x) { code_section()->emit_int32( x); }
- void emit_int64( int64_t x) { code_section()->emit_int64( x); }
-
- void emit_float( jfloat x) { code_section()->emit_float( x); }
- void emit_double( jdouble x) { code_section()->emit_double( x); }
- void emit_address(address x) { code_section()->emit_address(x); }
-
- void emit_byte(int x) { emit_int8 (x); } // deprecated
- void emit_word(int x) { emit_int16(x); } // deprecated
void emit_long(jint x) { emit_int32(x); } // deprecated
// Instruction boundaries (required when emitting relocatable values).
@@ -277,9 +266,6 @@
};
#endif
- // Label functions
- void print(Label& L);
-
public:
// Creation
@@ -288,6 +274,15 @@
// ensure buf contains all code (call this before using/copying the code)
void flush();
+ void emit_int8( int8_t x) { code_section()->emit_int8( x); }
+ void emit_int16( int16_t x) { code_section()->emit_int16( x); }
+ void emit_int32( int32_t x) { code_section()->emit_int32( x); }
+ void emit_int64( int64_t x) { code_section()->emit_int64( x); }
+
+ void emit_float( jfloat x) { code_section()->emit_float( x); }
+ void emit_double( jdouble x) { code_section()->emit_double( x); }
+ void emit_address(address x) { code_section()->emit_address(x); }
+
// min and max values for signed immediate ranges
static int min_simm(int nbits) { return -(intptr_t(1) << (nbits - 1)) ; }
static int max_simm(int nbits) { return (intptr_t(1) << (nbits - 1)) - 1; }
@@ -327,8 +322,6 @@
void clear_inst_mark() { code_section()->clear_mark(); }
// Constants in code
- void a_byte(int x);
- void a_long(jint x);
void relocate(RelocationHolder const& rspec, int format = 0) {
assert(!pd_check_instruction_mark()
|| inst_mark() == NULL || inst_mark() == code_section()->end(),
@@ -441,15 +434,6 @@
*/
void pd_patch_instruction(address branch, address target);
-#ifndef PRODUCT
- /**
- * Platform-dependent method of printing an instruction that needs to be
- * patched.
- *
- * @param branch the instruction to be patched in the buffer.
- */
- static void pd_print_patched_instruction(address branch);
-#endif // PRODUCT
};
#ifdef TARGET_ARCH_x86
--- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -3442,6 +3442,11 @@
preserves_state = true;
break;
+ case vmIntrinsics::_loadFence :
+ case vmIntrinsics::_storeFence:
+ case vmIntrinsics::_fullFence :
+ break;
+
default : return false; // do not inline
}
// create intrinsic node
--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2977,6 +2977,16 @@
do_CompareAndSwap(x, longType);
break;
+ case vmIntrinsics::_loadFence :
+ if (os::is_MP()) __ membar_acquire();
+ break;
+ case vmIntrinsics::_storeFence:
+ if (os::is_MP()) __ membar_release();
+ break;
+ case vmIntrinsics::_fullFence :
+ if (os::is_MP()) __ membar();
+ break;
+
case vmIntrinsics::_Reference_get:
do_Reference_get(x);
break;
--- a/hotspot/src/share/vm/ci/ciField.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/ci/ciField.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -366,10 +366,12 @@
// ------------------------------------------------------------------
// ciField::print
void ciField::print() {
- tty->print("<ciField ");
+ tty->print("<ciField name=");
_holder->print_name();
tty->print(".");
_name->print_symbol();
+ tty->print(" signature=");
+ _signature->print_symbol();
tty->print(" offset=%d type=", _offset);
if (_type != NULL) _type->print_name();
else tty->print("(reference)");
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -169,16 +169,18 @@
ok = (objArrayOop)ok->obj_at(1);
}
+ // Must handle over GC points
+ assert (last != NULL, "dependencies should be initialized");
+ objArrayHandle last_handle(THREAD, last);
+
// Create a new dependency node with fields for (class_loader or mirror, next)
objArrayOop deps = oopFactory::new_objectArray(2, CHECK);
deps->obj_at_put(0, dependency());
- // Must handle over more GC points
+ // Must handle over GC points
objArrayHandle new_dependency(THREAD, deps);
// Add the dependency under lock
- assert (last != NULL, "dependencies should be initialized");
- objArrayHandle last_handle(THREAD, last);
locked_add_dependency(last_handle, new_dependency);
}
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -327,14 +327,14 @@
return result;
}
-unsigned int java_lang_String::to_hash(oop java_string) {
+unsigned int java_lang_String::hash_code(oop java_string) {
int length = java_lang_String::length(java_string);
- // Zero length string will hash to zero with String.toHash() function.
+ // Zero length string will hash to zero with String.hashCode() function.
if (length == 0) return 0;
typeArrayOop value = java_lang_String::value(java_string);
int offset = java_lang_String::offset(java_string);
- return java_lang_String::to_hash(value->char_at_addr(offset), length);
+ return java_lang_String::hash_code(value->char_at_addr(offset), length);
}
char* java_lang_String::as_quoted_ascii(oop java_string) {
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -166,8 +166,8 @@
// objects in the shared archive file.
// hash P(31) from Kernighan & Ritchie
//
- // For this reason, THIS ALGORITHM MUST MATCH String.toHash().
- template <typename T> static unsigned int to_hash(T* s, int len) {
+ // For this reason, THIS ALGORITHM MUST MATCH String.hashCode().
+ template <typename T> static unsigned int hash_code(T* s, int len) {
unsigned int h = 0;
while (len-- > 0) {
h = 31*h + (unsigned int) *s;
@@ -175,10 +175,10 @@
}
return h;
}
- static unsigned int to_hash(oop java_string);
+ static unsigned int hash_code(oop java_string);
// This is the string hash code used by the StringTable, which may be
- // the same as String.toHash or an alternate hash code.
+ // the same as String.hashCode or an alternate hash code.
static unsigned int hash_string(oop java_string);
static bool equals(oop java_string, jchar* chars, int len);
--- a/hotspot/src/share/vm/classfile/symbolTable.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/classfile/symbolTable.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -179,7 +179,7 @@
unsigned int SymbolTable::hash_symbol(const char* s, int len) {
return use_alternate_hashcode() ?
AltHashing::murmur3_32(seed(), (const jbyte*)s, len) :
- java_lang_String::to_hash(s, len);
+ java_lang_String::hash_code(s, len);
}
@@ -617,7 +617,7 @@
// Pick hashing algorithm
unsigned int StringTable::hash_string(const jchar* s, int len) {
return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
- java_lang_String::to_hash(s, len);
+ java_lang_String::hash_code(s, len);
}
oop StringTable::lookup(int index, jchar* name,
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -761,6 +761,15 @@
do_intrinsic(_unpark, sun_misc_Unsafe, unpark_name, unpark_signature, F_RN) \
do_name( unpark_name, "unpark") \
do_alias( unpark_signature, /*(LObject;)V*/ object_void_signature) \
+ do_intrinsic(_loadFence, sun_misc_Unsafe, loadFence_name, loadFence_signature, F_RN) \
+ do_name( loadFence_name, "loadFence") \
+ do_alias( loadFence_signature, void_method_signature) \
+ do_intrinsic(_storeFence, sun_misc_Unsafe, storeFence_name, storeFence_signature, F_RN) \
+ do_name( storeFence_name, "storeFence") \
+ do_alias( storeFence_signature, void_method_signature) \
+ do_intrinsic(_fullFence, sun_misc_Unsafe, fullFence_name, fullFence_signature, F_RN) \
+ do_name( fullFence_name, "fullFence") \
+ do_alias( fullFence_signature, void_method_signature) \
\
/* unsafe memory references (there are a lot of them...) */ \
do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \
@@ -902,12 +911,14 @@
do_intrinsic(_getAndAddLong, sun_misc_Unsafe, getAndAddLong_name, getAndAddLong_signature, F_R) \
do_name( getAndAddLong_name, "getAndAddLong") \
do_signature(getAndAddLong_signature, "(Ljava/lang/Object;JJ)J" ) \
- do_intrinsic(_getAndSetInt, sun_misc_Unsafe, getAndSet_name, getAndSetInt_signature, F_R) \
- do_name( getAndSet_name, "getAndSet") \
+ do_intrinsic(_getAndSetInt, sun_misc_Unsafe, getAndSetInt_name, getAndSetInt_signature, F_R) \
+ do_name( getAndSetInt_name, "getAndSetInt") \
do_alias( getAndSetInt_signature, /*"(Ljava/lang/Object;JI)I"*/ getAndAddInt_signature) \
- do_intrinsic(_getAndSetLong, sun_misc_Unsafe, getAndSet_name, getAndSetLong_signature, F_R) \
+ do_intrinsic(_getAndSetLong, sun_misc_Unsafe, getAndSetLong_name, getAndSetLong_signature, F_R) \
+ do_name( getAndSetLong_name, "getAndSetLong") \
do_alias( getAndSetLong_signature, /*"(Ljava/lang/Object;JJ)J"*/ getAndAddLong_signature) \
- do_intrinsic(_getAndSetObject, sun_misc_Unsafe, getAndSet_name, getAndSetObject_signature, F_R) \
+ do_intrinsic(_getAndSetObject, sun_misc_Unsafe, getAndSetObject_name, getAndSetObject_signature, F_R)\
+ do_name( getAndSetObject_name, "getAndSetObject") \
do_signature(getAndSetObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;" ) \
\
/* prefetch_signature is shared by all prefetch variants */ \
--- a/hotspot/src/share/vm/compiler/compilerOracle.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -538,6 +538,7 @@
if (match != NULL) {
if (!_quiet) {
+ ResourceMark rm;
tty->print("CompilerOracle: %s ", command_names[command]);
match->print();
}
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -46,27 +46,11 @@
// Concurrent marking bit map wrapper
-CMBitMapRO::CMBitMapRO(ReservedSpace rs, int shifter) :
- _bm((uintptr_t*)NULL,0),
+CMBitMapRO::CMBitMapRO(int shifter) :
+ _bm(),
_shifter(shifter) {
- _bmStartWord = (HeapWord*)(rs.base());
- _bmWordSize = rs.size()/HeapWordSize; // rs.size() is in bytes
- ReservedSpace brs(ReservedSpace::allocation_align_size_up(
- (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
-
- MemTracker::record_virtual_memory_type((address)brs.base(), mtGC);
-
- guarantee(brs.is_reserved(), "couldn't allocate concurrent marking bit map");
- // For now we'll just commit all of the bit map up fromt.
- // Later on we'll try to be more parsimonious with swap.
- guarantee(_virtual_space.initialize(brs, brs.size()),
- "couldn't reseve backing store for concurrent marking bit map");
- assert(_virtual_space.committed_size() == brs.size(),
- "didn't reserve backing store for all of concurrent marking bit map?");
- _bm.set_map((uintptr_t*)_virtual_space.low());
- assert(_virtual_space.committed_size() << (_shifter + LogBitsPerByte) >=
- _bmWordSize, "inconsistency in bit map sizing");
- _bm.set_size(_bmWordSize >> _shifter);
+ _bmStartWord = 0;
+ _bmWordSize = 0;
}
HeapWord* CMBitMapRO::getNextMarkedWordAddress(HeapWord* addr,
@@ -108,15 +92,40 @@
}
#ifndef PRODUCT
-bool CMBitMapRO::covers(ReservedSpace rs) const {
+bool CMBitMapRO::covers(ReservedSpace heap_rs) const {
// assert(_bm.map() == _virtual_space.low(), "map inconsistency");
assert(((size_t)_bm.size() * ((size_t)1 << _shifter)) == _bmWordSize,
"size inconsistency");
- return _bmStartWord == (HeapWord*)(rs.base()) &&
- _bmWordSize == rs.size()>>LogHeapWordSize;
+ return _bmStartWord == (HeapWord*)(heap_rs.base()) &&
+ _bmWordSize == heap_rs.size()>>LogHeapWordSize;
}
#endif
+bool CMBitMap::allocate(ReservedSpace heap_rs) {
+ _bmStartWord = (HeapWord*)(heap_rs.base());
+ _bmWordSize = heap_rs.size()/HeapWordSize; // heap_rs.size() is in bytes
+ ReservedSpace brs(ReservedSpace::allocation_align_size_up(
+ (_bmWordSize >> (_shifter + LogBitsPerByte)) + 1));
+ if (!brs.is_reserved()) {
+ warning("ConcurrentMark marking bit map allocation failure");
+ return false;
+ }
+ MemTracker::record_virtual_memory_type((address)brs.base(), mtGC);
+ // For now we'll just commit all of the bit map up front.
+ // Later on we'll try to be more parsimonious with swap.
+ if (!_virtual_space.initialize(brs, brs.size())) {
+ warning("ConcurrentMark marking bit map backing store failure");
+ return false;
+ }
+ assert(_virtual_space.committed_size() == brs.size(),
+ "didn't reserve backing store for all of concurrent marking bit map?");
+ _bm.set_map((uintptr_t*)_virtual_space.low());
+ assert(_virtual_space.committed_size() << (_shifter + LogBitsPerByte) >=
+ _bmWordSize, "inconsistency in bit map sizing");
+ _bm.set_size(_bmWordSize >> _shifter);
+ return true;
+}
+
void CMBitMap::clearAll() {
_bm.clear();
return;
@@ -163,20 +172,79 @@
#endif
{}
-void CMMarkStack::allocate(size_t size) {
- _base = NEW_C_HEAP_ARRAY(oop, size, mtGC);
- if (_base == NULL) {
- vm_exit_during_initialization("Failed to allocate CM region mark stack");
+bool CMMarkStack::allocate(size_t capacity) {
+ // allocate a stack of the requisite depth
+ ReservedSpace rs(ReservedSpace::allocation_align_size_up(capacity * sizeof(oop)));
+ if (!rs.is_reserved()) {
+ warning("ConcurrentMark MarkStack allocation failure");
+ return false;
}
- _index = 0;
- _capacity = (jint) size;
+ MemTracker::record_virtual_memory_type((address)rs.base(), mtGC);
+ if (!_virtual_space.initialize(rs, rs.size())) {
+ warning("ConcurrentMark MarkStack backing store failure");
+ // Release the virtual memory reserved for the marking stack
+ rs.release();
+ return false;
+ }
+ assert(_virtual_space.committed_size() == rs.size(),
+ "Didn't reserve backing store for all of ConcurrentMark stack?");
+ _base = (oop*) _virtual_space.low();
+ setEmpty();
+ _capacity = (jint) capacity;
_saved_index = -1;
NOT_PRODUCT(_max_depth = 0);
+ return true;
+}
+
+void CMMarkStack::expand() {
+ // Called, during remark, if we've overflown the marking stack during marking.
+ assert(isEmpty(), "stack should been emptied while handling overflow");
+ assert(_capacity <= (jint) MarkStackSizeMax, "stack bigger than permitted");
+ // Clear expansion flag
+ _should_expand = false;
+ if (_capacity == (jint) MarkStackSizeMax) {
+ if (PrintGCDetails && Verbose) {
+ gclog_or_tty->print_cr(" (benign) Can't expand marking stack capacity, at max size limit");
+ }
+ return;
+ }
+ // Double capacity if possible
+ jint new_capacity = MIN2(_capacity*2, (jint) MarkStackSizeMax);
+ // Do not give up existing stack until we have managed to
+ // get the double capacity that we desired.
+ ReservedSpace rs(ReservedSpace::allocation_align_size_up(new_capacity *
+ sizeof(oop)));
+ if (rs.is_reserved()) {
+ // Release the backing store associated with old stack
+ _virtual_space.release();
+ // Reinitialize virtual space for new stack
+ if (!_virtual_space.initialize(rs, rs.size())) {
+ fatal("Not enough swap for expanded marking stack capacity");
+ }
+ _base = (oop*)(_virtual_space.low());
+ _index = 0;
+ _capacity = new_capacity;
+ } else {
+ if (PrintGCDetails && Verbose) {
+ // Failed to double capacity, continue;
+ gclog_or_tty->print(" (benign) Failed to expand marking stack capacity from "
+ SIZE_FORMAT"K to " SIZE_FORMAT"K",
+ _capacity / K, new_capacity / K);
+ }
+ }
+}
+
+void CMMarkStack::set_should_expand() {
+ // If we're resetting the marking state because of an
+ // marking stack overflow, record that we should, if
+ // possible, expand the stack.
+ _should_expand = _cm->has_overflown();
}
CMMarkStack::~CMMarkStack() {
if (_base != NULL) {
- FREE_C_HEAP_ARRAY(oop, _base, mtGC);
+ _base = NULL;
+ _virtual_space.release();
}
}
@@ -217,7 +285,7 @@
jint res = Atomic::cmpxchg(next_index, &_index, index);
if (res == index) {
for (int i = 0; i < n; i++) {
- int ind = index + i;
+ int ind = index + i;
assert(ind < _capacity, "By overflow test above.");
_base[ind] = ptr_arr[i];
}
@@ -228,7 +296,6 @@
}
}
-
void CMMarkStack::par_push_arr(oop* ptr_arr, int n) {
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
jint start = _index;
@@ -244,9 +311,9 @@
assert(ind < _capacity, "By overflow test above.");
_base[ind] = ptr_arr[i];
}
+ NOT_PRODUCT(_max_depth = MAX2(_max_depth, next_index));
}
-
bool CMMarkStack::par_pop_arr(oop* ptr_arr, int max, int* n) {
MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag);
jint index = _index;
@@ -255,7 +322,7 @@
return false;
} else {
int k = MIN2(max, index);
- jint new_ind = index - k;
+ jint new_ind = index - k;
for (int j = 0; j < k; j++) {
ptr_arr[j] = _base[new_ind + j];
}
@@ -404,9 +471,10 @@
return MAX2((n_par_threads + 2) / 4, 1U);
}
-ConcurrentMark::ConcurrentMark(ReservedSpace rs, uint max_regions) :
- _markBitMap1(rs, MinObjAlignment - 1),
- _markBitMap2(rs, MinObjAlignment - 1),
+ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs) :
+ _g1h(g1h),
+ _markBitMap1(MinObjAlignment - 1),
+ _markBitMap2(MinObjAlignment - 1),
_parallel_marking_threads(0),
_max_parallel_marking_threads(0),
@@ -415,10 +483,10 @@
_cleanup_sleep_factor(0.0),
_cleanup_task_overhead(1.0),
_cleanup_list("Cleanup List"),
- _region_bm((BitMap::idx_t) max_regions, false /* in_resource_area*/),
- _card_bm((rs.size() + CardTableModRefBS::card_size - 1) >>
- CardTableModRefBS::card_shift,
- false /* in_resource_area*/),
+ _region_bm((BitMap::idx_t)(g1h->max_regions()), false /* in_resource_area*/),
+ _card_bm((heap_rs.size() + CardTableModRefBS::card_size - 1) >>
+ CardTableModRefBS::card_shift,
+ false /* in_resource_area*/),
_prevMarkBitMap(&_markBitMap1),
_nextMarkBitMap(&_markBitMap2),
@@ -449,7 +517,8 @@
_parallel_workers(NULL),
_count_card_bitmaps(NULL),
- _count_marked_bytes(NULL) {
+ _count_marked_bytes(NULL),
+ _completed_initialization(false) {
CMVerboseLevel verbose_level = (CMVerboseLevel) G1MarkingVerboseLevel;
if (verbose_level < no_verbose) {
verbose_level = no_verbose;
@@ -464,61 +533,34 @@
"heap end = "PTR_FORMAT, _heap_start, _heap_end);
}
- _markStack.allocate(MarkStackSize);
+ if (!_markBitMap1.allocate(heap_rs)) {
+ warning("Failed to allocate first CM bit map");
+ return;
+ }
+ if (!_markBitMap2.allocate(heap_rs)) {
+ warning("Failed to allocate second CM bit map");
+ return;
+ }
// Create & start a ConcurrentMark thread.
_cmThread = new ConcurrentMarkThread(this);
assert(cmThread() != NULL, "CM Thread should have been created");
assert(cmThread()->cm() != NULL, "CM Thread should refer to this cm");
- _g1h = G1CollectedHeap::heap();
assert(CGC_lock != NULL, "Where's the CGC_lock?");
- assert(_markBitMap1.covers(rs), "_markBitMap1 inconsistency");
- assert(_markBitMap2.covers(rs), "_markBitMap2 inconsistency");
+ assert(_markBitMap1.covers(heap_rs), "_markBitMap1 inconsistency");
+ assert(_markBitMap2.covers(heap_rs), "_markBitMap2 inconsistency");
SATBMarkQueueSet& satb_qs = JavaThread::satb_mark_queue_set();
satb_qs.set_buffer_size(G1SATBBufferSize);
_root_regions.init(_g1h, this);
- _tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_worker_id, mtGC);
- _accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_worker_id, mtGC);
-
- _count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_worker_id, mtGC);
- _count_marked_bytes = NEW_C_HEAP_ARRAY(size_t*, _max_worker_id, mtGC);
-
- BitMap::idx_t card_bm_size = _card_bm.size();
-
- // so that the assertion in MarkingTaskQueue::task_queue doesn't fail
- _active_tasks = _max_worker_id;
- for (uint i = 0; i < _max_worker_id; ++i) {
- CMTaskQueue* task_queue = new CMTaskQueue();
- task_queue->initialize();
- _task_queues->register_queue(i, task_queue);
-
- _count_card_bitmaps[i] = BitMap(card_bm_size, false);
- _count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, (size_t) max_regions, mtGC);
-
- _tasks[i] = new CMTask(i, this,
- _count_marked_bytes[i],
- &_count_card_bitmaps[i],
- task_queue, _task_queues);
-
- _accum_task_vtime[i] = 0.0;
- }
-
- // Calculate the card number for the bottom of the heap. Used
- // in biasing indexes into the accounting card bitmaps.
- _heap_bottom_card_num =
- intptr_t(uintptr_t(_g1h->reserved_region().start()) >>
- CardTableModRefBS::card_shift);
-
- // Clear all the liveness counting data
- clear_all_count_data();
-
if (ConcGCThreads > ParallelGCThreads) {
- vm_exit_during_initialization("Can't have more ConcGCThreads "
- "than ParallelGCThreads.");
+ warning("Can't have more ConcGCThreads (" UINT32_FORMAT ") "
+ "than ParallelGCThreads (" UINT32_FORMAT ").",
+ ConcGCThreads, ParallelGCThreads);
+ return;
}
if (ParallelGCThreads == 0) {
// if we are not running with any parallel GC threads we will not
@@ -590,9 +632,86 @@
}
}
+ if (FLAG_IS_DEFAULT(MarkStackSize)) {
+ uintx mark_stack_size =
+ MIN2(MarkStackSizeMax,
+ MAX2(MarkStackSize, (uintx) (parallel_marking_threads() * TASKQUEUE_SIZE)));
+ // Verify that the calculated value for MarkStackSize is in range.
+ // It would be nice to use the private utility routine from Arguments.
+ if (!(mark_stack_size >= 1 && mark_stack_size <= MarkStackSizeMax)) {
+ warning("Invalid value calculated for MarkStackSize (" UINTX_FORMAT "): "
+ "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
+ mark_stack_size, 1, MarkStackSizeMax);
+ return;
+ }
+ FLAG_SET_ERGO(uintx, MarkStackSize, mark_stack_size);
+ } else {
+ // Verify MarkStackSize is in range.
+ if (FLAG_IS_CMDLINE(MarkStackSize)) {
+ if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
+ if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
+ warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT "): "
+ "must be between " UINTX_FORMAT " and " UINTX_FORMAT,
+ MarkStackSize, 1, MarkStackSizeMax);
+ return;
+ }
+ } else if (FLAG_IS_CMDLINE(MarkStackSizeMax)) {
+ if (!(MarkStackSize >= 1 && MarkStackSize <= MarkStackSizeMax)) {
+ warning("Invalid value specified for MarkStackSize (" UINTX_FORMAT ")"
+ " or for MarkStackSizeMax (" UINTX_FORMAT ")",
+ MarkStackSize, MarkStackSizeMax);
+ return;
+ }
+ }
+ }
+ }
+
+ if (!_markStack.allocate(MarkStackSize)) {
+ warning("Failed to allocate CM marking stack");
+ return;
+ }
+
+ _tasks = NEW_C_HEAP_ARRAY(CMTask*, _max_worker_id, mtGC);
+ _accum_task_vtime = NEW_C_HEAP_ARRAY(double, _max_worker_id, mtGC);
+
+ _count_card_bitmaps = NEW_C_HEAP_ARRAY(BitMap, _max_worker_id, mtGC);
+ _count_marked_bytes = NEW_C_HEAP_ARRAY(size_t*, _max_worker_id, mtGC);
+
+ BitMap::idx_t card_bm_size = _card_bm.size();
+
+ // so that the assertion in MarkingTaskQueue::task_queue doesn't fail
+ _active_tasks = _max_worker_id;
+
+ size_t max_regions = (size_t) _g1h->max_regions();
+ for (uint i = 0; i < _max_worker_id; ++i) {
+ CMTaskQueue* task_queue = new CMTaskQueue();
+ task_queue->initialize();
+ _task_queues->register_queue(i, task_queue);
+
+ _count_card_bitmaps[i] = BitMap(card_bm_size, false);
+ _count_marked_bytes[i] = NEW_C_HEAP_ARRAY(size_t, max_regions, mtGC);
+
+ _tasks[i] = new CMTask(i, this,
+ _count_marked_bytes[i],
+ &_count_card_bitmaps[i],
+ task_queue, _task_queues);
+
+ _accum_task_vtime[i] = 0.0;
+ }
+
+ // Calculate the card number for the bottom of the heap. Used
+ // in biasing indexes into the accounting card bitmaps.
+ _heap_bottom_card_num =
+ intptr_t(uintptr_t(_g1h->reserved_region().start()) >>
+ CardTableModRefBS::card_shift);
+
+ // Clear all the liveness counting data
+ clear_all_count_data();
+
// so that the call below can read a sensible value
- _heap_start = (HeapWord*) rs.base();
+ _heap_start = (HeapWord*) heap_rs.base();
set_non_marking_state();
+ _completed_initialization = true;
}
void ConcurrentMark::update_g1_committed(bool force) {
@@ -1165,6 +1284,11 @@
assert(!restart_for_overflow(), "sanity");
}
+ // Expand the marking stack, if we have to and if we can.
+ if (_markStack.should_expand()) {
+ _markStack.expand();
+ }
+
// Reset the marking state if marking completed
if (!restart_for_overflow()) {
set_non_marking_state();
@@ -2785,7 +2909,7 @@
// Verify entries on the task queues
for (uint i = 0; i < _max_worker_id; i += 1) {
cl.set_phase(VerifyNoCSetOopsQueues, i);
- OopTaskQueue* queue = _task_queues->queue(i);
+ CMTaskQueue* queue = _task_queues->queue(i);
queue->oops_do(&cl);
}
}
@@ -2840,8 +2964,8 @@
#endif // PRODUCT
void ConcurrentMark::clear_marking_state(bool clear_overflow) {
- _markStack.setEmpty();
- _markStack.clear_overflow();
+ _markStack.set_should_expand();
+ _markStack.setEmpty(); // Also clears the _markStack overflow flag
if (clear_overflow) {
clear_has_overflown();
} else {
@@ -2850,7 +2974,7 @@
_finger = _heap_start;
for (uint i = 0; i < _max_worker_id; ++i) {
- OopTaskQueue* queue = _task_queues->queue(i);
+ CMTaskQueue* queue = _task_queues->queue(i);
queue->set_empty();
}
}
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -63,7 +63,7 @@
public:
// constructor
- CMBitMapRO(ReservedSpace rs, int shifter);
+ CMBitMapRO(int shifter);
enum { do_yield = true };
@@ -117,8 +117,11 @@
public:
// constructor
- CMBitMap(ReservedSpace rs, int shifter) :
- CMBitMapRO(rs, shifter) {}
+ CMBitMap(int shifter) :
+ CMBitMapRO(shifter) {}
+
+ // Allocates the back store for the marking bitmap
+ bool allocate(ReservedSpace heap_rs);
// write marks
void mark(HeapWord* addr) {
@@ -155,17 +158,18 @@
MemRegion getAndClearMarkedRegion(HeapWord* addr, HeapWord* end_addr);
};
-// Represents a marking stack used by the CM collector.
-// Ideally this should be GrowableArray<> just like MSC's marking stack(s).
+// Represents a marking stack used by ConcurrentMarking in the G1 collector.
class CMMarkStack VALUE_OBJ_CLASS_SPEC {
+ VirtualSpace _virtual_space; // Underlying backing store for actual stack
ConcurrentMark* _cm;
oop* _base; // bottom of stack
- jint _index; // one more than last occupied index
- jint _capacity; // max #elements
- jint _saved_index; // value of _index saved at start of GC
- NOT_PRODUCT(jint _max_depth;) // max depth plumbed during run
+ jint _index; // one more than last occupied index
+ jint _capacity; // max #elements
+ jint _saved_index; // value of _index saved at start of GC
+ NOT_PRODUCT(jint _max_depth;) // max depth plumbed during run
- bool _overflow;
+ bool _overflow;
+ bool _should_expand;
DEBUG_ONLY(bool _drain_in_progress;)
DEBUG_ONLY(bool _drain_in_progress_yields;)
@@ -173,7 +177,13 @@
CMMarkStack(ConcurrentMark* cm);
~CMMarkStack();
- void allocate(size_t size);
+#ifndef PRODUCT
+ jint max_depth() const {
+ return _max_depth;
+ }
+#endif
+
+ bool allocate(size_t capacity);
oop pop() {
if (!isEmpty()) {
@@ -231,11 +241,17 @@
bool isEmpty() { return _index == 0; }
bool isFull() { return _index == _capacity; }
- int maxElems() { return _capacity; }
+ int maxElems() { return _capacity; }
bool overflow() { return _overflow; }
void clear_overflow() { _overflow = false; }
+ bool should_expand() const { return _should_expand; }
+ void set_should_expand();
+
+ // Expand the stack, typically in response to an overflow condition
+ void expand();
+
int size() { return _index; }
void setEmpty() { _index = 0; clear_overflow(); }
@@ -344,6 +360,7 @@
class ConcurrentMarkThread;
class ConcurrentMark: public CHeapObj<mtGC> {
+ friend class CMMarkStack;
friend class ConcurrentMarkThread;
friend class CMTask;
friend class CMBitMapClosure;
@@ -577,6 +594,9 @@
// the card bitmaps.
intptr_t _heap_bottom_card_num;
+ // Set to true when initialization is complete
+ bool _completed_initialization;
+
public:
// Manipulation of the global mark stack.
// Notice that the first mark_stack_push is CAS-based, whereas the
@@ -636,7 +656,7 @@
return _task_queues->steal(worker_id, hash_seed, obj);
}
- ConcurrentMark(ReservedSpace rs, uint max_regions);
+ ConcurrentMark(G1CollectedHeap* g1h, ReservedSpace heap_rs);
~ConcurrentMark();
ConcurrentMarkThread* cmThread() { return _cmThread; }
@@ -907,6 +927,11 @@
// Should *not* be called from parallel code.
inline bool mark_and_count(oop obj);
+ // Returns true if initialization was successfully completed.
+ bool completed_initialization() const {
+ return _completed_initialization;
+ }
+
protected:
// Clear all the per-task bitmaps and arrays used to store the
// counting data.
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2079,7 +2079,11 @@
// Create the ConcurrentMark data structure and thread.
// (Must do this late, so that "max_regions" is defined.)
- _cm = new ConcurrentMark(heap_rs, max_regions());
+ _cm = new ConcurrentMark(this, heap_rs);
+ if (_cm == NULL || !_cm->completed_initialization()) {
+ vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark");
+ return JNI_ENOMEM;
+ }
_cmThread = _cm->cmThread();
// Initialize the from_card cache structure of HeapRegionRemSet.
@@ -2087,7 +2091,7 @@
// Now expand into the initial heap size.
if (!expand(init_byte_size)) {
- vm_exit_during_initialization("Failed to allocate initial heap.");
+ vm_shutdown_during_initialization("Failed to allocate initial heap.");
return JNI_ENOMEM;
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/adjoiningVirtualSpaces.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/adjoiningVirtualSpaces.hpp"
+#include "memory/allocation.inline.hpp"
#include "runtime/java.hpp"
AdjoiningVirtualSpaces::AdjoiningVirtualSpaces(ReservedSpace rs,
--- a/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/gcStats.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "gc_implementation/shared/gcStats.hpp"
#include "gc_implementation/shared/gcUtil.hpp"
+#include "memory/allocation.inline.hpp"
GCStats::GCStats() {
_avg_promoted = new AdaptivePaddedNoZeroDevAverage(
--- a/hotspot/src/share/vm/memory/allocation.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/memory/allocation.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -202,7 +202,7 @@
// Calling new or delete will result in fatal error.
class StackObj ALLOCATION_SUPER_CLASS_SPEC {
- public:
+ private:
void* operator new(size_t size);
void operator delete(void* p);
};
@@ -226,7 +226,7 @@
// be defined as a an empty string "".
//
class _ValueObj {
- public:
+ private:
void* operator new(size_t size);
void operator delete(void* p);
};
--- a/hotspot/src/share/vm/memory/metaspace.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/memory/metaspace.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2192,11 +2192,6 @@
// MetaspaceAux
-size_t MetaspaceAux::used_in_bytes() {
- return (Metaspace::class_space_list()->used_words_sum() +
- Metaspace::space_list()->used_words_sum()) * BytesPerWord;
-}
-
size_t MetaspaceAux::used_in_bytes(Metaspace::MetadataType mdtype) {
size_t used = 0;
ClassLoaderDataGraphMetaspaceIterator iter;
@@ -2222,14 +2217,6 @@
return free * BytesPerWord;
}
-// The total words available for metadata allocation. This
-// uses Metaspace capacity_words() which is the total words
-// in chunks allocated for a Metaspace.
-size_t MetaspaceAux::capacity_in_bytes() {
- return (Metaspace::class_space_list()->capacity_words_sum() +
- Metaspace::space_list()->capacity_words_sum()) * BytesPerWord;
-}
-
size_t MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) {
size_t capacity = free_chunks_total(mdtype);
ClassLoaderDataGraphMetaspaceIterator iter;
@@ -2242,11 +2229,6 @@
return capacity * BytesPerWord;
}
-size_t MetaspaceAux::reserved_in_bytes() {
- return (Metaspace::class_space_list()->virtual_space_total() +
- Metaspace::space_list()->virtual_space_total()) * BytesPerWord;
-}
-
size_t MetaspaceAux::reserved_in_bytes(Metaspace::MetadataType mdtype) {
size_t reserved = (mdtype == Metaspace::ClassType) ?
Metaspace::class_space_list()->virtual_space_total() :
--- a/hotspot/src/share/vm/memory/metaspace.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/memory/metaspace.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -156,16 +156,25 @@
public:
// Total of space allocated to metadata in all Metaspaces
- static size_t used_in_bytes();
+ static size_t used_in_bytes() {
+ return used_in_bytes(Metaspace::ClassType) +
+ used_in_bytes(Metaspace::NonClassType);
+ }
// Total of available space in all Metaspaces
// Total of capacity allocated to all Metaspaces. This includes
// space in Metachunks not yet allocated and in the Metachunk
// freelist.
- static size_t capacity_in_bytes();
+ static size_t capacity_in_bytes() {
+ return capacity_in_bytes(Metaspace::ClassType) +
+ capacity_in_bytes(Metaspace::NonClassType);
+ }
// Total space reserved in all Metaspaces
- static size_t reserved_in_bytes();
+ static size_t reserved_in_bytes() {
+ return reserved_in_bytes(Metaspace::ClassType) +
+ reserved_in_bytes(Metaspace::NonClassType);
+ }
static size_t min_chunk_size();
--- a/hotspot/src/share/vm/oops/constMethod.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/oops/constMethod.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -46,6 +46,7 @@
// | interp_kind | flags | code_size |
// | name index | signature index |
// | method_idnum | max_stack |
+// | max_locals | size_of_parameters |
// |------------------------------------------------------|
// | |
// | byte codes |
@@ -150,7 +151,8 @@
// initially corresponds to the index into the methods array.
// but this may change with redefinition
u2 _max_stack; // Maximum number of entries on the expression stack
-
+ u2 _max_locals; // Number of local variables used by this method
+ u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
// Constructor
ConstMethod(int byte_code_size,
@@ -338,6 +340,11 @@
static ByteSize max_stack_offset()
{ return byte_offset_of(ConstMethod, _max_stack); }
+ static ByteSize size_of_locals_offset()
+ { return byte_offset_of(ConstMethod, _max_locals); }
+ static ByteSize size_of_parameters_offset()
+ { return byte_offset_of(ConstMethod, _size_of_parameters); }
+
// Unique id for the method
static const u2 MAX_IDNUM;
@@ -349,6 +356,14 @@
int max_stack() const { return _max_stack; }
void set_max_stack(int size) { _max_stack = size; }
+ // max locals
+ int max_locals() const { return _max_locals; }
+ void set_max_locals(int size) { _max_locals = size; }
+
+ // size of parameters
+ int size_of_parameters() const { return _size_of_parameters; }
+ void set_size_of_parameters(int size) { _size_of_parameters = size; }
+
// Deallocation for RedefineClasses
void deallocate_contents(ClassLoaderData* loader_data);
bool is_klass() const { return false; }
--- a/hotspot/src/share/vm/oops/method.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/oops/method.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -73,8 +73,7 @@
// |------------------------------------------------------|
// | result_index (C++ interpreter only) |
// |------------------------------------------------------|
-// | method_size | max_locals |
-// | size_of_parameters | intrinsic_id| flags |
+// | method_size | intrinsic_id| flags |
// |------------------------------------------------------|
// | throwout_count | num_breakpoints |
// |------------------------------------------------------|
@@ -116,8 +115,6 @@
int _result_index; // C++ interpreter needs for converting results to/from stack
#endif
u2 _method_size; // size of this object
- u2 _max_locals; // Number of local variables used by this method
- u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
u1 _jfr_towrite : 1, // Flags
_force_inline : 1,
@@ -299,8 +296,8 @@
void set_max_stack(int size) { constMethod()->set_max_stack(size); }
// max locals
- int max_locals() const { return _max_locals; }
- void set_max_locals(int size) { _max_locals = size; }
+ int max_locals() const { return constMethod()->max_locals(); }
+ void set_max_locals(int size) { constMethod()->set_max_locals(size); }
int highest_comp_level() const;
void set_highest_comp_level(int level);
@@ -318,7 +315,8 @@
void set_interpreter_throwout_count(int count) { _interpreter_throwout_count = count; }
// size of parameters
- int size_of_parameters() const { return _size_of_parameters; }
+ int size_of_parameters() const { return constMethod()->size_of_parameters(); }
+ void set_size_of_parameters(int size) { constMethod()->set_size_of_parameters(size); }
bool has_stackmap_table() const {
return constMethod()->has_stackmap_table();
@@ -595,8 +593,6 @@
#ifdef CC_INTERP
static ByteSize result_index_offset() { return byte_offset_of(Method, _result_index ); }
#endif /* CC_INTERP */
- static ByteSize size_of_locals_offset() { return byte_offset_of(Method, _max_locals ); }
- static ByteSize size_of_parameters_offset() { return byte_offset_of(Method, _size_of_parameters); }
static ByteSize from_compiled_offset() { return byte_offset_of(Method, _from_compiled_entry); }
static ByteSize code_offset() { return byte_offset_of(Method, _code); }
static ByteSize invocation_counter_offset() { return byte_offset_of(Method, _invocation_counter); }
@@ -804,9 +800,6 @@
Array<AnnotationArray*>* methods_type_annotations,
bool idempotent = false);
- // size of parameters
- void set_size_of_parameters(int size) { _size_of_parameters = size; }
-
// Deallocation function for redefine classes or if an error occurs
void deallocate_contents(ClassLoaderData* loader_data);
--- a/hotspot/src/share/vm/opto/addnode.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/addnode.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -189,6 +189,11 @@
set_req(1, addx);
set_req(2, a22);
progress = this;
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if (add2->outcnt() == 0 && igvn) {
+ // add disconnected.
+ igvn->_worklist.push(add2);
+ }
}
}
@@ -624,6 +629,11 @@
if( t22->singleton() && (t22 != Type::TOP) ) { // Right input is an add of a constant?
set_req(Address, phase->transform(new (phase->C) AddPNode(in(Base),in(Address),add->in(1))));
set_req(Offset, add->in(2));
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if (add->outcnt() == 0 && igvn) {
+ // add disconnected.
+ igvn->_worklist.push((Node*)add);
+ }
return this; // Made progress
}
}
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -403,7 +403,7 @@
//------------------------------print_inlining---------------------------------
// Really, the failure_msg can be a success message also.
void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const {
- CompileTask::print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
+ C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
if (callee_method == NULL) tty->print(" callee not monotonic or profiled");
if (Verbose && callee_method) {
const InlineTree *top = this;
--- a/hotspot/src/share/vm/opto/callGenerator.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/callGenerator.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -274,6 +274,9 @@
virtual void do_late_inline();
virtual JVMState* generate(JVMState* jvms) {
+ Compile *C = Compile::current();
+ C->print_inlining_skip(this);
+
// Record that this call site should be revisited once the main
// parse is finished.
Compile::current()->add_late_inline(this);
@@ -284,7 +287,6 @@
// as is done for allocations and macro expansion.
return DirectCallGenerator::generate(jvms);
}
-
};
@@ -307,7 +309,9 @@
// Make sure the state is a MergeMem for parsing.
if (!map->in(TypeFunc::Memory)->is_MergeMem()) {
- map->set_req(TypeFunc::Memory, MergeMemNode::make(C, map->in(TypeFunc::Memory)));
+ Node* mem = MergeMemNode::make(C, map->in(TypeFunc::Memory));
+ C->initial_gvn()->set_type_bottom(mem);
+ map->set_req(TypeFunc::Memory, mem);
}
// Make enough space for the expression stack and transfer the incoming arguments
@@ -320,6 +324,8 @@
}
}
+ C->print_inlining_insert(this);
+
CompileLog* log = C->log();
if (log != NULL) {
log->head("late_inline method='%d'", log->identify(method()));
@@ -608,7 +614,7 @@
if (cg != NULL && cg->is_inline())
return cg;
} else {
- if (PrintInlining) CompileTask::print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant");
+ if (PrintInlining) C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), "receiver not constant");
}
}
break;
--- a/hotspot/src/share/vm/opto/callGenerator.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/callGenerator.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -147,9 +147,9 @@
CallGenerator* cg);
virtual Node* generate_predicate(JVMState* jvms) { return NULL; };
- static void print_inlining(ciMethod* callee, int inline_level, int bci, const char* msg) {
+ static void print_inlining(Compile* C, ciMethod* callee, int inline_level, int bci, const char* msg) {
if (PrintInlining)
- CompileTask::print_inlining(callee, inline_level, bci, msg);
+ C->print_inlining(callee, inline_level, bci, msg);
}
};
--- a/hotspot/src/share/vm/opto/callnode.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/callnode.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -751,7 +751,7 @@
projs->fallthrough_ioproj = pn;
for (DUIterator j = pn->outs(); pn->has_out(j); j++) {
Node* e = pn->out(j);
- if (e->Opcode() == Op_CreateEx && e->in(0)->is_CatchProj()) {
+ if (e->Opcode() == Op_CreateEx && e->in(0)->is_CatchProj() && e->outcnt() > 0) {
assert(projs->exobj == NULL, "only one");
projs->exobj = e;
}
--- a/hotspot/src/share/vm/opto/cfgnode.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/cfgnode.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -1566,6 +1566,10 @@
Node* n = in(j); // Get the input
if (rc == NULL || phase->type(rc) == Type::TOP) {
if (n != top) { // Not already top?
+ PhaseIterGVN *igvn = phase->is_IterGVN();
+ if (can_reshape && igvn != NULL) {
+ igvn->_worklist.push(r);
+ }
set_req(j, top); // Nuke it down
progress = this; // Record progress
}
--- a/hotspot/src/share/vm/opto/compile.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/compile.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -610,7 +610,9 @@
_trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")),
_printer(IdealGraphPrinter::printer()),
#endif
- _congraph(NULL) {
+ _congraph(NULL),
+ _print_inlining_list(NULL),
+ _print_inlining(0) {
C = this;
CompileWrapper cw(this);
@@ -666,6 +668,9 @@
PhaseGVN gvn(node_arena(), estimated_size);
set_initial_gvn(&gvn);
+ if (PrintInlining) {
+ _print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer());
+ }
{ // Scope for timing the parser
TracePhase t3("parse", &_t_parser, true);
@@ -754,6 +759,7 @@
}
}
assert(_late_inlines.length() == 0, "should have been processed");
+ dump_inlining();
print_method("Before RemoveUseless", 3);
@@ -899,7 +905,9 @@
#endif
_dead_node_list(comp_arena()),
_dead_node_count(0),
- _congraph(NULL) {
+ _congraph(NULL),
+ _print_inlining_list(NULL),
+ _print_inlining(0) {
C = this;
#ifndef PRODUCT
@@ -3351,3 +3359,11 @@
cb.consts()->relocate((address) constant_addr, relocInfo::internal_word_type);
}
}
+
+void Compile::dump_inlining() {
+ if (PrintInlining) {
+ for (int i = 0; i < _print_inlining_list->length(); i++) {
+ tty->print(_print_inlining_list->at(i).ss()->as_string());
+ }
+ }
+}
--- a/hotspot/src/share/vm/opto/compile.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/compile.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -30,6 +30,7 @@
#include "code/debugInfoRec.hpp"
#include "code/exceptionHandlerTable.hpp"
#include "compiler/compilerOracle.hpp"
+#include "compiler/compileBroker.hpp"
#include "libadt/dict.hpp"
#include "libadt/port.hpp"
#include "libadt/vectset.hpp"
@@ -369,6 +370,61 @@
GrowableArray<CallGenerator*> _late_inlines; // List of CallGenerators to be revisited after
// main parsing has finished.
+ // Inlining may not happen in parse order which would make
+ // PrintInlining output confusing. Keep track of PrintInlining
+ // pieces in order.
+ class PrintInliningBuffer : public ResourceObj {
+ private:
+ CallGenerator* _cg;
+ stringStream* _ss;
+
+ public:
+ PrintInliningBuffer()
+ : _cg(NULL) { _ss = new stringStream(); }
+
+ stringStream* ss() const { return _ss; }
+ CallGenerator* cg() const { return _cg; }
+ void set_cg(CallGenerator* cg) { _cg = cg; }
+ };
+
+ GrowableArray<PrintInliningBuffer>* _print_inlining_list;
+ int _print_inlining;
+
+ public:
+
+ outputStream* print_inlining_stream() const {
+ return _print_inlining_list->at(_print_inlining).ss();
+ }
+
+ void print_inlining_skip(CallGenerator* cg) {
+ if (PrintInlining) {
+ _print_inlining_list->at(_print_inlining).set_cg(cg);
+ _print_inlining++;
+ _print_inlining_list->insert_before(_print_inlining, PrintInliningBuffer());
+ }
+ }
+
+ void print_inlining_insert(CallGenerator* cg) {
+ if (PrintInlining) {
+ for (int i = 0; i < _print_inlining_list->length(); i++) {
+ if (_print_inlining_list->at(i).cg() == cg) {
+ _print_inlining_list->insert_before(i+1, PrintInliningBuffer());
+ _print_inlining = i+1;
+ _print_inlining_list->at(i).set_cg(NULL);
+ return;
+ }
+ }
+ ShouldNotReachHere();
+ }
+ }
+
+ void print_inlining(ciMethod* method, int inline_level, int bci, const char* msg = NULL) {
+ stringStream ss;
+ CompileTask::print_inlining(&ss, method, inline_level, bci, msg);
+ print_inlining_stream()->print(ss.as_string());
+ }
+
+ private:
// Matching, CFG layout, allocation, code generation
PhaseCFG* _cfg; // Results of CFG finding
bool _select_24_bit_instr; // We selected an instruction with a 24-bit result
@@ -591,7 +647,7 @@
void reset_dead_node_list() { _dead_node_list.Reset();
_dead_node_count = 0;
}
- uint live_nodes() {
+ uint live_nodes() const {
int val = _unique - _dead_node_count;
assert (val >= 0, err_msg_res("number of tracked dead nodes %d more than created nodes %d", _unique, _dead_node_count));
return (uint) val;
@@ -702,7 +758,7 @@
void identify_useful_nodes(Unique_Node_List &useful);
void update_dead_node_list(Unique_Node_List &useful);
- void remove_useless_nodes (Unique_Node_List &useful);
+ void remove_useless_nodes (Unique_Node_List &useful);
WarmCallInfo* warm_calls() const { return _warm_calls; }
void set_warm_calls(WarmCallInfo* l) { _warm_calls = l; }
@@ -711,6 +767,8 @@
// Record this CallGenerator for inlining at the end of parsing.
void add_late_inline(CallGenerator* cg) { _late_inlines.push(cg); }
+ void dump_inlining();
+
// Matching, CFG layout, allocation, code generation
PhaseCFG* cfg() { return _cfg; }
bool select_24_bit_instr() const { return _select_24_bit_instr; }
--- a/hotspot/src/share/vm/opto/doCall.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/doCall.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -40,19 +40,24 @@
#include "prims/nativeLookup.hpp"
#include "runtime/sharedRuntime.hpp"
-void trace_type_profile(ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
+void trace_type_profile(Compile* C, ciMethod *method, int depth, int bci, ciMethod *prof_method, ciKlass *prof_klass, int site_count, int receiver_count) {
if (TraceTypeProfile || PrintInlining NOT_PRODUCT(|| PrintOptoInlining)) {
+ outputStream* out = tty;
if (!PrintInlining) {
if (NOT_PRODUCT(!PrintOpto &&) !PrintCompilation) {
method->print_short_name();
tty->cr();
}
CompileTask::print_inlining(prof_method, depth, bci);
+ } else {
+ out = C->print_inlining_stream();
}
- CompileTask::print_inline_indent(depth);
- tty->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
- prof_klass->name()->print_symbol();
- tty->cr();
+ CompileTask::print_inline_indent(depth, out);
+ out->print(" \\-> TypeProfile (%d/%d counts) = ", receiver_count, site_count);
+ stringStream ss;
+ prof_klass->name()->print_symbol_on(&ss);
+ out->print(ss.as_string());
+ out->cr();
}
}
@@ -233,13 +238,13 @@
}
if (miss_cg != NULL) {
if (next_hit_cg != NULL) {
- trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), next_receiver_method, profile.receiver(1), site_count, profile.receiver_count(1));
+ trace_type_profile(C, jvms->method(), jvms->depth() - 1, jvms->bci(), next_receiver_method, profile.receiver(1), site_count, profile.receiver_count(1));
// We don't need to record dependency on a receiver here and below.
// Whenever we inline, the dependency is added by Parse::Parse().
miss_cg = CallGenerator::for_predicted_call(profile.receiver(1), miss_cg, next_hit_cg, PROB_MAX);
}
if (miss_cg != NULL) {
- trace_type_profile(jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count);
+ trace_type_profile(C, jvms->method(), jvms->depth() - 1, jvms->bci(), receiver_method, profile.receiver(0), site_count, receiver_count);
CallGenerator* cg = CallGenerator::for_predicted_call(profile.receiver(0), miss_cg, hit_cg, profile.receiver_prob(0));
if (cg != NULL) return cg;
}
--- a/hotspot/src/share/vm/opto/graphKit.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/graphKit.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -1771,11 +1771,21 @@
CallProjections callprojs;
call->extract_projections(&callprojs, true);
+ Node* init_mem = call->in(TypeFunc::Memory);
+ Node* final_mem = final_state->in(TypeFunc::Memory);
+ Node* final_ctl = final_state->in(TypeFunc::Control);
+ Node* final_io = final_state->in(TypeFunc::I_O);
+
// Replace all the old call edges with the edges from the inlining result
- C->gvn_replace_by(callprojs.fallthrough_catchproj, final_state->in(TypeFunc::Control));
- C->gvn_replace_by(callprojs.fallthrough_memproj, final_state->in(TypeFunc::Memory));
- C->gvn_replace_by(callprojs.fallthrough_ioproj, final_state->in(TypeFunc::I_O));
- Node* final_mem = final_state->in(TypeFunc::Memory);
+ if (callprojs.fallthrough_catchproj != NULL) {
+ C->gvn_replace_by(callprojs.fallthrough_catchproj, final_ctl);
+ }
+ if (callprojs.fallthrough_memproj != NULL) {
+ C->gvn_replace_by(callprojs.fallthrough_memproj, final_mem);
+ }
+ if (callprojs.fallthrough_ioproj != NULL) {
+ C->gvn_replace_by(callprojs.fallthrough_ioproj, final_io);
+ }
// Replace the result with the new result if it exists and is used
if (callprojs.resproj != NULL && result != NULL) {
@@ -2980,7 +2990,7 @@
set_control( _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Control) ) );
// create memory projection for i_o
set_memory ( _gvn.transform( new (C) ProjNode(allocx, TypeFunc::Memory, true) ), rawidx );
- make_slow_call_ex(allocx, env()->OutOfMemoryError_klass(), true);
+ make_slow_call_ex(allocx, env()->Throwable_klass(), true);
// create a memory projection as for the normal control path
Node* malloc = _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Memory));
--- a/hotspot/src/share/vm/opto/library_call.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/library_call.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -282,6 +282,7 @@
typedef enum { LS_xadd, LS_xchg, LS_cmpxchg } LoadStoreKind;
bool inline_unsafe_load_store(BasicType type, LoadStoreKind kind);
bool inline_unsafe_ordered_store(BasicType type);
+ bool inline_unsafe_fence(vmIntrinsics::ID id);
bool inline_fp_conversions(vmIntrinsics::ID id);
bool inline_number_methods(vmIntrinsics::ID id);
bool inline_reference_get();
@@ -334,6 +335,9 @@
case vmIntrinsics::_getAndSetInt:
case vmIntrinsics::_getAndSetLong:
case vmIntrinsics::_getAndSetObject:
+ case vmIntrinsics::_loadFence:
+ case vmIntrinsics::_storeFence:
+ case vmIntrinsics::_fullFence:
break; // InlineNatives does not control String.compareTo
case vmIntrinsics::_Reference_get:
break; // InlineNatives does not control Reference.get
@@ -536,7 +540,7 @@
// Try to inline the intrinsic.
if (kit.try_to_inline()) {
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
- CompileTask::print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
+ C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
}
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
if (C->log()) {
@@ -555,7 +559,7 @@
if (jvms->has_method()) {
// Not a root compile.
const char* msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)";
- CompileTask::print_inlining(callee, jvms->depth() - 1, bci, msg);
+ C->print_inlining(callee, jvms->depth() - 1, bci, msg);
} else {
// Root compile
tty->print("Did not generate intrinsic %s%s at bci:%d in",
@@ -585,7 +589,7 @@
Node* slow_ctl = kit.try_to_predicate();
if (!kit.failing()) {
if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
- CompileTask::print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
+ C->print_inlining(callee, jvms->depth() - 1, bci, is_virtual() ? "(intrinsic, virtual)" : "(intrinsic)");
}
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_worked);
if (C->log()) {
@@ -602,12 +606,12 @@
if (jvms->has_method()) {
// Not a root compile.
const char* msg = "failed to generate predicate for intrinsic";
- CompileTask::print_inlining(kit.callee(), jvms->depth() - 1, bci, msg);
+ C->print_inlining(kit.callee(), jvms->depth() - 1, bci, msg);
} else {
// Root compile
- tty->print("Did not generate predicate for intrinsic %s%s at bci:%d in",
- vmIntrinsics::name_at(intrinsic_id()),
- (is_virtual() ? " (virtual)" : ""), bci);
+ C->print_inlining_stream()->print("Did not generate predicate for intrinsic %s%s at bci:%d in",
+ vmIntrinsics::name_at(intrinsic_id()),
+ (is_virtual() ? " (virtual)" : ""), bci);
}
}
C->gather_intrinsic_statistics(intrinsic_id(), is_virtual(), Compile::_intrinsic_failed);
@@ -732,6 +736,10 @@
case vmIntrinsics::_getAndSetLong: return inline_unsafe_load_store(T_LONG, LS_xchg);
case vmIntrinsics::_getAndSetObject: return inline_unsafe_load_store(T_OBJECT, LS_xchg);
+ case vmIntrinsics::_loadFence:
+ case vmIntrinsics::_storeFence:
+ case vmIntrinsics::_fullFence: return inline_unsafe_fence(intrinsic_id());
+
case vmIntrinsics::_currentThread: return inline_native_currentThread();
case vmIntrinsics::_isInterrupted: return inline_native_isInterrupted();
@@ -2840,6 +2848,26 @@
return true;
}
+bool LibraryCallKit::inline_unsafe_fence(vmIntrinsics::ID id) {
+ // Regardless of form, don't allow previous ld/st to move down,
+ // then issue acquire, release, or volatile mem_bar.
+ insert_mem_bar(Op_MemBarCPUOrder);
+ switch(id) {
+ case vmIntrinsics::_loadFence:
+ insert_mem_bar(Op_MemBarAcquire);
+ return true;
+ case vmIntrinsics::_storeFence:
+ insert_mem_bar(Op_MemBarRelease);
+ return true;
+ case vmIntrinsics::_fullFence:
+ insert_mem_bar(Op_MemBarVolatile);
+ return true;
+ default:
+ fatal_unexpected_iid(id);
+ return false;
+ }
+}
+
//----------------------------inline_unsafe_allocate---------------------------
// public native Object sun.mics.Unsafe.allocateInstance(Class<?> cls);
bool LibraryCallKit::inline_unsafe_allocate() {
@@ -2952,14 +2980,23 @@
// We only go to the fast case code if we pass two guards.
// Paths which do not pass are accumulated in the slow_region.
+
+ enum {
+ no_int_result_path = 1, // t == Thread.current() && !TLS._osthread._interrupted
+ no_clear_result_path = 2, // t == Thread.current() && TLS._osthread._interrupted && !clear_int
+ slow_result_path = 3, // slow path: t.isInterrupted(clear_int)
+ PATH_LIMIT
+ };
+
+ // Ensure that it's not possible to move the load of TLS._osthread._interrupted flag
+ // out of the function.
+ insert_mem_bar(Op_MemBarCPUOrder);
+
+ RegionNode* result_rgn = new (C) RegionNode(PATH_LIMIT);
+ PhiNode* result_val = new (C) PhiNode(result_rgn, TypeInt::BOOL);
+
RegionNode* slow_region = new (C) RegionNode(1);
record_for_igvn(slow_region);
- RegionNode* result_rgn = new (C) RegionNode(1+3); // fast1, fast2, slow
- PhiNode* result_val = new (C) PhiNode(result_rgn, TypeInt::BOOL);
- enum { no_int_result_path = 1,
- no_clear_result_path = 2,
- slow_result_path = 3
- };
// (a) Receiving thread must be the current thread.
Node* rec_thr = argument(0);
@@ -2968,14 +3005,13 @@
Node* cmp_thr = _gvn.transform( new (C) CmpPNode(cur_thr, rec_thr) );
Node* bol_thr = _gvn.transform( new (C) BoolNode(cmp_thr, BoolTest::ne) );
- bool known_current_thread = (_gvn.type(bol_thr) == TypeInt::ZERO);
- if (!known_current_thread)
- generate_slow_guard(bol_thr, slow_region);
+ generate_slow_guard(bol_thr, slow_region);
// (b) Interrupt bit on TLS must be false.
Node* p = basic_plus_adr(top()/*!oop*/, tls_ptr, in_bytes(JavaThread::osthread_offset()));
Node* osthread = make_load(NULL, p, TypeRawPtr::NOTNULL, T_ADDRESS);
p = basic_plus_adr(top()/*!oop*/, osthread, in_bytes(OSThread::interrupted_offset()));
+
// Set the control input on the field _interrupted read to prevent it floating up.
Node* int_bit = make_load(control(), p, TypeInt::BOOL, T_INT);
Node* cmp_bit = _gvn.transform( new (C) CmpINode(int_bit, intcon(0)) );
@@ -3020,22 +3056,20 @@
Node* slow_val = set_results_for_java_call(slow_call);
// this->control() comes from set_results_for_java_call
- // If we know that the result of the slow call will be true, tell the optimizer!
- if (known_current_thread) slow_val = intcon(1);
-
Node* fast_io = slow_call->in(TypeFunc::I_O);
Node* fast_mem = slow_call->in(TypeFunc::Memory);
+
// These two phis are pre-filled with copies of of the fast IO and Memory
- Node* io_phi = PhiNode::make(result_rgn, fast_io, Type::ABIO);
- Node* mem_phi = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
+ PhiNode* result_mem = PhiNode::make(result_rgn, fast_mem, Type::MEMORY, TypePtr::BOTTOM);
+ PhiNode* result_io = PhiNode::make(result_rgn, fast_io, Type::ABIO);
result_rgn->init_req(slow_result_path, control());
- io_phi ->init_req(slow_result_path, i_o());
- mem_phi ->init_req(slow_result_path, reset_memory());
+ result_io ->init_req(slow_result_path, i_o());
+ result_mem->init_req(slow_result_path, reset_memory());
result_val->init_req(slow_result_path, slow_val);
- set_all_memory( _gvn.transform(mem_phi) );
- set_i_o( _gvn.transform(io_phi) );
+ set_all_memory(_gvn.transform(result_mem));
+ set_i_o( _gvn.transform(result_io));
}
C->set_has_split_ifs(true); // Has chance for split-if optimization
@@ -3319,7 +3353,7 @@
Node* arg = args[which_arg];
arg = null_check(arg);
if (stopped()) break;
- args[which_arg] = _gvn.transform(arg);
+ args[which_arg] = arg;
Node* p = basic_plus_adr(arg, class_klass_offset);
Node* kls = LoadKlassNode::make(_gvn, immutable_memory(), p, adr_type, kls_type);
--- a/hotspot/src/share/vm/opto/node.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/node.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -1839,15 +1839,16 @@
return idx; // True for other than index 0 (control)
}
+static RegMask _not_used_at_all;
// Register classes are defined for specific machines
const RegMask &Node::out_RegMask() const {
ShouldNotCallThis();
- return *(new RegMask());
+ return _not_used_at_all;
}
const RegMask &Node::in_RegMask(uint) const {
ShouldNotCallThis();
- return *(new RegMask());
+ return _not_used_at_all;
}
//=============================================================================
--- a/hotspot/src/share/vm/opto/parse3.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/parse3.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -509,6 +509,7 @@
makecon(TypeKlassPtr::make(array_klass)),
dims);
}
+ make_slow_call_ex(c, env()->Throwable_klass(), false);
Node* res = _gvn.transform(new (C) ProjNode(c, TypeFunc::Parms));
--- a/hotspot/src/share/vm/opto/runtime.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/runtime.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -989,7 +989,7 @@
// since we're notifying the VM on every catch.
// Force deoptimization and the rest of the lookup
// will be fine.
- deoptimize_caller_frame(thread, true);
+ deoptimize_caller_frame(thread);
}
// Check the stack guard pages. If enabled, look for handler in this frame;
@@ -1143,17 +1143,22 @@
void OptoRuntime::deoptimize_caller_frame(JavaThread *thread, bool doit) {
- // Deoptimize frame
- if (doit) {
- // Called from within the owner thread, so no need for safepoint
- RegisterMap reg_map(thread);
- frame stub_frame = thread->last_frame();
- assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
- frame caller_frame = stub_frame.sender(®_map);
+ // Deoptimize the caller before continuing, as the compiled
+ // exception handler table may not be valid.
+ if (!StressCompiledExceptionHandlers && doit) {
+ deoptimize_caller_frame(thread);
+ }
+}
- // Deoptimize the caller frame.
- Deoptimization::deoptimize_frame(thread, caller_frame.id());
- }
+void OptoRuntime::deoptimize_caller_frame(JavaThread *thread) {
+ // Called from within the owner thread, so no need for safepoint
+ RegisterMap reg_map(thread);
+ frame stub_frame = thread->last_frame();
+ assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check");
+ frame caller_frame = stub_frame.sender(®_map);
+
+ // Deoptimize the caller frame.
+ Deoptimization::deoptimize_frame(thread, caller_frame.id());
}
--- a/hotspot/src/share/vm/opto/runtime.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/runtime.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -174,6 +174,7 @@
static address handle_exception_C (JavaThread* thread);
static address handle_exception_C_helper(JavaThread* thread, nmethod*& nm);
static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
+ static void deoptimize_caller_frame (JavaThread *thread);
static void deoptimize_caller_frame (JavaThread *thread, bool doit);
static bool is_deoptimized_caller_frame (JavaThread *thread);
--- a/hotspot/src/share/vm/opto/stringopts.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/opto/stringopts.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -744,7 +744,9 @@
ctrl_path.push(cn);
ctrl_path.push(cn->proj_out(0));
ctrl_path.push(cn->proj_out(0)->unique_out());
- ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0));
+ if (cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0) != NULL) {
+ ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0));
+ }
} else {
ShouldNotReachHere();
}
@@ -762,6 +764,12 @@
} else if (ptr->is_IfTrue()) {
IfNode* iff = ptr->in(0)->as_If();
BoolNode* b = iff->in(1)->isa_Bool();
+
+ if (b == NULL) {
+ fail = true;
+ break;
+ }
+
Node* cmp = b->in(1);
Node* v1 = cmp->in(1);
Node* v2 = cmp->in(2);
@@ -1408,71 +1416,76 @@
Deoptimization::Action_make_not_entrant);
}
- // length now contains the number of characters needed for the
- // char[] so create a new AllocateArray for the char[]
- Node* char_array = NULL;
- {
- PreserveReexecuteState preexecs(&kit);
- // The original jvms is for an allocation of either a String or
- // StringBuffer so no stack adjustment is necessary for proper
- // reexecution. If we deoptimize in the slow path the bytecode
- // will be reexecuted and the char[] allocation will be thrown away.
- kit.jvms()->set_should_reexecute(true);
- char_array = kit.new_array(__ makecon(TypeKlassPtr::make(ciTypeArrayKlass::make(T_CHAR))),
- length, 1);
- }
+ Node* result;
+ if (!kit.stopped()) {
+
+ // length now contains the number of characters needed for the
+ // char[] so create a new AllocateArray for the char[]
+ Node* char_array = NULL;
+ {
+ PreserveReexecuteState preexecs(&kit);
+ // The original jvms is for an allocation of either a String or
+ // StringBuffer so no stack adjustment is necessary for proper
+ // reexecution. If we deoptimize in the slow path the bytecode
+ // will be reexecuted and the char[] allocation will be thrown away.
+ kit.jvms()->set_should_reexecute(true);
+ char_array = kit.new_array(__ makecon(TypeKlassPtr::make(ciTypeArrayKlass::make(T_CHAR))),
+ length, 1);
+ }
+
+ // Mark the allocation so that zeroing is skipped since the code
+ // below will overwrite the entire array
+ AllocateArrayNode* char_alloc = AllocateArrayNode::Ideal_array_allocation(char_array, _gvn);
+ char_alloc->maybe_set_complete(_gvn);
- // Mark the allocation so that zeroing is skipped since the code
- // below will overwrite the entire array
- AllocateArrayNode* char_alloc = AllocateArrayNode::Ideal_array_allocation(char_array, _gvn);
- char_alloc->maybe_set_complete(_gvn);
-
- // Now copy the string representations into the final char[]
- Node* start = __ intcon(0);
- for (int argi = 0; argi < sc->num_arguments(); argi++) {
- Node* arg = sc->argument(argi);
- switch (sc->mode(argi)) {
- case StringConcat::IntMode: {
- Node* end = __ AddI(start, string_sizes->in(argi));
- // getChars words backwards so pass the ending point as well as the start
- int_getChars(kit, arg, char_array, start, end);
- start = end;
- break;
+ // Now copy the string representations into the final char[]
+ Node* start = __ intcon(0);
+ for (int argi = 0; argi < sc->num_arguments(); argi++) {
+ Node* arg = sc->argument(argi);
+ switch (sc->mode(argi)) {
+ case StringConcat::IntMode: {
+ Node* end = __ AddI(start, string_sizes->in(argi));
+ // getChars words backwards so pass the ending point as well as the start
+ int_getChars(kit, arg, char_array, start, end);
+ start = end;
+ break;
+ }
+ case StringConcat::StringNullCheckMode:
+ case StringConcat::StringMode: {
+ start = copy_string(kit, arg, char_array, start);
+ break;
+ }
+ case StringConcat::CharMode: {
+ __ store_to_memory(kit.control(), kit.array_element_address(char_array, start, T_CHAR),
+ arg, T_CHAR, char_adr_idx);
+ start = __ AddI(start, __ intcon(1));
+ break;
+ }
+ default:
+ ShouldNotReachHere();
}
- case StringConcat::StringNullCheckMode:
- case StringConcat::StringMode: {
- start = copy_string(kit, arg, char_array, start);
- break;
- }
- case StringConcat::CharMode: {
- __ store_to_memory(kit.control(), kit.array_element_address(char_array, start, T_CHAR),
- arg, T_CHAR, char_adr_idx);
- start = __ AddI(start, __ intcon(1));
- break;
- }
- default:
- ShouldNotReachHere();
}
- }
- // If we're not reusing an existing String allocation then allocate one here.
- Node* result = sc->string_alloc();
- if (result == NULL) {
- PreserveReexecuteState preexecs(&kit);
- // The original jvms is for an allocation of either a String or
- // StringBuffer so no stack adjustment is necessary for proper
- // reexecution.
- kit.jvms()->set_should_reexecute(true);
- result = kit.new_instance(__ makecon(TypeKlassPtr::make(C->env()->String_klass())));
+ // If we're not reusing an existing String allocation then allocate one here.
+ result = sc->string_alloc();
+ if (result == NULL) {
+ PreserveReexecuteState preexecs(&kit);
+ // The original jvms is for an allocation of either a String or
+ // StringBuffer so no stack adjustment is necessary for proper
+ // reexecution.
+ kit.jvms()->set_should_reexecute(true);
+ result = kit.new_instance(__ makecon(TypeKlassPtr::make(C->env()->String_klass())));
+ }
+
+ // Intialize the string
+ if (java_lang_String::has_offset_field()) {
+ kit.store_String_offset(kit.control(), result, __ intcon(0));
+ kit.store_String_length(kit.control(), result, length);
+ }
+ kit.store_String_value(kit.control(), result, char_array);
+ } else {
+ result = C->top();
}
-
- // Intialize the string
- if (java_lang_String::has_offset_field()) {
- kit.store_String_offset(kit.control(), result, __ intcon(0));
- kit.store_String_length(kit.control(), result, length);
- }
- kit.store_String_value(kit.control(), result, char_array);
-
// hook up the outgoing control and result
kit.replace_call(sc->end(), result);
--- a/hotspot/src/share/vm/prims/methodHandles.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -1168,8 +1168,8 @@
// Walk all nmethods depending on this call site.
MutexLocker mu(Compile_lock, thread);
Universe::flush_dependents_on(call_site, target);
+ java_lang_invoke_CallSite::set_target(call_site(), target());
}
- java_lang_invoke_CallSite::set_target(call_site(), target());
}
JVM_END
@@ -1180,8 +1180,8 @@
// Walk all nmethods depending on this call site.
MutexLocker mu(Compile_lock, thread);
Universe::flush_dependents_on(call_site, target);
+ java_lang_invoke_CallSite::set_target_volatile(call_site(), target());
}
- java_lang_invoke_CallSite::set_target_volatile(call_site(), target());
}
JVM_END
--- a/hotspot/src/share/vm/prims/unsafe.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/prims/unsafe.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -468,6 +468,21 @@
#endif
UNSAFE_END
+UNSAFE_ENTRY(void, Unsafe_LoadFence(JNIEnv *env, jobject unsafe))
+ UnsafeWrapper("Unsafe_LoadFence");
+ OrderAccess::acquire();
+UNSAFE_END
+
+UNSAFE_ENTRY(void, Unsafe_StoreFence(JNIEnv *env, jobject unsafe))
+ UnsafeWrapper("Unsafe_StoreFence");
+ OrderAccess::release();
+UNSAFE_END
+
+UNSAFE_ENTRY(void, Unsafe_FullFence(JNIEnv *env, jobject unsafe))
+ UnsafeWrapper("Unsafe_FullFence");
+ OrderAccess::fence();
+UNSAFE_END
+
////// Data in the C heap.
// Note: These do not throw NullPointerException for bad pointers.
@@ -1550,6 +1565,9 @@
{CC"putOrderedObject", CC"("OBJ"J"OBJ")V", FN_PTR(Unsafe_SetOrderedObject)},
{CC"putOrderedInt", CC"("OBJ"JI)V", FN_PTR(Unsafe_SetOrderedInt)},
{CC"putOrderedLong", CC"("OBJ"JJ)V", FN_PTR(Unsafe_SetOrderedLong)},
+ {CC"loadFence", CC"()V", FN_PTR(Unsafe_LoadFence)},
+ {CC"storeFence", CC"()V", FN_PTR(Unsafe_StoreFence)},
+ {CC"fullFence", CC"()V", FN_PTR(Unsafe_FullFence)},
{CC"park", CC"(ZJ)V", FN_PTR(Unsafe_Park)},
{CC"unpark", CC"("OBJ")V", FN_PTR(Unsafe_Unpark)}
--- a/hotspot/src/share/vm/runtime/arguments.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/runtime/arguments.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -1499,13 +1499,12 @@
Abstract_VM_Version::parallel_worker_threads());
}
- if (FLAG_IS_DEFAULT(MarkStackSize)) {
- FLAG_SET_DEFAULT(MarkStackSize, 128 * TASKQUEUE_SIZE);
- }
- if (PrintGCDetails && Verbose) {
- tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
- MarkStackSize / K, MarkStackSizeMax / K);
- tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
+ // MarkStackSize will be set (if it hasn't been set by the user)
+ // when concurrent marking is initialized.
+ // Its value will be based upon the number of parallel marking threads.
+ // But we do set the maximum mark stack size here.
+ if (FLAG_IS_DEFAULT(MarkStackSizeMax)) {
+ FLAG_SET_DEFAULT(MarkStackSizeMax, 128 * TASKQUEUE_SIZE);
}
if (FLAG_IS_DEFAULT(GCTimeRatio) || GCTimeRatio == 0) {
@@ -1517,6 +1516,12 @@
// is allocation). We might consider increase it further.
FLAG_SET_DEFAULT(GCTimeRatio, 9);
}
+
+ if (PrintGCDetails && Verbose) {
+ tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk",
+ MarkStackSize / K, MarkStackSizeMax / K);
+ tty->print_cr("ConcGCThreads: %u", ConcGCThreads);
+ }
}
void Arguments::set_heap_size() {
@@ -1980,6 +1985,9 @@
status = status && verify_min_value(ClassMetaspaceSize, 1*M,
"ClassMetaspaceSize");
+ status = status && verify_interval(MarkStackSizeMax,
+ 1, (max_jint - 1), "MarkStackSizeMax");
+
#ifdef SPARC
if (UseConcMarkSweepGC || UseG1GC) {
// Issue a stern warning if the user has explicitly set
--- a/hotspot/src/share/vm/runtime/globals.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/runtime/globals.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -922,6 +922,9 @@
develop(bool, PrintExceptionHandlers, false, \
"Print exception handler tables for all nmethods when generated") \
\
+ develop(bool, StressCompiledExceptionHandlers, false, \
+ "Exercise compiled exception handlers") \
+ \
develop(bool, InterceptOSException, false, \
"Starts debugger when an implicit OS (e.g., NULL) " \
"exception happens") \
--- a/hotspot/src/share/vm/runtime/os.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/runtime/os.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -255,6 +255,7 @@
static int vm_allocation_granularity();
static char* reserve_memory(size_t bytes, char* addr = 0,
size_t alignment_hint = 0);
+ static char* reserve_memory_aligned(size_t size, size_t alignment);
static char* attempt_reserve_memory_at(size_t bytes, char* addr);
static void split_reserved_memory(char *base, size_t size,
size_t split, bool realloc);
--- a/hotspot/src/share/vm/runtime/thread.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/runtime/thread.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -2190,7 +2190,7 @@
// BiasedLocking needs an updated RegisterMap for the revoke monitors pass
RegisterMap reg_map(this, UseBiasedLocking);
frame compiled_frame = f.sender(®_map);
- if (compiled_frame.can_be_deoptimized()) {
+ if (!StressCompiledExceptionHandlers && compiled_frame.can_be_deoptimized()) {
Deoptimization::deoptimize(this, compiled_frame, ®_map);
}
}
@@ -3527,11 +3527,12 @@
java_lang_Thread::set_thread_status(thread_object,
java_lang_Thread::RUNNABLE);
- // The VM preresolve methods to these classes. Make sure that get initialized
+ // The VM creates & returns objects of this class. Make sure it's initialized.
+ initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
+
+ // The VM preresolves methods to these classes. Make sure that they get initialized
initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK_0);
initialize_class(vmSymbols::java_lang_ref_Finalizer(), CHECK_0);
- // The VM creates & returns objects of this class. Make sure it's initialized.
- initialize_class(vmSymbols::java_lang_Class(), CHECK_0);
call_initializeSystemClass(CHECK_0);
// get the Java runtime name after java.lang.System is initialized
--- a/hotspot/src/share/vm/runtime/virtualspace.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -329,20 +329,9 @@
if ((((size_t)base + noaccess_prefix) & (alignment - 1)) != 0) {
// Base not aligned, retry
if (!os::release_memory(base, size)) fatal("os::release_memory failed");
- // Reserve size large enough to do manual alignment and
- // increase size to a multiple of the desired alignment
+ // Make sure that size is aligned
size = align_size_up(size, alignment);
- size_t extra_size = size + alignment;
- do {
- char* extra_base = os::reserve_memory(extra_size, NULL, alignment);
- if (extra_base == NULL) return;
- // Do manual alignement
- base = (char*) align_size_up((uintptr_t) extra_base, alignment);
- assert(base >= extra_base, "just checking");
- // Re-reserve the region at the aligned base address.
- os::release_memory(extra_base, extra_size);
- base = os::reserve_memory(size, base);
- } while (base == NULL);
+ base = os::reserve_memory_aligned(size, alignment);
if (requested_address != 0 &&
failed_to_reserve_as_requested(base, requested_address, size, false)) {
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Mon Dec 24 11:46:38 2012 -0800
@@ -355,8 +355,6 @@
nonstatic_field(Method, _access_flags, AccessFlags) \
nonstatic_field(Method, _vtable_index, int) \
nonstatic_field(Method, _method_size, u2) \
- nonstatic_field(Method, _max_locals, u2) \
- nonstatic_field(Method, _size_of_parameters, u2) \
nonstatic_field(Method, _interpreter_throwout_count, u2) \
nonstatic_field(Method, _number_of_breakpoints, u2) \
nonstatic_field(Method, _invocation_counter, InvocationCounter) \
@@ -378,6 +376,8 @@
nonstatic_field(ConstMethod, _signature_index, u2) \
nonstatic_field(ConstMethod, _method_idnum, u2) \
nonstatic_field(ConstMethod, _max_stack, u2) \
+ nonstatic_field(ConstMethod, _max_locals, u2) \
+ nonstatic_field(ConstMethod, _size_of_parameters, u2) \
nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \
volatile_nonstatic_field(Symbol, _refcount, int) \
--- a/hotspot/src/share/vm/services/memBaseline.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/services/memBaseline.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -334,7 +334,7 @@
// create a memory baseline
MemBaseline();
- virtual ~MemBaseline();
+ ~MemBaseline();
inline bool baselined() const {
return _baselined;
--- a/hotspot/src/share/vm/utilities/workgroup.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/utilities/workgroup.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -90,7 +90,7 @@
NOT_PRODUCT(_name = name);
_counter = 0;
}
- virtual ~AbstractGangTask() { }
+ ~AbstractGangTask() { }
public:
};
--- a/hotspot/src/share/vm/utilities/yieldingWorkgroup.hpp Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/src/share/vm/utilities/yieldingWorkgroup.hpp Mon Dec 24 11:46:38 2012 -0800
@@ -106,7 +106,7 @@
_status(INACTIVE),
_gang(NULL) { }
- virtual ~YieldingFlexibleGangTask() { }
+ ~YieldingFlexibleGangTask() { }
friend class YieldingFlexibleWorkGang;
friend class YieldingFlexibleGangWorker;
--- a/hotspot/test/compiler/7184394/TestAESBase.java Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/test/compiler/7184394/TestAESBase.java Mon Dec 24 11:46:38 2012 -0800
@@ -54,7 +54,6 @@
String paddingStr = "PKCS5Padding";
AlgorithmParameters algParams;
SecretKey key;
- int ivLen;
static int numThreads = 0;
int threadId;
@@ -68,7 +67,7 @@
public void prepare() {
try {
- System.out.println("\nmsgSize=" + msgSize + ", key size=" + keySize + ", reInit=" + !noReinit + ", checkOutput=" + checkOutput);
+ System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit + ", checkOutput=" + checkOutput);
int keyLenBytes = (keySize == 0 ? 16 : keySize/8);
byte keyBytes[] = new byte[keyLenBytes];
@@ -90,10 +89,14 @@
cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
- ivLen = (algorithm.equals("AES") ? 16 : algorithm.equals("DES") ? 8 : 0);
- IvParameterSpec initVector = new IvParameterSpec(new byte[ivLen]);
-
- cipher.init(Cipher.ENCRYPT_MODE, key, initVector);
+ if (mode.equals("CBC")) {
+ int ivLen = (algorithm.equals("AES") ? 16 : algorithm.equals("DES") ? 8 : 0);
+ IvParameterSpec initVector = new IvParameterSpec(new byte[ivLen]);
+ cipher.init(Cipher.ENCRYPT_MODE, key, initVector);
+ } else {
+ algParams = cipher.getParameters();
+ cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
+ }
algParams = cipher.getParameters();
dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
if (threadId == 0) {
--- a/hotspot/test/compiler/7184394/TestAESMain.java Thu Dec 20 10:22:19 2012 +0100
+++ b/hotspot/test/compiler/7184394/TestAESMain.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,8 @@
* @bug 7184394
* @summary add intrinsics to use AES instructions
*
- * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
+ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain
*
* @author Tom Deneau
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/8004741/Test8004741.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 Test8004741.java
+ * @bug 8004741
+ * @summary Missing compiled exception handle table entry for multidimensional array allocation
+ * @run main/othervm -Xmx64m -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:+StressCompiledExceptionHandlers Test8004741
+ *
+ */
+
+import java.util.*;
+
+public class Test8004741 extends Thread {
+
+ static int[][] test(int a, int b) throws Exception {
+ int[][] ar = null;
+ try {
+ ar = new int[a][b];
+ } catch (Error e) {
+ System.out.println("test got Error");
+ passed = true;
+ throw(e);
+ } catch (Exception e) {
+ System.out.println("test got Exception");
+ throw(e);
+ }
+ return ar;
+ }
+
+ static boolean passed = false;
+
+ public void run() {
+ System.out.println("test started");
+ try {
+ while(true) {
+ test(2,20000);
+ }
+ } catch (ThreadDeath e) {
+ System.out.println("test got ThreadDeath");
+ passed = true;
+ } catch (Error e) {
+ e.printStackTrace();
+ System.out.println("test got Error");
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.out.println("test got Exception");
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ for (int n = 0; n < 11000; n++) {
+ test(2, 20);
+ }
+
+ // First test exception catch
+ Test8004741 t = new Test8004741();
+
+ passed = false;
+ t.start();
+ Thread.sleep(1000);
+ t.stop();
+
+ Thread.sleep(5000);
+ t.join();
+ if (passed) {
+ System.out.println("PASSED");
+ } else {
+ System.out.println("FAILED");
+ System.exit(97);
+ }
+ }
+
+};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/8005033/Test8005033.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2012 SAP AG. 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 8005033
+ * @summary On sparcv9, C2's intrinsic for Integer.bitCount(OV) returns wrong result if OV is the result of an operation with int overflow.
+ * @run main/othervm -Xcomp -XX:CompileOnly=Test8005033::testBitCount Test8005033
+ * @author Richard Reingruber richard DOT reingruber AT sap DOT com
+ */
+
+public class Test8005033 {
+ public static int MINUS_ONE = -1;
+
+ public static void main(String[] args) {
+ System.out.println("EXECUTING test.");
+ Integer.bitCount(1); // load class
+ int expectedBitCount = 0;
+ int calculatedBitCount = testBitCount();
+ if (expectedBitCount != calculatedBitCount) {
+ throw new InternalError("got " + calculatedBitCount + " but expected " + expectedBitCount);
+ }
+ System.out.println("SUCCESSFULLY passed test.");
+ }
+
+ // testBitCount will be compiled using the Integer.bitCount() intrinsic if possible
+ private static int testBitCount() {
+ return Integer.bitCount(MINUS_ONE+1); // -1 + 1 => int overflow
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/sanity/ExecuteInternalVMTests.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 ExecuteInternalVMTests
+ * @bug 8004691
+ * @summary Add a jtreg test that exercises the ExecuteInternalVMTests flag
+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+ExecuteInternalVMTests ExecuteInternalVMTests
+ */
+public class ExecuteInternalVMTests {
+ public static void main(String[] args) throws Exception {
+ // The tests that are run are the HotSpot internal tests which are
+ // executed only when the flag -XX:+ExecuteInternalVMTests is used.
+
+ // The flag -XX:+ExecuteInternalVMTests can only be used for
+ // non-product builds of HotSpot. Therefore, the flag
+ // -XX:+IgnoreUnrecognizedVMOptions is also used, which means that this
+ // test will do nothing on a product build.
+ }
+}
--- a/jaxp/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/jaxp/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
5cf3c69a93d6d088a1cdfa28031d4f0f9438c0de jdk8-b65
e6af1ad464e3d9b1154b9f9ed9a5373b97d129fc jdk8-b66
83df3493ca3cf0be077f1d0dd90119456f266f54 jdk8-b67
+b854e70084214e9dcf1b37373f6e4b1a68760e03 jdk8-b68
--- a/jaxws/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/jaxws/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
fbe54291c9d337ea4dfef4d846f1d9a22f76249c jdk8-b65
3eb7f11cb4e000555c1b6f0f1a10fe2919633c8e jdk8-b66
eb06aa51dfc225614dba2d89ae7ca6cedddff982 jdk8-b67
+d3fe408f3a9ad250bc9a4e9365bdfc3f28c1d3f4 jdk8-b68
--- a/jdk/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
130d3a54d28becaac0846137256c2684adb34c33 jdk8-b65
4d337fae2250135729ee9ed2bf8baf3c60da5d6d jdk8-b66
ce9b02a3a17edd1983201002cfa0f364e4ab7524 jdk8-b67
+53fb43e4d614c92310e1fb00ec41d1960fd9facf jdk8-b68
--- a/jdk/make/com/sun/security/Makefile Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/com/sun/security/Makefile Mon Dec 24 11:46:38 2012 -0800
@@ -35,7 +35,7 @@
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = auth
-SUBDIRS_misc = jgss sasl auth/module
+SUBDIRS_misc = jgss sasl auth/module ntlm
include $(BUILDDIR)/common/Subdirs.gmk
all build clean clobber::
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/make/com/sun/security/ntlm/Makefile Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+BUILDDIR = ../../../..
+PACKAGE = com.sun.security.ntlm
+PRODUCT = sun
+include $(BUILDDIR)/common/Defs.gmk
+
+#
+# Files
+#
+AUTO_FILES_JAVA_DIRS = com/sun/security/ntlm
+
+#
+# Rules
+#
+include $(BUILDDIR)/common/Classes.gmk
--- a/jdk/make/java/security/Makefile Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/java/security/Makefile Mon Dec 24 11:46:38 2012 -0800
@@ -40,7 +40,8 @@
# Directories
#
-PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security
+# The default security properties file is for linux
+PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-linux
ifeq ($(PLATFORM), solaris)
PROPS_SRC = $(TOPDIR)/src/share/lib/security/java.security-solaris
--- a/jdk/make/sun/security/Makefile Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/sun/security/Makefile Mon Dec 24 11:46:38 2012 -0800
@@ -38,10 +38,12 @@
SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=true
include $(BUILDDIR)/common/Defs.gmk
-# build sun/security/jgss/wrapper on non-windows platform
+# build sun/security/jgss/wrapper on non-windows non-macosx platforms
JGSS_WRAPPER =
ifneq ($(PLATFORM), windows)
- JGSS_WRAPPER = jgss/wrapper
+ ifneq ($(PLATFORM), macosx)
+ JGSS_WRAPPER = jgss/wrapper
+ endif
endif
# Build PKCS#11 on all platforms
--- a/jdk/make/tools/src/build/tools/cldrconverter/Bundle.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/tools/src/build/tools/cldrconverter/Bundle.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,6 +29,7 @@
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -86,7 +87,23 @@
private final static String[] ERA_KEYS = {
"long.Eras",
"Eras",
- "short.Eras"
+ "narrow.Eras"
+ };
+
+ // Keys for individual time zone names
+ private final static String TZ_GEN_LONG_KEY = "timezone.displayname.generic.long";
+ private final static String TZ_GEN_SHORT_KEY = "timezone.displayname.generic.short";
+ private final static String TZ_STD_LONG_KEY = "timezone.displayname.standard.long";
+ private final static String TZ_STD_SHORT_KEY = "timezone.displayname.standard.short";
+ private final static String TZ_DST_LONG_KEY = "timezone.displayname.daylight.long";
+ private final static String TZ_DST_SHORT_KEY = "timezone.displayname.daylight.short";
+ private final static String[] ZONE_NAME_KEYS = {
+ TZ_STD_LONG_KEY,
+ TZ_STD_SHORT_KEY,
+ TZ_DST_LONG_KEY,
+ TZ_DST_SHORT_KEY,
+ TZ_GEN_LONG_KEY,
+ TZ_GEN_SHORT_KEY
};
private final String id;
@@ -98,6 +115,7 @@
return bundles.get(id);
}
+ @SuppressWarnings("ConvertToStringSwitch")
Bundle(String id, String cldrPath, String bundles, String currencies) {
this.id = id;
this.cldrPath = cldrPath;
@@ -242,9 +260,12 @@
// handle multiple inheritance for month and day names
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "MonthNames");
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "MonthAbbreviations");
+ handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "MonthNarrows");
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayNames");
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayAbbreviations");
+ handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "DayNarrows");
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "AmPmMarkers");
+ handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "narrow.AmPmMarkers");
adjustEraNames(myMap, calendarType);
@@ -253,6 +274,99 @@
handleDateTimeFormatPatterns(DATETIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "DateTimePatterns");
}
+ // if myMap has any empty timezone or metazone names, weed out them.
+ // Fill in any missing abbreviations if locale is "en".
+ for (Iterator<String> it = myMap.keySet().iterator(); it.hasNext();) {
+ String key = it.next();
+ if (key.startsWith(CLDRConverter.TIMEZONE_ID_PREFIX)
+ || key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
+ @SuppressWarnings("unchecked")
+ Map<String, String> nameMap = (Map<String, String>) myMap.get(key);
+ if (nameMap.isEmpty()) {
+ // Some zones have only exemplarCity, which become empty.
+ // Remove those from the map.
+ it.remove();
+ continue;
+ }
+
+ if (id.startsWith("en")) {
+ fillInAbbrs(key, nameMap);
+ }
+ }
+ }
+ for (Iterator<String> it = myMap.keySet().iterator(); it.hasNext();) {
+ String key = it.next();
+ if (key.startsWith(CLDRConverter.TIMEZONE_ID_PREFIX)
+ || key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
+ @SuppressWarnings("unchecked")
+ Map<String, String> nameMap = (Map<String, String>) myMap.get(key);
+ // Convert key/value pairs to an array.
+ String[] names = new String[ZONE_NAME_KEYS.length];
+ int ix = 0;
+ for (String nameKey : ZONE_NAME_KEYS) {
+ String name = nameMap.get(nameKey);
+ if (name == null) {
+ @SuppressWarnings("unchecked")
+ Map<String, String> parentNames = (Map<String, String>) parentsMap.get(key);
+ if (parentNames != null) {
+ name = parentNames.get(nameKey);
+ }
+ }
+ names[ix++] = name;
+ }
+ if (hasNulls(names)) {
+ String metaKey = toMetaZoneKey(key);
+ if (metaKey != null) {
+ Object obj = myMap.get(metaKey);
+ if (obj instanceof String[]) {
+ String[] metaNames = (String[]) obj;
+ for (int i = 0; i < names.length; i++) {
+ if (names[i] == null) {
+ names[i] = metaNames[i];
+ }
+ }
+ } else if (obj instanceof Map) {
+ @SuppressWarnings("unchecked")
+ Map<String, String> m = (Map<String, String>) obj;
+ for (int i = 0; i < names.length; i++) {
+ if (names[i] == null) {
+ names[i] = m.get(ZONE_NAME_KEYS[i]);
+ }
+ }
+ }
+ }
+ // If there are still any nulls, try filling in them from en data.
+ if (hasNulls(names) && !id.equals("en")) {
+ @SuppressWarnings("unchecked")
+ String[] enNames = (String[]) Bundle.getBundle("en").getTargetMap().get(key);
+ if (enNames == null) {
+ if (metaKey != null) {
+ @SuppressWarnings("unchecked")
+ String[] metaNames = (String[]) Bundle.getBundle("en").getTargetMap().get(metaKey);
+ enNames = metaNames;
+ }
+ }
+ if (enNames != null) {
+ for (int i = 0; i < names.length; i++) {
+ if (names[i] == null) {
+ names[i] = enNames[i];
+ }
+ }
+ }
+ // If there are still nulls, give up names.
+ if (hasNulls(names)) {
+ names = null;
+ }
+ }
+ }
+ // replace the Map with the array
+ if (names != null) {
+ myMap.put(key, names);
+ } else {
+ it.remove();
+ }
+ }
+ }
return myMap;
}
@@ -352,20 +466,10 @@
realKeys[index] = realKey;
eraNames[index++] = value;
}
- if (eraNames[0] != null) {
- if (eraNames[1] != null) {
- if (eraNames[2] == null) {
- // Eras -> short.Eras
- // long.Eras -> Eras
- map.put(realKeys[2], map.get(realKeys[1]));
- map.put(realKeys[1], map.get(realKeys[0]));
- }
- } else {
- // long.Eras -> Eras
- map.put(realKeys[1], map.get(realKeys[0]));
+ for (int i = 0; i < eraNames.length; i++) {
+ if (eraNames[i] == null) {
+ map.put(realKeys[i], null);
}
- // remove long.Eras
- map.remove(realKeys[0]);
}
}
@@ -473,6 +577,86 @@
return jrePattern.toString();
}
+ private String toMetaZoneKey(String tzKey) {
+ if (tzKey.startsWith(CLDRConverter.TIMEZONE_ID_PREFIX)) {
+ String tz = tzKey.substring(CLDRConverter.TIMEZONE_ID_PREFIX.length());
+ String meta = CLDRConverter.handlerMetaZones.get(tz);
+ if (meta != null) {
+ return CLDRConverter.METAZONE_ID_PREFIX + meta;
+ }
+ }
+ return null;
+ }
+
+ private void fillInAbbrs(String key, Map<String, String> map) {
+ fillInAbbrs(TZ_STD_LONG_KEY, TZ_STD_SHORT_KEY, map);
+ fillInAbbrs(TZ_DST_LONG_KEY, TZ_DST_SHORT_KEY, map);
+ fillInAbbrs(TZ_GEN_LONG_KEY, TZ_GEN_SHORT_KEY, map);
+
+ // If the standard std is "Standard Time" and daylight std is "Summer Time",
+ // replace the standard std with the generic std to avoid using
+ // the same abbrivation except for Australia time zone names.
+ String std = map.get(TZ_STD_SHORT_KEY);
+ String dst = map.get(TZ_DST_SHORT_KEY);
+ String gen = map.get(TZ_GEN_SHORT_KEY);
+ if (std != null) {
+ if (dst == null) {
+ // if dst is null, create long and short names from the standard
+ // std. ("Something Standard Time" to "Something Daylight Time",
+ // or "Something Time" to "Something Summer Time")
+ String name = map.get(TZ_STD_LONG_KEY);
+ if (name != null) {
+ if (name.contains("Standard Time")) {
+ name = name.replace("Standard Time", "Daylight Time");
+ } else if (name.endsWith("Mean Time")) {
+ name = name.replace("Mean Time", "Summer Time");
+ } else if (name.endsWith(" Time")) {
+ name = name.replace(" Time", " Summer Time");
+ }
+ map.put(TZ_DST_LONG_KEY, name);
+ fillInAbbrs(TZ_DST_LONG_KEY, TZ_DST_SHORT_KEY, map);
+ }
+ }
+ if (gen == null) {
+ String name = map.get(TZ_STD_LONG_KEY);
+ if (name != null) {
+ if (name.endsWith("Standard Time")) {
+ name = name.replace("Standard Time", "Time");
+ } else if (name.endsWith("Mean Time")) {
+ name = name.replace("Mean Time", "Time");
+ }
+ map.put(TZ_GEN_LONG_KEY, name);
+ fillInAbbrs(TZ_GEN_LONG_KEY, TZ_GEN_SHORT_KEY, map);
+ }
+ }
+ }
+ }
+
+ private void fillInAbbrs(String longKey, String shortKey, Map<String, String> map) {
+ String abbr = map.get(shortKey);
+ if (abbr == null) {
+ String name = map.get(longKey);
+ if (name != null) {
+ abbr = toAbbr(name);
+ if (abbr != null) {
+ map.put(shortKey, abbr);
+ }
+ }
+ }
+ }
+
+ private String toAbbr(String name) {
+ String[] substrs = name.split("\\s+");
+ StringBuilder sb = new StringBuilder();
+ for (String s : substrs) {
+ char c = s.charAt(0);
+ if (c >= 'A' && c <= 'Z') {
+ sb.append(c);
+ }
+ }
+ return sb.length() > 0 ? sb.toString() : null;
+ }
+
private void convert(CalendarType calendarType, char cldrLetter, int count, StringBuilder sb) {
switch (cldrLetter) {
case 'G':
@@ -539,4 +723,13 @@
sb.append(c);
}
}
+
+ private static boolean hasNulls(Object[] array) {
+ for (int i = 0; i < array.length; i++) {
+ if (array[i] == null) {
+ return true;
+ }
+ }
+ return false;
+ }
}
--- a/jdk/make/tools/src/build/tools/cldrconverter/BundleGenerator.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/tools/src/build/tools/cldrconverter/BundleGenerator.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,8 +30,27 @@
import java.util.SortedSet;
public interface BundleGenerator {
+ static enum BundleType {
+ PLAIN("java.util.ListResourceBundle"),
+ OPEN("sun.util.resources.OpenListResourceBundle"),
+ TIMEZONE("sun.util.resources.TimeZoneNamesBundle");
+
+ private final String pathName, className;
+ private BundleType(String name) {
+ pathName = name;
+ int x = name.lastIndexOf('.');
+ className = name.substring(x + 1);
+ }
+ String getPathName() {
+ return pathName;
+ }
+ String getClassName() {
+ return className;
+ }
+ };
+
public void generateBundle(String packageName, String baseName, String localeID,
- boolean useJava, Map<String, ?> map, boolean open) throws IOException;
+ boolean useJava, Map<String, ?> map, BundleType type) throws IOException;
public void generateMetaInfo(Map<String, SortedSet<String>> metaInfo) throws IOException;
}
--- a/jdk/make/tools/src/build/tools/cldrconverter/CLDRConverter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/tools/src/build/tools/cldrconverter/CLDRConverter.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,7 @@
package build.tools.cldrconverter;
+import build.tools.cldrconverter.BundleGenerator.BundleType;
import java.io.File;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystems;
@@ -58,9 +59,8 @@
static final String CURRENCY_SYMBOL_PREFIX = "currency.symbol.";
static final String CURRENCY_NAME_PREFIX = "currency.displayname.";
static final String TIMEZONE_ID_PREFIX = "timezone.id.";
- static final String TIMEZONE_NAME_PREFIX = "timezone.displayname.";
+ static final String ZONE_NAME_PREFIX = "timezone.displayname.";
static final String METAZONE_ID_PREFIX = "metazone.id.";
- static final String METAZONE_NAME_PREFIX = "metazone.displayname.";
private static SupplementDataParseHandler handlerSuppl;
static NumberingSystemsParseHandler handlerNumbering;
@@ -236,7 +236,14 @@
if (sb.indexOf("root") == -1) {
sb.append("root");
}
- retList.add(new Bundle(id, sb.toString(), null, null));
+ Bundle b = new Bundle(id, sb.toString(), null, null);
+ // Insert the bundle for en at the top so that it will get
+ // processed first.
+ if ("en".equals(id)) {
+ retList.add(0, b);
+ } else {
+ retList.add(b);
+ }
}
}
}
@@ -312,6 +319,7 @@
Map<String, SortedSet<String>> metaInfo = new HashMap<>();
metaInfo.put("LocaleNames", new TreeSet<String>());
metaInfo.put("CurrencyNames", new TreeSet<String>());
+ metaInfo.put("TimeZoneNames", new TreeSet<String>());
metaInfo.put("CalendarData", new TreeSet<String>());
metaInfo.put("FormatData", new TreeSet<String>());
@@ -348,24 +356,28 @@
Map<String, Object> localeNamesMap = extractLocaleNames(targetMap, bundle.getID());
if (!localeNamesMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("LocaleNames").add(toLanguageTag(bundle.getID()));
- bundleGenerator.generateBundle("util", "LocaleNames", bundle.getID(), true, localeNamesMap, true);
+ bundleGenerator.generateBundle("util", "LocaleNames", bundle.getID(), true, localeNamesMap, BundleType.OPEN);
}
}
if (bundleTypes.contains(Bundle.Type.CURRENCYNAMES)) {
Map<String, Object> currencyNamesMap = extractCurrencyNames(targetMap, bundle.getID(), bundle.getCurrencies());
if (!currencyNamesMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("CurrencyNames").add(toLanguageTag(bundle.getID()));
- bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getID(), true, currencyNamesMap, true);
+ bundleGenerator.generateBundle("util", "CurrencyNames", bundle.getID(), true, currencyNamesMap, BundleType.OPEN);
}
}
if (bundleTypes.contains(Bundle.Type.TIMEZONENAMES)) {
Map<String, Object> zoneNamesMap = extractZoneNames(targetMap, bundle.getID());
+ if (!zoneNamesMap.isEmpty() || bundle.isRoot()) {
+ metaInfo.get("TimeZoneNames").add(toLanguageTag(bundle.getID()));
+ bundleGenerator.generateBundle("util", "TimeZoneNames", bundle.getID(), true, zoneNamesMap, BundleType.TIMEZONE);
+ }
}
if (bundleTypes.contains(Bundle.Type.CALENDARDATA)) {
Map<String, Object> calendarDataMap = extractCalendarData(targetMap, bundle.getID());
if (!calendarDataMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("CalendarData").add(toLanguageTag(bundle.getID()));
- bundleGenerator.generateBundle("util", "CalendarData", bundle.getID(), true, calendarDataMap, false);
+ bundleGenerator.generateBundle("util", "CalendarData", bundle.getID(), true, calendarDataMap, BundleType.PLAIN);
}
}
if (bundleTypes.contains(Bundle.Type.FORMATDATA)) {
@@ -373,9 +385,10 @@
// LocaleData.getAvailableLocales depends on having FormatData bundles around
if (!formatDataMap.isEmpty() || bundle.isRoot()) {
metaInfo.get("FormatData").add(toLanguageTag(bundle.getID()));
- bundleGenerator.generateBundle("text", "FormatData", bundle.getID(), true, formatDataMap, false);
+ bundleGenerator.generateBundle("text", "FormatData", bundle.getID(), true, formatDataMap, BundleType.PLAIN);
}
}
+
// For testing
SortedSet<String> allLocales = new TreeSet<>();
allLocales.addAll(metaInfo.get("CurrencyNames"));
@@ -431,6 +444,7 @@
private KeyComparator() {
}
+ @Override
public int compare(String o1, String o2) {
int len1 = o1.length();
int len2 = o2.length();
@@ -476,7 +490,26 @@
}
private static Map<String, Object> extractZoneNames(Map<String, Object> map, String id) {
- return null;
+ Map<String, Object> names = new HashMap<>();
+ for (String tzid : handlerMetaZones.keySet()) {
+ String tzKey = TIMEZONE_ID_PREFIX + tzid;
+ Object data = map.get(tzKey);
+ if (data instanceof String[]) {
+ names.put(tzid, data);
+ } else {
+ String meta = handlerMetaZones.get(tzid);
+ if (meta != null) {
+ String metaKey = METAZONE_ID_PREFIX + meta;
+ data = map.get(metaKey);
+ if (data instanceof String[]) {
+ // Keep the metazone prefix here.
+ names.put(metaKey, data);
+ names.put(tzid, meta);
+ }
+ }
+ }
+ }
+ return names;
}
private static Map<String, Object> extractCalendarData(Map<String, Object> map, String id) {
@@ -494,11 +527,19 @@
copyIfPresent(map, prefix + "standalone.MonthNames", formatData);
copyIfPresent(map, prefix + "MonthAbbreviations", formatData);
copyIfPresent(map, prefix + "standalone.MonthAbbreviations", formatData);
+ copyIfPresent(map, prefix + "MonthNarrow", formatData);
+ copyIfPresent(map, prefix + "standalone.MonthNarrows", formatData);
copyIfPresent(map, prefix + "DayNames", formatData);
+ copyIfPresent(map, prefix + "standalone.DayNames", formatData);
copyIfPresent(map, prefix + "DayAbbreviations", formatData);
+ copyIfPresent(map, prefix + "standalone.DayAbbreviations", formatData);
+ copyIfPresent(map, prefix + "DayNarrows", formatData);
+ copyIfPresent(map, prefix + "standalone.DayNarrows", formatData);
copyIfPresent(map, prefix + "AmPmMarkers", formatData);
+ copyIfPresent(map, prefix + "narrow.AmPmMarkers", formatData);
+ copyIfPresent(map, prefix + "long.Eras", formatData);
copyIfPresent(map, prefix + "Eras", formatData);
- copyIfPresent(map, prefix + "short.Eras", formatData);
+ copyIfPresent(map, prefix + "narrow.Eras", formatData);
copyIfPresent(map, prefix + "TimePatterns", formatData);
copyIfPresent(map, prefix + "DatePatterns", formatData);
copyIfPresent(map, prefix + "DateTimePatterns", formatData);
@@ -560,7 +601,6 @@
if (x == 0 || escapeSpace) {
outBuffer.append('\\');
}
-
outBuffer.append(' ');
break;
case '\\':
@@ -584,7 +624,7 @@
outBuffer.append('f');
break;
default:
- if (!USE_UTF8 && ((aChar < 0x0020) || (aChar > 0x007e))) {
+ if (aChar < 0x0020 || (!USE_UTF8 && aChar > 0x007e)) {
formatter.format("\\u%04x", (int)aChar);
} else {
if (specialSaveChars.indexOf(aChar) != -1) {
--- a/jdk/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/tools/src/build/tools/cldrconverter/LDMLParseHandler.java Mon Dec 24 11:46:38 2012 -0800
@@ -155,6 +155,9 @@
case "abbreviated":
pushStringArrayEntry(qName, attributes, prefix + "MonthAbbreviations/" + getContainerKey(), 13);
break;
+ case "narrow":
+ pushStringArrayEntry(qName, attributes, prefix + "MonthNarrows/" + getContainerKey(), 13);
+ break;
default:
pushIgnoredContainer(qName);
break;
@@ -191,6 +194,9 @@
case "abbreviated":
pushStringArrayEntry(qName, attributes, prefix + "DayAbbreviations/" + getContainerKey(), 7);
break;
+ case "narrow":
+ pushStringArrayEntry(qName, attributes, prefix + "DayNarrows/" + getContainerKey(), 7);
+ break;
default:
pushIgnoredContainer(qName);
break;
@@ -219,25 +225,36 @@
case "dayPeriodWidth":
// for FormatData
// create string array entry for am/pm. only keeping wide
- if ("wide".equals(attributes.getValue("type"))) {
+ switch (attributes.getValue("type")) {
+ case "wide":
pushStringArrayEntry(qName, attributes, "AmPmMarkers/" + getContainerKey(), 2);
- } else {
+ break;
+ case "narrow":
+ pushStringArrayEntry(qName, attributes, "narrow.AmPmMarkers/" + getContainerKey(), 2);
+ break;
+ default:
pushIgnoredContainer(qName);
+ break;
}
break;
case "dayPeriod":
// for FormatData
// add to string array entry of AmPmMarkers element
- switch (attributes.getValue("type")) {
- case "am":
- pushStringArrayElement(qName, attributes, 0);
- break;
- case "pm":
- pushStringArrayElement(qName, attributes, 1);
- break;
- default:
+ if (attributes.getValue("alt") == null) {
+ switch (attributes.getValue("type")) {
+ case "am":
+ pushStringArrayElement(qName, attributes, 0);
+ break;
+ case "pm":
+ pushStringArrayElement(qName, attributes, 1);
+ break;
+ default:
+ pushIgnoredContainer(qName);
+ break;
+ }
+ } else {
+ // discard alt values
pushIgnoredContainer(qName);
- break;
}
break;
case "eraNames":
@@ -269,7 +286,7 @@
assert currentContainer instanceof IgnoredContainer;
pushIgnoredContainer(qName);
} else {
- String key = currentCalendarType.keyElementName() + "short.Eras";
+ String key = currentCalendarType.keyElementName() + "narrow.Eras";
pushStringArrayEntry(qName, attributes, key, currentCalendarType.getEraLength(qName));
}
break;
@@ -301,15 +318,15 @@
break;
case "zone":
{
- String zone = attributes.getValue("type");
+ String tzid = attributes.getValue("type"); // Olson tz id
zonePrefix = CLDRConverter.TIMEZONE_ID_PREFIX;
- put(zonePrefix + zone, new HashMap<String, String>());
- pushKeyContainer(qName, attributes, zone);
+ put(zonePrefix + tzid, new HashMap<String, String>());
+ pushKeyContainer(qName, attributes, tzid);
}
break;
case "metazone":
{
- String zone = attributes.getValue("type");
+ String zone = attributes.getValue("type"); // LDML meta zone id
zonePrefix = CLDRConverter.METAZONE_ID_PREFIX;
put(zonePrefix + zone, new HashMap<String, String>());
pushKeyContainer(qName, attributes, zone);
@@ -323,16 +340,12 @@
zoneNameStyle = "short";
pushContainer(qName, attributes);
break;
- case "generic": // not used in JDK
- pushIgnoredContainer(qName);
+ case "generic": // generic name
+ case "standard": // standard time name
+ case "daylight": // daylight saving (summer) time name
+ pushStringEntry(qName, attributes, CLDRConverter.ZONE_NAME_PREFIX + qName + "." + zoneNameStyle);
break;
- case "standard": // standard time
- pushStringEntry(qName, attributes, CLDRConverter.TIMEZONE_NAME_PREFIX + "standard." + zoneNameStyle);
- break;
- case "daylight":
- pushStringEntry(qName, attributes, CLDRConverter.TIMEZONE_NAME_PREFIX + "daylight." + zoneNameStyle);
- break;
- case "exemplarCity":
+ case "exemplarCity": // not used in JDK
pushIgnoredContainer(qName);
break;
@@ -530,6 +543,7 @@
case "timeZoneNames":
zonePrefix = null;
break;
+ case "generic":
case "standard":
case "daylight":
if (zonePrefix != null && (currentContainer instanceof Entry)) {
--- a/jdk/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/tools/src/build/tools/cldrconverter/MetaZonesParseHandler.java Mon Dec 24 11:46:38 2012 -0800
@@ -46,8 +46,9 @@
return null;
}
+ // metaZone: ID -> metazone
+ // per locale: ID -> names, metazone -> names
@Override
- @SuppressWarnings("fallthrough")
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
switch (qName) {
case "timezone":
--- a/jdk/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/make/tools/src/build/tools/cldrconverter/ResourceBundleGenerator.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,14 +28,16 @@
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
+import java.util.Formatter;
+import java.util.HashSet;
import java.util.Map;
+import java.util.Set;
import java.util.SortedSet;
class ResourceBundleGenerator implements BundleGenerator {
-
@Override
public void generateBundle(String packageName, String baseName, String localeID, boolean useJava,
- Map<String, ?> map, boolean open) throws IOException {
+ Map<String, ?> map, BundleType type) throws IOException {
String suffix = useJava ? ".java" : ".properties";
String lang = CLDRConverter.getLanguageCode(localeID);
String dirName = CLDRConverter.DESTINATION_DIR + File.separator + "sun" + File.separator
@@ -67,6 +69,28 @@
encoding = "iso-8859-1";
}
+ Formatter fmt = null;
+ if (type == BundleType.TIMEZONE) {
+ fmt = new Formatter();
+ Set<String> metaKeys = new HashSet<>();
+ for (String key : map.keySet()) {
+ if (key.startsWith(CLDRConverter.METAZONE_ID_PREFIX)) {
+ String meta = key.substring(CLDRConverter.METAZONE_ID_PREFIX.length());
+ String[] value;
+ value = (String[]) map.get(key);
+ fmt.format(" final String[] %s = new String[] {\n", meta);
+ for (String s : value) {
+ fmt.format(" \"%s\",\n", CLDRConverter.saveConvert(s, useJava));
+ }
+ fmt.format(" };\n");
+ metaKeys.add(key);
+ }
+ }
+ for (String key : metaKeys) {
+ map.remove(key);
+ }
+ }
+
try (PrintWriter out = new PrintWriter(file, encoding)) {
// Output copyright headers
out.println(CopyrightHeaders.getOpenJDKCopyright());
@@ -74,16 +98,15 @@
if (useJava) {
out.println("package sun." + packageName + ";\n");
- if (open) {
- out.println("import sun.util.resources.OpenListResourceBundle;\n");
- out.println("public class " + baseName + ("root".equals(localeID) ? "" : "_" + localeID) + " extends OpenListResourceBundle {");
- } else {
- out.println("import java.util.ListResourceBundle;\n");
- out.println("public class " + baseName + ("root".equals(localeID) ? "" : "_" + localeID) + " extends ListResourceBundle {");
+ out.printf("import %s;\n\n", type.getPathName());
+ out.printf("public class %s%s extends %s {\n", baseName, "root".equals(localeID) ? "" : "_" + localeID, type.getClassName());
+
+ out.println(" @Override\n" +
+ " protected final Object[][] getContents() {");
+ if (fmt != null) {
+ out.print(fmt.toString());
}
- out.println(" @Override\n" +
- " protected final Object[][] getContents() {\n" +
- " final Object[][] data = new Object[][] {");
+ out.println(" final Object[][] data = new Object[][] {");
}
for (String key : map.keySet()) {
if (useJava) {
@@ -91,7 +114,11 @@
if (value == null) {
CLDRConverter.warning("null value for " + key);
} else if (value instanceof String) {
- out.println(" { \"" + key + "\", \"" + CLDRConverter.saveConvert((String) value, useJava) + "\" },");
+ if (type == BundleType.TIMEZONE) {
+ out.printf(" { \"%s\", %s },\n", key, CLDRConverter.saveConvert((String) value, useJava));
+ } else {
+ out.printf(" { \"%s\", \"%s\" },\n", key, CLDRConverter.saveConvert((String) value, useJava));
+ }
} else if (value instanceof String[]) {
String[] values = (String[]) value;
out.println(" { \"" + key + "\",\n new String[] {");
--- a/jdk/makefiles/CompileNativeLibraries.gmk Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/makefiles/CompileNativeLibraries.gmk Mon Dec 24 11:46:38 2012 -0800
@@ -2540,6 +2540,7 @@
##########################################################################################
ifneq ($(OPENJDK_TARGET_OS), windows)
+ifneq ($(OPENJDK_TARGET_OS), macosx)
$(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS,\
LIBRARY:=j2gss,\
OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
@@ -2559,6 +2560,7 @@
BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
endif
+endif
##########################################################################################
--- a/jdk/makefiles/CopyFiles.gmk Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/makefiles/CopyFiles.gmk Mon Dec 24 11:46:38 2012 -0800
@@ -356,21 +356,9 @@
##########################################################################################
-PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security
+PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-$(OPENJDK_TARGET_OS)
PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
-ifeq ($(OPENJDK_TARGET_OS), solaris)
- PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-solaris
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
- PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-windows
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), macosx)
- PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-macosx
-endif
-
$(PROPS_DST): $(PROPS_SRC)
$(MKDIR) -p $(@D)
$(RM) $@
--- a/jdk/makefiles/CreateJars.gmk Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/makefiles/CreateJars.gmk Mon Dec 24 11:46:38 2012 -0800
@@ -810,9 +810,8 @@
$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(IMAGES_OUTPUTDIR)/lib/rt.jar
$(RM) -r $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
- $(JAVA) \
- -Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
- $(JAVAC_JARS) \
+ $(JAVA) $(JAVAC_JARS) \
+ -bootclasspath $(JDK_OUTPUTDIR)/classes \
-XDprocess.packages -proc:only \
-processor com.sun.tools.javac.sym.CreateSymbols \
-Acom.sun.tools.javac.sym.Jar=$(IMAGES_OUTPUTDIR)/lib/rt.jar \
--- a/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/LWToolkit.java Mon Dec 24 11:46:38 2012 -0800
@@ -210,9 +210,9 @@
* and DialogPeer interfaces.
*/
private LWWindowPeer createDelegatedPeer(Window target, PlatformComponent platformComponent,
- PlatformWindow platformWindow)
+ PlatformWindow platformWindow, LWWindowPeer.PeerType peerType)
{
- LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow);
+ LWWindowPeer peer = new LWWindowPeer(target, platformComponent, platformWindow, peerType);
targetCreatedPeer(target, peer);
peer.initialize();
return peer;
@@ -222,22 +222,29 @@
public WindowPeer createWindow(Window target) {
PlatformComponent platformComponent = createPlatformComponent();
PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.SIMPLEWINDOW);
- return createDelegatedPeer(target, platformComponent, platformWindow);
+ return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.SIMPLEWINDOW);
}
@Override
public FramePeer createFrame(Frame target) {
PlatformComponent platformComponent = createPlatformComponent();
PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.FRAME);
- return createDelegatedPeer(target, platformComponent, platformWindow);
+ return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.FRAME);
}
public LWWindowPeer createEmbeddedFrame(CEmbeddedFrame target) {
PlatformComponent platformComponent = createPlatformComponent();
- PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.EMBEDDEDFRAME);
- return createDelegatedPeer(target, platformComponent, platformWindow);
+ PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.EMBEDDED_FRAME);
+ return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.EMBEDDED_FRAME);
}
+ public LWWindowPeer createEmbeddedFrame(CViewEmbeddedFrame target) {
+ PlatformComponent platformComponent = createPlatformComponent();
+ PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.VIEW_EMBEDDED_FRAME);
+ return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.VIEW_EMBEDDED_FRAME);
+ }
+
+
CPrinterDialogPeer createCPrinterDialog(CPrinterDialog target) {
PlatformComponent platformComponent = createPlatformComponent();
PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
@@ -254,7 +261,7 @@
PlatformComponent platformComponent = createPlatformComponent();
PlatformWindow platformWindow = createPlatformWindow(LWWindowPeer.PeerType.DIALOG);
- return createDelegatedPeer(target, platformComponent, platformWindow);
+ return createDelegatedPeer(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
}
@Override
--- a/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/LWWindowPeer.java Mon Dec 24 11:46:38 2012 -0800
@@ -47,7 +47,8 @@
SIMPLEWINDOW,
FRAME,
DIALOG,
- EMBEDDEDFRAME
+ EMBEDDED_FRAME,
+ VIEW_EMBEDDED_FRAME
}
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.lwawt.focus.LWWindowPeer");
@@ -108,6 +109,8 @@
private volatile boolean textured;
+ private final PeerType peerType;
+
/**
* Current modal blocker or null.
*
@@ -116,10 +119,11 @@
private LWWindowPeer blocker;
public LWWindowPeer(Window target, PlatformComponent platformComponent,
- PlatformWindow platformWindow)
+ PlatformWindow platformWindow, PeerType peerType)
{
super(target, platformComponent);
this.platformWindow = platformWindow;
+ this.peerType = peerType;
Window owner = target.getOwner();
LWWindowPeer ownerPeer = (owner != null) ? (LWWindowPeer)owner.getPeer() : null;
@@ -275,6 +279,11 @@
@Override
public void setBounds(int x, int y, int w, int h, int op) {
+
+ if((op & NO_EMBEDDED_CHECK) == 0 && getPeerType() == PeerType.VIEW_EMBEDDED_FRAME) {
+ return;
+ }
+
if ((op & SET_CLIENT_SIZE) != 0) {
// SET_CLIENT_SIZE is only applicable to window peers, so handle it here
// instead of pulling 'insets' field up to LWComponentPeer
@@ -1210,6 +1219,10 @@
return this == grabbingWindow;
}
+ public PeerType getPeerType() {
+ return peerType;
+ }
+
@Override
public String toString() {
return super.toString() + " [target is " + getTarget() + "]";
--- a/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/PlatformWindow.java Mon Dec 24 11:46:38 2012 -0800
@@ -151,4 +151,6 @@
public long getLayerPtr();
public LWWindowPeer getPeer();
+
+ public boolean isUnderMouse();
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CMouseInfoPeer.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,7 +26,6 @@
package sun.lwawt.macosx;
import java.awt.Window;
-
import sun.lwawt.LWMouseInfoPeer;
import sun.lwawt.LWWindowPeer;
@@ -41,10 +40,6 @@
return false;
}
- LWWindowPeer peer = (LWWindowPeer)w.getPeer();
- CPlatformWindow platformWindow = (CPlatformWindow)peer.getPlatformWindow();
- return nativeIsWindowUnderMouse(platformWindow.getNSWindowPtr());
+ return ((LWWindowPeer)w.getPeer()).getPlatformWindow().isUnderMouse();
}
-
- private static native boolean nativeIsWindowUnderMouse(long ptr);
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformEmbeddedFrame.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,16 +25,13 @@
package sun.lwawt.macosx;
-import sun.lwawt.PlatformWindow;
-import sun.lwawt.LWWindowPeer;
-
-import sun.java2d.opengl.CGLLayer;
+import java.awt.*;
+import sun.awt.CausedFocusEvent;
import sun.java2d.SurfaceData;
-
-import sun.awt.CausedFocusEvent;
-
-import java.awt.*;
-
+import sun.java2d.opengl.CGLLayer;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.LWWindowPeer.PeerType;
+import sun.lwawt.PlatformWindow;
import sun.util.logging.PlatformLogger;
/*
@@ -134,6 +131,7 @@
// This method should be properly implemented for applets.
// It returns null just as a stub.
+ @Override
public PlatformWindow getTopmostPlatformWindowUnderMouse() { return null; }
@Override
@@ -192,4 +190,13 @@
@Override
public void setModalBlocked(boolean blocked) {}
+
+ /*
+ * The method could not be implemented due to CALayer restrictions.
+ * The exeption enforce clients not to use it.
+ */
+ @Override
+ public boolean isUnderMouse() {
+ throw new RuntimeException("Not implemented");
+ }
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,8 +26,11 @@
package sun.lwawt.macosx;
import java.awt.*;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.VolatileImage;
import sun.awt.CGraphicsConfig;
+import sun.awt.CGraphicsEnvironment;
import sun.lwawt.LWWindowPeer;
import sun.lwawt.macosx.event.NSEvent;
@@ -37,6 +40,10 @@
public class CPlatformView extends CFRetainedResource {
private native long nativeCreateView(int x, int y, int width, int height, long windowLayerPtr);
+ private static native void nativeSetAutoResizable(long awtView, boolean toResize);
+ private static native int nativeGetNSViewDisplayID(long awtView);
+ private static native Rectangle2D nativeGetLocationOnScreen(long awtView);
+ private static native boolean nativeIsViewUnderMouse(long ptr);
private LWWindowPeer peer;
private SurfaceData surfaceData;
@@ -59,7 +66,7 @@
public long getAWTView() {
return ptr;
- }
+ }
public boolean isOpaque() {
return !peer.isTranslucent();
@@ -158,10 +165,46 @@
}
}
+ public void setAutoResizable(boolean toResize) {
+ nativeSetAutoResizable(this.getAWTView(), toResize);
+ }
+
+ public boolean isUnderMouse() {
+ return nativeIsViewUnderMouse(getAWTView());
+ }
+
+ public GraphicsDevice getGraphicsDevice() {
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
+ int displayID = nativeGetNSViewDisplayID(getAWTView());
+ GraphicsDevice gd = cge.getScreenDevice(displayID);
+ if (gd == null) {
+ // this could possibly happen during device removal
+ // use the default screen device in this case
+ gd = ge.getDefaultScreenDevice();
+ }
+ return gd;
+ }
+
+ public Point getLocationOnScreen() {
+ Rectangle r = nativeGetLocationOnScreen(this.getAWTView()).getBounds();
+ return new Point(r.x, r.y);
+ }
+
// ----------------------------------------------------------------------
// NATIVE CALLBACKS
// ----------------------------------------------------------------------
+ /*
+ * The callback is called only in the embedded case when the view is
+ * automatically resized by the superview.
+ * In normal mode this method is never called.
+ */
+ private void deliverResize(int x, int y, int w, int h) {
+ peer.notifyReshape(x, y, w, h);
+ }
+
+
private void deliverMouseEvent(NSEvent event) {
int x = event.getX();
int y = getBounds().height - event.getY();
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java Mon Dec 24 11:46:38 2012 -0800
@@ -64,8 +64,6 @@
private static native void nativeDispose(long nsWindowPtr);
private static native CPlatformWindow nativeGetTopmostPlatformWindowUnderMouse();
- private static native int nativeGetNSWindowDisplayID(long nsWindowPtr);
-
// Loger to report issues happened during execution but that do not affect functionality
private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
private static final PlatformLogger focusLogger = PlatformLogger.getLogger("sun.lwawt.macosx.focus.CPlatformWindow");
@@ -211,9 +209,8 @@
private CPlatformResponder responder;
private volatile boolean zoomed = false; // from native perspective
- public CPlatformWindow(final PeerType peerType) {
+ public CPlatformWindow() {
super(0, true);
- assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
}
/*
@@ -429,16 +426,7 @@
@Override
public GraphicsDevice getGraphicsDevice() {
- GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
- CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
- int displayID = nativeGetNSWindowDisplayID(getNSWindowPtr());
- GraphicsDevice gd = cge.getScreenDevice(displayID);
- if (gd == null) {
- // this could possibly happen during device removal
- // use the default screen device in this case
- gd = ge.getDefaultScreenDevice();
- }
- return gd;
+ return contentView.getGraphicsDevice();
}
@Override // PlatformWindow
@@ -833,6 +821,11 @@
return peer;
}
+ @Override
+ public boolean isUnderMouse() {
+ return contentView.isUnderMouse();
+ }
+
public CPlatformView getContentView() {
return contentView;
}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPrinterDialogPeer.java Mon Dec 24 11:46:38 2012 -0800
@@ -41,7 +41,7 @@
public CPrinterDialogPeer(CPrinterDialog target, PlatformComponent platformComponent,
PlatformWindow platformWindow)
{
- super(target, platformComponent, platformWindow);
+ super(target, platformComponent, platformWindow, LWWindowPeer.PeerType.DIALOG);
//super(target);
fTarget = target;
super.initialize();
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewEmbeddedFrame.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package sun.lwawt.macosx;
+
+import java.awt.AWTKeyStroke;
+import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
+import sun.awt.EmbeddedFrame;
+import sun.lwawt.LWToolkit;
+import sun.lwawt.LWWindowPeer;
+/*
+ * The CViewEmbeddedFrame class is used in the SWT_AWT bridge.
+ * This is a part of public API and should not be renamed or moved
+ */
+public class CViewEmbeddedFrame extends EmbeddedFrame {
+
+ private final long nsViewPtr;
+
+ private boolean isActive = false;
+
+ public CViewEmbeddedFrame(long nsViewPtr) {
+ this.nsViewPtr = nsViewPtr;
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void addNotify() {
+ if (getPeer() == null) {
+ LWToolkit toolkit = (LWToolkit) Toolkit.getDefaultToolkit();
+ setPeer(toolkit.createEmbeddedFrame(this));
+ }
+ super.addNotify();
+ }
+
+ public long getEmbedderHandle() {
+ return nsViewPtr;
+ }
+
+ @Override
+ public void registerAccelerator(AWTKeyStroke awtks) {
+ }
+
+ @Override
+ public void unregisterAccelerator(AWTKeyStroke awtks) {
+ }
+
+ public boolean isParentWindowActive() {
+ return isActive;
+ }
+
+ /*
+ * Synthetic event delivery for focus management
+ */
+ @Override
+ public void synthesizeWindowActivation(boolean activated) {
+ if (isActive != activated) {
+ isActive = activated;
+ ((LWWindowPeer)getPeer()).notifyActivation(activated, null);
+ }
+ }
+
+ /*
+ * Initializes the embedded frame bounds and validates a component.
+ * Designed to be called from the main thread
+ * This method should be called once from the initialization of the SWT_AWT Bridge
+ */
+ @SuppressWarnings("deprecation")
+ public void validateWithBounds(final int x, final int y, final int width, final int height) {
+ try {
+ LWCToolkit.invokeAndWait(new Runnable() {
+ @Override
+ public void run() {
+ ((LWWindowPeer) getPeer()).setBoundsPrivate(0, 0, width, height);
+ validate();
+ setVisible(true);
+ }
+ }, null);
+ } catch (InterruptedException | InvocationTargetException ex) {}
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CViewPlatformEmbeddedFrame.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package sun.lwawt.macosx;
+
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GraphicsDevice;
+import java.awt.Insets;
+import java.awt.MenuBar;
+import java.awt.Point;
+import java.awt.Window;
+import sun.awt.CausedFocusEvent.Cause;
+import sun.java2d.SurfaceData;
+import sun.lwawt.LWWindowPeer;
+import sun.lwawt.PlatformWindow;
+
+public class CViewPlatformEmbeddedFrame implements PlatformWindow {
+
+ private CPlatformView view;
+ private LWWindowPeer peer;
+ private CViewEmbeddedFrame target;
+ private CPlatformResponder responder;
+
+ @Override // PlatformWindow
+ public void initialize(Window target, final LWWindowPeer peer, PlatformWindow owner) {
+ this.peer = peer;
+ this.target = (CViewEmbeddedFrame) target;
+ responder = new CPlatformResponder(peer, false);
+
+ view = new CPlatformView();
+ view.initialize(peer, responder);
+
+ CWrapper.NSView.addSubview(this.target.getEmbedderHandle(), view.getAWTView());
+ view.setAutoResizable(true);
+ }
+
+ public long getNSViewPtr() {
+ return view.getAWTView();
+ }
+
+ @Override
+ public long getLayerPtr() {
+ return view.getWindowLayerPtr();
+ }
+
+ @Override
+ public LWWindowPeer getPeer() {
+ return peer;
+ }
+
+ @Override
+ public void dispose() {
+ CWrapper.NSView.removeFromSuperview(view.getAWTView());
+ view.dispose();
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ CWrapper.NSView.setHidden(view.getAWTView(), !visible);
+ }
+
+ @Override
+ public void setTitle(String title) {
+ }
+
+ @Override
+ public void setBounds(int x, int y, int w, int h) {
+ view.setBounds(x, y, w, h);
+ peer.notifyReshape(x, y, w, h);
+ }
+
+ @Override
+ public GraphicsDevice getGraphicsDevice() {
+ return view.getGraphicsDevice();
+ }
+
+ @Override
+ public Point getLocationOnScreen() {
+ return view.getLocationOnScreen();
+ }
+
+ @Override
+ public Insets getInsets() {
+ return new Insets(0, 0, 0, 0);
+ }
+
+ @Override
+ public FontMetrics getFontMetrics(Font f) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ @Override
+ public SurfaceData getScreenSurface() {
+ return view.getSurfaceData();
+ }
+
+ @Override
+ public SurfaceData replaceSurfaceData() {
+ return view.replaceSurfaceData();
+ }
+
+ @Override
+ public void setModalBlocked(boolean blocked) {
+ }
+
+ @Override
+ public void toFront() {
+ }
+
+ @Override
+ public void toBack() {
+ }
+
+ @Override
+ public void setMenuBar(MenuBar mb) {
+ }
+
+ @Override
+ public void setAlwaysOnTop(boolean value) {
+ }
+
+ @Override
+ public PlatformWindow getTopmostPlatformWindowUnderMouse() {
+ return null;
+ }
+
+ @Override
+ public void updateFocusableWindowState() {
+ }
+
+ @Override
+ public boolean rejectFocusRequest(Cause cause) {
+ return false;
+ }
+
+ @Override
+ public boolean requestWindowFocus() {
+ return true;
+ }
+
+ @Override
+ public boolean isActive() {
+ return target.isParentWindowActive();
+ }
+
+ @Override
+ public void setResizable(boolean resizable) {
+ }
+
+ @Override
+ public void setSizeConstraints(int minW, int minH, int maxW, int maxH) {
+ }
+
+ @Override
+ public Graphics transformGraphics(Graphics g) {
+ return g;
+ }
+
+ @Override
+ public void updateIconImages() {
+ }
+
+ @Override
+ public void setOpacity(float opacity) {
+ }
+
+ @Override
+ public void setOpaque(boolean isOpaque) {
+ }
+
+ @Override
+ public void enterFullScreenMode() {
+ }
+
+ @Override
+ public void exitFullScreenMode() {
+ }
+
+ @Override
+ public void setWindowState(int windowState) {
+ }
+
+ @Override
+ public boolean isUnderMouse() {
+ return view.isUnderMouse();
+ }
+}
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CWrapper.java Mon Dec 24 11:46:38 2012 -0800
@@ -85,6 +85,8 @@
public static native void enterFullScreenMode(long view);
public static native void exitFullScreenMode(long view);
+
+ public static native void setHidden(long view, boolean hidden);
}
public static final class NSObject {
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java Mon Dec 24 11:46:38 2012 -0800
@@ -156,10 +156,13 @@
@Override
protected PlatformWindow createPlatformWindow(PeerType peerType) {
- if (peerType == PeerType.EMBEDDEDFRAME) {
+ if (peerType == PeerType.EMBEDDED_FRAME) {
return new CPlatformEmbeddedFrame();
+ } else if (peerType == PeerType.VIEW_EMBEDDED_FRAME) {
+ return new CViewPlatformEmbeddedFrame();
} else {
- return new CPlatformWindow(peerType);
+ assert (peerType == PeerType.SIMPLEWINDOW || peerType == PeerType.DIALOG || peerType == PeerType.FRAME);
+ return new CPlatformWindow();
}
}
--- a/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/awt/AWTSurfaceLayers.m Mon Dec 24 11:46:38 2012 -0800
@@ -99,17 +99,16 @@
__block AWTSurfaceLayers *surfaceLayers = nil;
JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
- AWT_ASSERT_APPKIT_THREAD;
-
- CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
- surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
- CFRetain(surfaceLayers);
- [surfaceLayers release];
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
+ surfaceLayers = [[AWTSurfaceLayers alloc] initWithWindowLayer: windowLayer];
+ CFRetain(surfaceLayers);
+ [surfaceLayers release];
}];
-
+
JNF_COCOA_EXIT(env);
return ptr_to_jlong(surfaceLayers);
@@ -126,12 +125,13 @@
JNF_COCOA_ENTER(env);
AWTSurfaceLayers *surfaceLayers = OBJC(surfaceLayersPtr);
- [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+
+ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWT_ASSERT_APPKIT_THREAD;
CGRect rect = CGRectMake(x, y, width, height);
[surfaceLayers setBounds: rect];
- }];
+ }];
JNF_COCOA_EXIT(env);
}
--- a/jdk/src/macosx/native/sun/awt/AWTView.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/awt/AWTView.m Mon Dec 24 11:46:38 2012 -0800
@@ -83,6 +83,7 @@
mouseIsOver = NO;
[self resetTrackingArea];
+ [self setAutoresizesSubviews:NO];
if (windowLayer != nil) {
self.cglLayer = windowLayer;
@@ -174,6 +175,11 @@
* Automatically triggered functions.
*/
+- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize {
+ [super resizeWithOldSuperviewSize: oldBoundsSize];
+ [self deliverResize: [self frame]];
+}
+
/*
* MouseEvents support
*/
@@ -437,6 +443,18 @@
}
}
+-(void) deliverResize: (NSRect) rect {
+ jint x = (jint) rect.origin.x;
+ jint y = (jint) rect.origin.y;
+ jint w = (jint) rect.size.width;
+ jint h = (jint) rect.size.height;
+ JNIEnv *env = [ThreadUtilities getJNIEnv];
+ static JNF_CLASS_CACHE(jc_PlatformView, "sun/lwawt/macosx/CPlatformView");
+ static JNF_MEMBER_CACHE(jm_deliverResize, jc_PlatformView, "deliverResize", "(IIII)V");
+ JNFCallVoidMethod(env, m_cPlatformView, jm_deliverResize, x,y,w,h);
+}
+
+
- (void) drawRect:(NSRect)dirtyRect {
AWT_ASSERT_APPKIT_THREAD;
@@ -1220,21 +1238,19 @@
__block AWTView *newView = nil;
JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
NSRect rect = NSMakeRect(originX, originY, width, height);
jobject cPlatformView = (*env)->NewGlobalRef(env, obj);
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
AWT_ASSERT_APPKIT_THREAD;
-
+
CALayer *windowLayer = jlong_to_ptr(windowLayerPtr);
AWTView *view = [[AWTView alloc] initWithRect:rect
platformView:cPlatformView
windowLayer:windowLayer];
CFRetain(view);
[view release]; // GC
-
newView = view;
}];
@@ -1242,3 +1258,125 @@
return ptr_to_jlong(newView);
}
+
+/*
+ * Class: sun_lwawt_macosx_CPlatformView
+ * Method: nativeSetAutoResizable
+ * Signature: (JZ)V;
+ */
+
+JNIEXPORT void JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeSetAutoResizable
+(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toResize)
+{
+JNF_COCOA_ENTER(env);
+
+ NSView *view = (NSView *)jlong_to_ptr(viewPtr);
+
+ [ThreadUtilities performOnMainThreadWaiting:NO block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ if (toResize) {
+ [view setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
+ } else {
+ [view setAutoresizingMask: NSViewMinYMargin | NSViewMaxXMargin];
+ }
+
+ if ([view superview] != nil) {
+ [[view superview] setAutoresizesSubviews:(BOOL)toResize];
+ }
+
+ }];
+JNF_COCOA_EXIT(env);
+}
+
+/*
+ * Class: sun_lwawt_macosx_CPlatformView
+ * Method: nativeGetNSViewDisplayID
+ * Signature: (J)I;
+ */
+
+JNIEXPORT jint JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID
+(JNIEnv *env, jclass cls, jlong viewPtr)
+{
+ __block jint ret; //CGDirectDisplayID
+
+JNF_COCOA_ENTER(env);
+
+ NSView *view = (NSView *)jlong_to_ptr(viewPtr);
+ NSWindow *window = [view window];
+
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
+ }];
+
+JNF_COCOA_EXIT(env);
+
+ return ret;
+}
+
+/*
+ * Class: sun_lwawt_macosx_CPlatformView
+ * Method: nativeGetLocationOnScreen
+ * Signature: (J)Ljava/awt/Rectangle;
+ */
+
+JNIEXPORT jobject JNICALL
+Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen
+(JNIEnv *env, jclass cls, jlong viewPtr)
+{
+ jobject jRect = NULL;
+
+JNF_COCOA_ENTER(env);
+
+ __block NSRect rect = NSZeroRect;
+
+ NSView *view = (NSView *)jlong_to_ptr(viewPtr);
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ NSRect viewBounds = [view bounds];
+ NSRect frameInWindow = [view convertRect:viewBounds toView:nil];
+ rect = [[view window] convertRectToScreen:frameInWindow];
+ NSRect screenRect = [[NSScreen mainScreen] frame];
+ //Convert coordinates to top-left corner origin
+ rect.origin.y = screenRect.size.height - rect.origin.y - viewBounds.size.height;
+ }];
+ jRect = NSToJavaRect(env, rect);
+
+JNF_COCOA_EXIT(env);
+
+ return jRect;
+}
+
+/*
+ * Class: sun_lwawt_macosx_CPlatformView
+ * Method: nativeIsViewUnderMouse
+ * Signature: (J)Z;
+ */
+
+JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CPlatformView_nativeIsViewUnderMouse
+(JNIEnv *env, jclass clazz, jlong viewPtr)
+{
+ __block jboolean underMouse = JNI_FALSE;
+
+JNF_COCOA_ENTER(env);
+
+ NSView *nsView = OBJC(viewPtr);
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ NSPoint ptWindowCoords = [[nsView window] mouseLocationOutsideOfEventStream];
+ NSPoint ptViewCoords = [nsView convertPoint:ptWindowCoords fromView:nil];
+ underMouse = [nsView hitTest:ptViewCoords] != nil;
+ }];
+
+JNF_COCOA_EXIT(env);
+
+ return underMouse;
+}
+
+
--- a/jdk/src/macosx/native/sun/awt/AWTWindow.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/awt/AWTWindow.m Mon Dec 24 11:46:38 2012 -0800
@@ -1156,34 +1156,6 @@
/*
* Class: sun_lwawt_macosx_CPlatformWindow
- * Method: nativeGetDisplayID_AppKitThread
- * Signature: (J)I
- */
-JNIEXPORT jint JNICALL
-Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowDisplayID
-(JNIEnv *env, jclass clazz, jlong windowPtr)
-{
- __block jint ret; // CGDirectDisplayID
-
-JNF_COCOA_ENTER(env);
-
- NSWindow *window = OBJC(windowPtr);
-
- if ([NSThread isMainThread]) {
- ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
- } else {
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
- ret = (jint)[[AWTWindow getNSWindowDisplayID_AppKitThread: window] intValue];
- }];
- }
-
-JNF_COCOA_EXIT(env);
-
- return ret;
-}
-
-/*
- * Class: sun_lwawt_macosx_CPlatformWindow
* Method: _toggleFullScreenMode
* Signature: (J)V
*/
@@ -1203,27 +1175,6 @@
JNF_COCOA_EXIT(env);
}
-JNIEXPORT jboolean JNICALL Java_sun_lwawt_macosx_CMouseInfoPeer_nativeIsWindowUnderMouse
-(JNIEnv *env, jclass clazz, jlong windowPtr)
-{
- __block jboolean underMouse = JNI_FALSE;
-
-JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
-
- NSWindow *nsWindow = OBJC(windowPtr);
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^() {
- AWT_ASSERT_APPKIT_THREAD;
-
- NSPoint pt = [nsWindow mouseLocationOutsideOfEventStream];
- underMouse = [[nsWindow contentView] hitTest:pt] != nil;
- }];
-
-JNF_COCOA_EXIT(env);
-
- return underMouse;
-}
-
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled
(JNIEnv *env, jclass clazz, jlong windowPtr, jboolean isEnabled)
{
--- a/jdk/src/macosx/native/sun/awt/CCursorManager.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/awt/CCursorManager.m Mon Dec 24 11:46:38 2012 -0800
@@ -123,14 +123,15 @@
jobject jpt = NULL;
JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
__block NSPoint pt = NSZeroPoint;
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
- AWT_ASSERT_APPKIT_THREAD;
-
- pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
+
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ pt = ConvertNSScreenPoint(env, [NSEvent mouseLocation]);
}];
+
jpt = NSToJavaPoint(env, pt);
JNF_COCOA_EXIT(env);
--- a/jdk/src/macosx/native/sun/awt/CWrapper.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/awt/CWrapper.m Mon Dec 24 11:46:38 2012 -0800
@@ -651,6 +651,26 @@
}
/*
+ * Class: sun_lwawt_macosx_CWrapper$NSView
+ * Method: setHidden
+ * Signature: (JZ)V
+ */
+JNIEXPORT jlong JNICALL
+Java_sun_lwawt_macosx_CWrapper_00024NSView_setHidden
+(JNIEnv *env, jclass cls, jlong viewPtr, jboolean toHide)
+{
+ JNF_COCOA_ENTER(env);
+
+ NSView *view = (NSView *)jlong_to_ptr(viewPtr);
+ [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){
+ [view setHidden:(BOOL)toHide];
+ }];
+
+ JNF_COCOA_EXIT(env);
+}
+
+
+/*
* Class: sun_lwawt_macosx_CWrapper$NSScreen
* Method: frame
* Signature: (J)Ljava/awt/Rectangle;
--- a/jdk/src/macosx/native/sun/awt/awt.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/awt/awt.m Mon Dec 24 11:46:38 2012 -0800
@@ -95,7 +95,7 @@
CFRelease(busyObserver);
CFRelease(notBusyObserver);
-
+
if (!headless) setBusy(YES);
// Set the java name of the AppKit main thread appropriately.
@@ -367,7 +367,8 @@
CFRunLoopRef runLoop = [[NSRunLoop currentRunLoop] getCFRunLoop];
CFRunLoopRemoveObserver(runLoop, busyObserver, kCFRunLoopDefaultMode);
CFRunLoopRemoveObserver(runLoop, notBusyObserver, kCFRunLoopDefaultMode);
-
+ // We don't track if the runloop is busy, so set it free to let AWT finish when it needs
+ setBusy(NO);
busyObserver = NULL;
notBusyObserver = NULL;
} else {
--- a/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m Mon Dec 24 11:46:38 2012 -0800
@@ -151,16 +151,15 @@
__block CGLLayer *layer = nil;
JNF_COCOA_ENTER(env);
-AWT_ASSERT_NOT_APPKIT_THREAD;
JNFJObjectWrapper *javaLayer = [JNFJObjectWrapper wrapperWithJObject:obj withEnv:env];
- [JNFRunLoop performOnMainThreadWaiting:YES withBlock:^(){
- AWT_ASSERT_APPKIT_THREAD;
-
- layer = [[CGLLayer alloc] initWithJavaLayer: javaLayer];
+ [ThreadUtilities performOnMainThreadWaiting:YES block:^(){
+ AWT_ASSERT_APPKIT_THREAD;
+
+ layer = [[CGLLayer alloc] initWithJavaLayer: javaLayer];
}];
-
+
JNF_COCOA_EXIT(env);
return ptr_to_jlong(layer);
--- a/jdk/src/macosx/native/sun/osxapp/ThreadUtilities.h Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/osxapp/ThreadUtilities.h Mon Dec 24 11:46:38 2012 -0800
@@ -139,7 +139,7 @@
+ (JNIEnv*)getJNIEnvUncached;
+ (void)performOnMainThread:(SEL)aSelector onObject:(id)target withObject:(id)arg waitUntilDone:(BOOL)wait awtMode:(BOOL)inAWT;
-
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block;
@end
void OSXAPP_SetJavaVM(JavaVM *vm);
--- a/jdk/src/macosx/native/sun/osxapp/ThreadUtilities.m Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/macosx/native/sun/osxapp/ThreadUtilities.m Mon Dec 24 11:46:38 2012 -0800
@@ -245,6 +245,14 @@
}
}
++ (void)performOnMainThreadWaiting:(BOOL)wait block:(void (^)())block {
+ if ([NSThread isMainThread] && wait == YES) {
+ block();
+ } else {
+ [JNFRunLoop performOnMainThreadWaiting:wait withBlock:block];
+ }
+}
+
@end
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/PropMap.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,8 +25,6 @@
package com.sun.java.util.jar.pack;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
@@ -42,40 +40,39 @@
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.jar.Pack200;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
/**
* Control block for publishing Pack200 options to the other classes.
*/
final class PropMap implements SortedMap<String, String> {
private final TreeMap<String, String> theMap = new TreeMap<>();;
- private final List<PropertyChangeListener> listenerList = new ArrayList<>(1);
- void addListener(PropertyChangeListener listener) {
+ // type is erased, elements are of type java.beans.PropertyChangeListener
+ private final List<Object> listenerList = new ArrayList<>(1);
+
+ void addListener(Object listener) {
+ assert Beans.isPropertyChangeListener(listener);
listenerList.add(listener);
}
- void removeListener(PropertyChangeListener listener) {
+ void removeListener(Object listener) {
+ assert Beans.isPropertyChangeListener(listener);
listenerList.remove(listener);
}
- void addListeners(ArrayList<PropertyChangeListener> listeners) {
- listenerList.addAll(listeners);
- }
-
- void removeListeners(ArrayList<PropertyChangeListener> listeners) {
- listenerList.removeAll(listeners);
- }
-
// Override:
public String put(String key, String value) {
String oldValue = theMap.put(key, value);
if (value != oldValue && !listenerList.isEmpty()) {
+ assert Beans.isBeansPresent();
// Post the property change event.
- PropertyChangeEvent event =
- new PropertyChangeEvent(this, key,
- oldValue, value);
- for (PropertyChangeListener listener : listenerList) {
- listener.propertyChange(event);
+ Object event = Beans.newPropertyChangeEvent(this, key, oldValue, value);
+ for (Object listener : listenerList) {
+ Beans.invokePropertyChange(listener, event);
}
}
return oldValue;
@@ -339,4 +336,113 @@
public String lastKey() {
return theMap.lastKey();
}
+
+ /**
+ * A class that provides access to the java.beans.PropertyChangeListener
+ * and java.beans.PropertyChangeEvent without creating a static dependency
+ * on java.beans. This class can be removed once the addPropertyChangeListener
+ * and removePropertyChangeListener methods are removed from Packer and
+ * Unpacker.
+ */
+ private static class Beans {
+ private static final Class<?> propertyChangeListenerClass =
+ getClass("java.beans.PropertyChangeListener");
+
+ private static final Class<?> propertyChangeEventClass =
+ getClass("java.beans.PropertyChangeEvent");
+
+ private static final Method propertyChangeMethod =
+ getMethod(propertyChangeListenerClass,
+ "propertyChange",
+ propertyChangeEventClass);
+
+ private static final Constructor<?> propertyEventCtor =
+ getConstructor(propertyChangeEventClass,
+ Object.class,
+ String.class,
+ Object.class,
+ Object.class);
+
+ private static Class<?> getClass(String name) {
+ try {
+ return Class.forName(name, true, Beans.class.getClassLoader());
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
+ private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
+ try {
+ return (c == null) ? null : c.getDeclaredConstructor(types);
+ } catch (NoSuchMethodException x) {
+ throw new AssertionError(x);
+ }
+ }
+
+ private static Method getMethod(Class<?> c, String name, Class<?>... types) {
+ try {
+ return (c == null) ? null : c.getMethod(name, types);
+ } catch (NoSuchMethodException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ /**
+ * Returns {@code true} if java.beans is present.
+ */
+ static boolean isBeansPresent() {
+ return propertyChangeListenerClass != null &&
+ propertyChangeEventClass != null;
+ }
+
+ /**
+ * Returns {@code true} if the given object is a PropertyChangeListener
+ */
+ static boolean isPropertyChangeListener(Object obj) {
+ if (propertyChangeListenerClass == null) {
+ return false;
+ } else {
+ return propertyChangeListenerClass.isInstance(obj);
+ }
+ }
+
+ /**
+ * Returns a new PropertyChangeEvent with the given source, property
+ * name, old and new values.
+ */
+ static Object newPropertyChangeEvent(Object source, String prop,
+ Object oldValue, Object newValue)
+ {
+ try {
+ return propertyEventCtor.newInstance(source, prop, oldValue, newValue);
+ } catch (InstantiationException | IllegalAccessException x) {
+ throw new AssertionError(x);
+ } catch (InvocationTargetException x) {
+ Throwable cause = x.getCause();
+ if (cause instanceof Error)
+ throw (Error)cause;
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException)cause;
+ throw new AssertionError(x);
+ }
+ }
+
+ /**
+ * Invokes the given PropertyChangeListener's propertyChange method
+ * with the given event.
+ */
+ static void invokePropertyChange(Object listener, Object ev) {
+ try {
+ propertyChangeMethod.invoke(listener, ev);
+ } catch (IllegalAccessException x) {
+ throw new AssertionError(x);
+ } catch (InvocationTargetException x) {
+ Throwable cause = x.getCause();
+ if (cause instanceof Error)
+ throw (Error)cause;
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException)cause;
+ throw new AssertionError(x);
+ }
+ }
+ }
}
--- a/jdk/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/net/ssl/KeyManagerFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,12 +53,13 @@
/**
* <p>The default KeyManager can be changed by setting the value of the
- * "sun.ssl.keymanager.type" security property (in the Java security
- * properties file) to the desired name.
+ * {@code sun.ssl.keymanager.type} security property to the desired name.
*
- * @return the default type as specified in the
- * Java security properties file, or an implementation-specific default
- * if no such property exists.
+ * @return the default type as specified by the
+ * {@code sun.ssl.keymanager.type} security property, or an
+ * implementation-specific default if no such property exists.
+ *
+ * @see java.security.Security security properties
*/
public final static String getDefaultAlgorithm() {
String type;
--- a/jdk/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/net/ssl/TrustManagerFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,12 +53,13 @@
/**
* <p>The default TrustManager can be changed by setting the value of the
- * "sun.ssl.trustmanager.type" security property
- * (in the Java security properties file) to the desired name.
+ * {@code sun.ssl.trustmanager.type} security property to the desired name.
*
- * @return the default type as specified in the
- * Java security properties file, or an implementation-specific default
- * if no such property exists.
+ * @return the default type as specified by the
+ * {@code sun.ssl.trustmanager.type} security property, or an
+ * implementation-specific default if no such property exists.
+ *
+ * @see java.security.Security security properties
*/
public final static String getDefaultAlgorithm() {
String type;
--- a/jdk/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java Mon Dec 24 11:46:38 2012 -0800
@@ -264,7 +264,7 @@
* <code>false</code> otherwise
*/
public boolean writeData(RowSetInternal caller) throws SQLException {
- boolean conflict = false;
+ long conflicts = 0;
boolean showDel = false;
PreparedStatement pstmtIns = null;
iChangedValsInDbAndCRS = 0;
@@ -337,8 +337,9 @@
while (crs.next()) {
if (crs.rowDeleted()) {
// The row has been deleted.
- if (conflict = (deleteOriginalRow(crs, this.crsResolve)) == true) {
+ if (deleteOriginalRow(crs, this.crsResolve)) {
status.add(rows, SyncResolver.DELETE_ROW_CONFLICT);
+ conflicts++;
} else {
// delete happened without any occurrence of conflicts
// so update status accordingly
@@ -349,8 +350,9 @@
// The row has been inserted.
pstmtIns = con.prepareStatement(insertCmd);
- if ( (conflict = insertNewRow(crs, pstmtIns, this.crsResolve)) == true) {
+ if (insertNewRow(crs, pstmtIns, this.crsResolve)) {
status.add(rows, SyncResolver.INSERT_ROW_CONFLICT);
+ conflicts++;
} else {
// insert happened without any occurrence of conflicts
// so update status accordingly
@@ -358,8 +360,9 @@
}
} else if (crs.rowUpdated()) {
// The row has been updated.
- if ( conflict = (updateOriginalRow(crs)) == true) {
+ if (updateOriginalRow(crs)) {
status.add(rows, SyncResolver.UPDATE_ROW_CONFLICT);
+ conflicts++;
} else {
// update happened without any occurrence of conflicts
// so update status accordingly
@@ -395,21 +398,12 @@
// reset
crs.setShowDeleted(showDel);
- boolean boolConf = false;
- for (int j=1;j<status.size();j++){
- // ignore status for index = 0 which is set to null
- if(! ((status.get(j)).equals(SyncResolver.NO_ROW_CONFLICT))) {
- // there is at least one conflict which needs to be resolved
- boolConf = true;
- break;
- }
- }
-
crs.beforeFirst();
this.crsResolve.beforeFirst();
- if(boolConf) {
- SyncProviderException spe = new SyncProviderException(status.size() - 1+resBundle.handleGetObject("crswriter.conflictsno").toString());
+ if(conflicts != 0) {
+ SyncProviderException spe = new SyncProviderException(conflicts + " " +
+ resBundle.handleGetObject("crswriter.conflictsno").toString());
//SyncResolver syncRes = spe.getSyncResolver();
SyncResolverImpl syncResImpl = (SyncResolverImpl) spe.getSyncResolver();
--- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -59,13 +59,9 @@
*
* <ol>
* <li>
- * Loop through the <code>java.security.Security</code> properties,
+ * Loop through the security properties,
* <i>auth.policy.url.1</i>, <i>auth.policy.url.2</i>, ...,
- * <i>auth.policy.url.X</i>". These properties are set
- * in the Java security properties file, which is located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <i>auth.policy.url.X</i>".
* Each property value specifies a <code>URL</code> pointing to a
* policy file to be loaded. Read in and load each policy.
*
@@ -235,6 +231,7 @@
* @see java.security.CodeSource
* @see java.security.Permissions
* @see java.security.ProtectionDomain
+ * @see java.security.Security security properties
*/
@Deprecated
public class PolicyFile extends javax.security.auth.Policy {
--- a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,13 +49,9 @@
*
* <ol>
* <li>
- * Loop through the <code>java.security.Security</code> properties,
+ * Loop through the security properties,
* <i>login.config.url.1</i>, <i>login.config.url.2</i>, ...,
- * <i>login.config.url.X</i>. These properties are set
- * in the Java security properties file, which is located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <i>login.config.url.X</i>.
* Each property value specifies a <code>URL</code> pointing to a
* login configuration file to be loaded. Read in and load
* each configuration.
@@ -87,6 +83,7 @@
* <code>javax.security.auth.login.Configuration</code> class.
*
* @see javax.security.auth.login.LoginContext
+ * @see java.security.Security security properties
*/
public class ConfigFile extends javax.security.auth.login.Configuration {
--- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java Mon Dec 24 11:46:38 2012 -0800
@@ -1067,10 +1067,6 @@
if (ktab != null) {
if (!privCredSet.contains(ktab)) {
privCredSet.add(ktab);
- // Compatibility; also add keys to privCredSet
- for (KerberosKey key: ktab.getKeys(kerbClientPrinc)) {
- privCredSet.add(new Krb5Util.KeysFromKeyTab(key));
- }
}
} else {
succeeded = false;
--- a/jdk/src/share/classes/java/lang/ThreadLocal.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/lang/ThreadLocal.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,19 +25,21 @@
package java.lang;
import java.lang.ref.*;
+import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
/**
* This class provides thread-local variables. These variables differ from
* their normal counterparts in that each thread that accesses one (via its
- * <tt>get</tt> or <tt>set</tt> method) has its own, independently initialized
- * copy of the variable. <tt>ThreadLocal</tt> instances are typically private
+ * {@code get} or {@code set} method) has its own, independently initialized
+ * copy of the variable. {@code ThreadLocal} instances are typically private
* static fields in classes that wish to associate state with a thread (e.g.,
* a user ID or Transaction ID).
*
* <p>For example, the class below generates unique identifiers local to each
* thread.
- * A thread's id is assigned the first time it invokes <tt>ThreadId.get()</tt>
+ * A thread's id is assigned the first time it invokes {@code ThreadId.get()}
* and remains unchanged on subsequent calls.
* <pre>
* import java.util.concurrent.atomic.AtomicInteger;
@@ -61,7 +63,7 @@
* }
* </pre>
* <p>Each thread holds an implicit reference to its copy of a thread-local
- * variable as long as the thread is alive and the <tt>ThreadLocal</tt>
+ * variable as long as the thread is alive and the {@code ThreadLocal}
* instance is accessible; after a thread goes away, all of its copies of
* thread-local instances are subject to garbage collection (unless other
* references to these copies exist).
@@ -108,14 +110,14 @@
* thread-local variable. This method will be invoked the first
* time a thread accesses the variable with the {@link #get}
* method, unless the thread previously invoked the {@link #set}
- * method, in which case the <tt>initialValue</tt> method will not
+ * method, in which case the {@code initialValue} method will not
* be invoked for the thread. Normally, this method is invoked at
* most once per thread, but it may be invoked again in case of
* subsequent invocations of {@link #remove} followed by {@link #get}.
*
- * <p>This implementation simply returns <tt>null</tt>; if the
+ * <p>This implementation simply returns {@code null}; if the
* programmer desires thread-local variables to have an initial
- * value other than <tt>null</tt>, <tt>ThreadLocal</tt> must be
+ * value other than {@code null}, {@code ThreadLocal} must be
* subclassed, and this method overridden. Typically, an
* anonymous inner class will be used.
*
@@ -126,7 +128,21 @@
}
/**
+ * Creates a thread local variable. The initial value of the variable is
+ * determined by invoking the {@code get} method on the {@code Supplier}.
+ *
+ * @param supplier the supplier to be used to determine the initial value
+ * @return a new thread local variable
+ * @throws NullPointerException if the specified supplier is null
+ * @since 1.8
+ */
+ public static <T> ThreadLocal<T> withInitial(Supplier<? extends T> supplier) {
+ return new SuppliedThreadLocal<>(supplier);
+ }
+
+ /**
* Creates a thread local variable.
+ * @see #withInitial(java.util.function.Supplier)
*/
public ThreadLocal() {
}
@@ -195,7 +211,7 @@
* reinitialized by invoking its {@link #initialValue} method,
* unless its value is {@linkplain #set set} by the current thread
* in the interim. This may result in multiple invocations of the
- * <tt>initialValue</tt> method in the current thread.
+ * {@code initialValue} method in the current thread.
*
* @since 1.5
*/
@@ -251,6 +267,24 @@
}
/**
+ * An extension of ThreadLocal that obtains its initial value from
+ * the specified {@code Supplier}.
+ */
+ static final class SuppliedThreadLocal<T> extends ThreadLocal<T> {
+
+ private final Supplier<? extends T> supplier;
+
+ SuppliedThreadLocal(Supplier<? extends T> supplier) {
+ this.supplier = Objects.requireNonNull(supplier);
+ }
+
+ @Override
+ protected T initialValue() {
+ return supplier.get();
+ }
+ }
+
+ /**
* ThreadLocalMap is a customized hash map suitable only for
* maintaining thread local values. No operations are exported
* outside of the ThreadLocal class. The class is package private to
@@ -599,9 +633,9 @@
* @param i a position known NOT to hold a stale entry. The
* scan starts at the element after i.
*
- * @param n scan control: <tt>log2(n)</tt> cells are scanned,
+ * @param n scan control: {@code log2(n)} cells are scanned,
* unless a stale entry is found, in which case
- * <tt>log2(table.length)-1</tt> additional cells are scanned.
+ * {@code log2(table.length)-1} additional cells are scanned.
* When called from insertions, this parameter is the number
* of elements, but when from replaceStaleEntry, it is the
* table length. (Note: all this could be changed to be either
--- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,15 +25,15 @@
package java.lang.invoke;
-import java.io.FileOutputStream;
-import java.io.IOException;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.security.ProtectionDomain;
import java.util.concurrent.atomic.AtomicInteger;
-import sun.util.logging.PlatformLogger;
import jdk.internal.org.objectweb.asm.*;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
import sun.misc.Unsafe;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
/**
* InnerClassLambdaMetafactory
@@ -120,13 +120,34 @@
*
* @return a CallSite, which, when invoked, will return an instance of the
* functional interface
- * @throws ReflectiveOperationException
+ * @throws ReflectiveOperationException, LambdaConversionException
*/
@Override
CallSite buildCallSite() throws ReflectiveOperationException, LambdaConversionException {
final Class<?> innerClass = spinInnerClass();
if (invokedType.parameterCount() == 0) {
- return new ConstantCallSite(MethodHandles.constant(samBase, innerClass.newInstance()));
+ final Constructor[] ctrs = AccessController.doPrivileged(
+ new PrivilegedAction<Constructor[]>() {
+ @Override
+ public Constructor[] run() {
+ return innerClass.getDeclaredConstructors();
+ }
+ });
+ if (ctrs.length != 1) {
+ throw new ReflectiveOperationException("Expected one lambda constructor for "
+ + innerClass.getCanonicalName() + ", got " + ctrs.length);
+ }
+ // The lambda implementing inner class constructor is private, set
+ // it accessible (by us) before creating the constant sole instance
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
+ public Void run() {
+ ctrs[0].setAccessible(true);
+ return null;
+ }
+ });
+ Object inst = ctrs[0].newInstance();
+ return new ConstantCallSite(MethodHandles.constant(samBase, inst));
} else {
return new ConstantCallSite(
MethodHandles.Lookup.IMPL_LOOKUP
@@ -144,7 +165,7 @@
private <T> Class<? extends T> spinInnerClass() throws LambdaConversionException {
String samName = samBase.getName().replace('.', '/');
- cw.visit(CLASSFILE_VERSION, ACC_PUBLIC + ACC_SUPER, lambdaClassName, null, NAME_MAGIC_ACCESSOR_IMPL,
+ cw.visit(CLASSFILE_VERSION, ACC_SUPER, lambdaClassName, null, NAME_MAGIC_ACCESSOR_IMPL,
isSerializable ? new String[]{samName, NAME_SERIALIZABLE} : new String[]{samName});
// Generate final fields to be filled in by constructor
@@ -186,17 +207,27 @@
final byte[] classBytes = cw.toByteArray();
- if (System.getProperty("debug.dump.generated") != null) {
+ /*** Uncomment to dump the generated file
System.out.printf("Loaded: %s (%d bytes) %n", lambdaClassName, classBytes.length);
try (FileOutputStream fos = new FileOutputStream(lambdaClassName.replace('/', '.') + ".class")) {
fos.write(classBytes);
} catch (IOException ex) {
- PlatformLogger.getLogger(InnerClassLambdaMetafactory.class.getName()).severe(ex.getMessage(), ex);
+ Logger.getLogger(InnerClassLambdaMetafactory.class.getName()).log(Level.SEVERE, null, ex);
}
- }
+ ***/
ClassLoader loader = targetClass.getClassLoader();
- ProtectionDomain pd = (loader == null) ? null : targetClass.getProtectionDomain();
+ ProtectionDomain pd = (loader == null)
+ ? null
+ : AccessController.doPrivileged(
+ new PrivilegedAction<ProtectionDomain>() {
+ @Override
+ public ProtectionDomain run() {
+ return targetClass.getProtectionDomain();
+ }
+ }
+ );
+
return (Class<? extends T>) Unsafe.getUnsafe().defineClass(lambdaClassName, classBytes, 0, classBytes.length, loader, pd);
}
@@ -205,7 +236,7 @@
*/
private void generateConstructor() {
// Generate constructor
- MethodVisitor ctor = cw.visitMethod(ACC_PUBLIC, NAME_CTOR, constructorDesc, null, null);
+ MethodVisitor ctor = cw.visitMethod(ACC_PRIVATE, NAME_CTOR, constructorDesc, null, null);
ctor.visitCode();
ctor.visitVarInsn(ALOAD, 0);
ctor.visitMethodInsn(INVOKESPECIAL, NAME_MAGIC_ACCESSOR_IMPL, NAME_CTOR, METHOD_DESCRIPTOR_VOID);
--- a/jdk/src/share/classes/java/net/HttpCookie.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/net/HttpCookie.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,6 +30,8 @@
import java.util.NoSuchElementException;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
import java.util.Date;
import java.util.Locale;
import java.util.Objects;
@@ -89,7 +91,10 @@
private final static String[] COOKIE_DATE_FORMATS = {
"EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
"EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
- "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+ "EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
+ "EEE',' dd-MMM-yy HH:mm:ss 'GMT'",
+ "EEE',' dd MMM yy HH:mm:ss 'GMT'",
+ "EEE MMM dd yy HH:mm:ss 'GMT'Z"
};
// constant strings represent set-cookie header token
@@ -1025,13 +1030,29 @@
* specified by dateString
*/
private long expiryDate2DeltaSeconds(String dateString) {
+ Calendar cal = new GregorianCalendar(GMT);
for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
Locale.US);
+ cal.set(1970, 0, 1, 0, 0, 0);
df.setTimeZone(GMT);
+ df.setLenient(false);
+ df.set2DigitYearStart(cal.getTime());
try {
- Date date = df.parse(dateString);
- return (date.getTime() - whenCreated) / 1000;
+ cal.setTime(df.parse(dateString));
+ if (!COOKIE_DATE_FORMATS[i].contains("yyyy")) {
+ // 2-digit years following the standard set
+ // out it rfc 6265
+ int year = cal.get(Calendar.YEAR);
+ year %= 100;
+ if (year < 70) {
+ year += 2000;
+ } else {
+ year += 1900;
+ }
+ cal.set(Calendar.YEAR, year);
+ }
+ return (cal.getTimeInMillis() - whenCreated) / 1000;
} catch (Exception e) {
// Ignore, try the next date format
}
--- a/jdk/src/share/classes/java/net/Inet6Address.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/net/Inet6Address.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,9 +25,9 @@
package java.net;
-import java.io.ObjectInputStream;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.util.Enumeration;
/**
@@ -116,7 +116,8 @@
* <h4> Special IPv6 address </h4>
*
* <blockquote>
- * <table cellspacing=2 summary="Description of IPv4-mapped address"> <tr><th valign=top><i>IPv4-mapped address</i></th>
+ * <table cellspacing=2 summary="Description of IPv4-mapped address">
+ * <tr><th valign=top><i>IPv4-mapped address</i></th>
* <td>Of the form::ffff:w.x.y.z, this IPv6 address is used to
* represent an IPv4 address. It allows the native program to
* use the same address data structure and also the same
@@ -130,35 +131,40 @@
* address.</td></tr>
* </table></blockquote>
* <p>
- * <h4> <A NAME="scoped">Textual representation of IPv6 scoped addresses</a> </h4>
- * <p>
- * The textual representation of IPv6 addresses as described above can be extended
- * to specify IPv6 scoped addresses. This extension to the basic addressing architecture
- * is described in [draft-ietf-ipngwg-scoping-arch-04.txt].
- * <p>
- * Because link-local and site-local addresses are non-global, it is possible that different hosts
- * may have the same destination address and may be reachable through different interfaces on the
- * same originating system. In this case, the originating system is said to be connected
- * to multiple zones of the same scope. In order to disambiguate which is the intended destination
- * zone, it is possible to append a zone identifier (or <i>scope_id</i>) to an IPv6 address.
- * <p>
- * The general format for specifying the <i>scope_id</i> is the following:
+ * <h4><A NAME="scoped">Textual representation of IPv6 scoped addresses</a></h4>
+ *
+ * <p> The textual representation of IPv6 addresses as described above can be
+ * extended to specify IPv6 scoped addresses. This extension to the basic
+ * addressing architecture is described in [draft-ietf-ipngwg-scoping-arch-04.txt].
+ *
+ * <p> Because link-local and site-local addresses are non-global, it is possible
+ * that different hosts may have the same destination address and may be
+ * reachable through different interfaces on the same originating system. In
+ * this case, the originating system is said to be connected to multiple zones
+ * of the same scope. In order to disambiguate which is the intended destination
+ * zone, it is possible to append a zone identifier (or <i>scope_id</i>) to an
+ * IPv6 address.
+ *
+ * <p> The general format for specifying the <i>scope_id</i> is the following:
+ *
* <p><blockquote><i>IPv6-address</i>%<i>scope_id</i></blockquote>
* <p> The IPv6-address is a literal IPv6 address as described above.
- * The <i>scope_id</i> refers to an interface on the local system, and it can be specified
- * in two ways.
- * <p><ol><li><i>As a numeric identifier.</i> This must be a positive integer that identifies the
- * particular interface and scope as understood by the system. Usually, the numeric
- * values can be determined through administration tools on the system. Each interface may
- * have multiple values, one for each scope. If the scope is unspecified, then the default value
- * used is zero.</li><p>
- * <li><i>As a string.</i> This must be the exact string that is returned by
- * {@link java.net.NetworkInterface#getName()} for the particular interface in question.
- * When an Inet6Address is created in this way, the numeric scope-id is determined at the time
- * the object is created by querying the relevant NetworkInterface.</li>
- * </ol><p>
- * Note also, that the numeric <i>scope_id</i> can be retrieved from Inet6Address instances returned from the
- * NetworkInterface class. This can be used to find out the current scope ids configured on the system.
+ * The <i>scope_id</i> refers to an interface on the local system, and it can be
+ * specified in two ways.
+ * <p><ol><li><i>As a numeric identifier.</i> This must be a positive integer
+ * that identifies the particular interface and scope as understood by the
+ * system. Usually, the numeric values can be determined through administration
+ * tools on the system. Each interface may have multiple values, one for each
+ * scope. If the scope is unspecified, then the default value used is zero.</li>
+ * <p><li><i>As a string.</i> This must be the exact string that is returned by
+ * {@link java.net.NetworkInterface#getName()} for the particular interface in
+ * question. When an Inet6Address is created in this way, the numeric scope-id
+ * is determined at the time the object is created by querying the relevant
+ * NetworkInterface.</li></ol>
+ *
+ * <p> Note also, that the numeric <i>scope_id</i> can be retrieved from
+ * Inet6Address instances returned from the NetworkInterface class. This can be
+ * used to find out the current scope ids configured on the system.
* @since 1.4
*/
@@ -169,7 +175,7 @@
/*
* cached scope_id - for link-local address use only.
*/
- private transient int cached_scope_id = 0;
+ private transient int cached_scope_id; // 0
/**
* Holds a 128-bit (16 bytes) IPv6 address.
@@ -179,37 +185,28 @@
byte[] ipaddress;
/**
- * scope_id. The scope specified when the object is created. If the object is created
- * with an interface name, then the scope_id is not determined until the time it is needed.
+ * scope_id. The scope specified when the object is created. If the object
+ * is created with an interface name, then the scope_id is not determined
+ * until the time it is needed.
*/
- private int scope_id = 0;
+ private int scope_id; // 0
/**
* This will be set to true when the scope_id field contains a valid
* integer scope_id.
*/
- private boolean scope_id_set = false;
+ private boolean scope_id_set; // false
/**
* scoped interface. scope_id is derived from this as the scope_id of the first
* address whose scope is the same as this address for the named interface.
*/
- private transient NetworkInterface scope_ifname = null;
-
- /**
- * set if the object is constructed with a scoped interface instead of a
- * numeric scope id.
- */
- private boolean scope_ifname_set = false;
+ private transient NetworkInterface scope_ifname; // null
private static final long serialVersionUID = 6880410070516793377L;
- /*
- * Perform initializations.
- */
- static {
- init();
- }
+ // Perform native initialization
+ static { init(); }
Inet6Address() {
super();
@@ -239,19 +236,24 @@
} catch (UnknownHostException e) {} /* cant happen if ifname is null */
}
- Inet6Address (String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException {
+ Inet6Address (String hostName, byte addr[], NetworkInterface nif)
+ throws UnknownHostException
+ {
initif (hostName, addr, nif);
}
- Inet6Address (String hostName, byte addr[], String ifname) throws UnknownHostException {
+ Inet6Address (String hostName, byte addr[], String ifname)
+ throws UnknownHostException
+ {
initstr (hostName, addr, ifname);
}
/**
- * Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
- * except that the IPv6 scope_id is set to the value corresponding to the given interface
- * for the address type specified in <code>addr</code>.
- * The call will fail with an UnknownHostException if the given interface does not have a numeric
+ * Create an Inet6Address in the exact manner of {@link
+ * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
+ * set to the value corresponding to the given interface for the address
+ * type specified in <code>addr</code>. The call will fail with an
+ * UnknownHostException if the given interface does not have a numeric
* scope_id assigned for the given address type (eg. link-local or site-local).
* See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
* scoped addresses.
@@ -260,14 +262,16 @@
* @param addr the raw IP address in network byte order
* @param nif an interface this address must be associated with.
* @return an Inet6Address object created from the raw IP address.
- * @exception UnknownHostException if IP address is of illegal length, or if the interface
- * does not have a numeric scope_id assigned for the given address type.
+ * @throws UnknownHostException
+ * if IP address is of illegal length, or if the interface does not
+ * have a numeric scope_id assigned for the given address type.
*
* @since 1.5
*/
-
- public static Inet6Address getByAddress(String host, byte[] addr, NetworkInterface nif)
- throws UnknownHostException {
+ public static Inet6Address getByAddress(String host, byte[] addr,
+ NetworkInterface nif)
+ throws UnknownHostException
+ {
if (host != null && host.length() > 0 && host.charAt(0) == '[') {
if (host.charAt(host.length()-1) == ']') {
host = host.substring(1, host.length() -1);
@@ -282,9 +286,10 @@
}
/**
- * Create an Inet6Address in the exact manner of {@link InetAddress#getByAddress(String,byte[])}
- * except that the IPv6 scope_id is set to the given numeric value.
- * The scope_id is not checked to determine if it corresponds to any interface on the system.
+ * Create an Inet6Address in the exact manner of {@link
+ * InetAddress#getByAddress(String,byte[])} except that the IPv6 scope_id is
+ * set to the given numeric value. The scope_id is not checked to determine
+ * if it corresponds to any interface on the system.
* See <a href="Inet6Address.html#scoped">here</a> for a description of IPv6
* scoped addresses.
*
@@ -292,13 +297,14 @@
* @param addr the raw IP address in network byte order
* @param scope_id the numeric scope_id for the address.
* @return an Inet6Address object created from the raw IP address.
- * @exception UnknownHostException if IP address is of illegal length.
+ * @throws UnknownHostException if IP address is of illegal length.
*
* @since 1.5
*/
-
- public static Inet6Address getByAddress(String host, byte[] addr, int scope_id)
- throws UnknownHostException {
+ public static Inet6Address getByAddress(String host, byte[] addr,
+ int scope_id)
+ throws UnknownHostException
+ {
if (host != null && host.length() > 0 && host.charAt(0) == '[') {
if (host.charAt(host.length()-1) == ']') {
host = host.substring(1, host.length() -1);
@@ -312,7 +318,9 @@
throw new UnknownHostException("addr is of illegal length");
}
- private void initstr (String hostName, byte addr[], String ifname) throws UnknownHostException {
+ private void initstr(String hostName, byte addr[], String ifname)
+ throws UnknownHostException
+ {
try {
NetworkInterface nif = NetworkInterface.getByName (ifname);
if (nif == null) {
@@ -324,16 +332,17 @@
}
}
- private void initif(String hostName, byte addr[],NetworkInterface nif) throws UnknownHostException {
+ private void initif(String hostName, byte addr[],NetworkInterface nif)
+ throws UnknownHostException
+ {
this.hostName = hostName;
if (addr.length == INADDRSZ) { // normal IPv6 address
family = IPv6;
ipaddress = addr.clone();
}
if (nif != null) {
- this.scope_ifname = nif;
- scope_ifname_set = true;
- scope_id = deriveNumericScope (nif);
+ scope_ifname = nif;
+ scope_id = deriveNumericScope(nif);
scope_id_set = true;
}
}
@@ -344,17 +353,16 @@
* return true otherwise.
*/
private boolean differentLocalAddressTypes(Inet6Address other) {
-
- if (isLinkLocalAddress() && !other.isLinkLocalAddress()) {
+ if (isLinkLocalAddress() && !other.isLinkLocalAddress())
return false;
- }
- if (isSiteLocalAddress() && !other.isSiteLocalAddress()) {
+ if (isSiteLocalAddress() && !other.isSiteLocalAddress())
return false;
- }
return true;
}
- private int deriveNumericScope (NetworkInterface ifc) throws UnknownHostException {
+ private int deriveNumericScope(NetworkInterface ifc)
+ throws UnknownHostException
+ {
Enumeration<InetAddress> addresses = ifc.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress addr = addresses.nextElement();
@@ -373,16 +381,17 @@
throw new UnknownHostException ("no scope_id found");
}
- private int deriveNumericScope (String ifname) throws UnknownHostException {
+ private int deriveNumericScope(String ifname) throws UnknownHostException {
Enumeration<NetworkInterface> en;
try {
en = NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
- throw new UnknownHostException ("could not enumerate local network interfaces");
+ throw new UnknownHostException(
+ "could not enumerate local network interfaces");
}
while (en.hasMoreElements()) {
NetworkInterface ifc = en.nextElement();
- if (ifc.getName().equals (ifname)) {
+ if (ifc.getName().equals(ifname)) {
Enumeration<InetAddress> addresses = ifc.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress addr = addresses.nextElement();
@@ -400,7 +409,8 @@
}
}
}
- throw new UnknownHostException ("No matching address found for interface : " +ifname);
+ throw new UnknownHostException(
+ "No matching address found for interface : " +ifname);
}
/**
@@ -410,22 +420,14 @@
*/
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException {
- scope_ifname = null;
- scope_ifname_set = false;
s.defaultReadObject();
- if (ifname != null && !"".equals (ifname)) {
+ if (ifname != null && !ifname.equals("")) {
try {
scope_ifname = NetworkInterface.getByName(ifname);
- if (scope_ifname == null) {
- /* the interface does not exist on this system, so we clear
- * the scope information completely */
- scope_id_set = false;
- scope_ifname_set = false;
- scope_id = 0;
- } else {
+ if (scope_ifname != null) {
try {
- scope_id = deriveNumericScope (scope_ifname);
+ scope_id = deriveNumericScope(scope_ifname);
} catch (UnknownHostException e) {
// typically should not happen, but it may be that
// the machine being used for deserialization has
@@ -455,8 +457,9 @@
* address. 11111111 at the start of the address identifies the
* address as being a multicast address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * an IP multicast address
+ * @return a {@code boolean} indicating if the InetAddress is an IP
+ * multicast address
+ *
* @since JDK1.1
*/
@Override
@@ -466,8 +469,10 @@
/**
* Utility routine to check if the InetAddress in a wildcard address.
- * @return a <code>boolean</code> indicating if the Inetaddress is
+ *
+ * @return a {@code boolean} indicating if the Inetaddress is
* a wildcard address.
+ *
* @since 1.4
*/
@Override
@@ -482,8 +487,9 @@
/**
* Utility routine to check if the InetAddress is a loopback address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * a loopback address; or false otherwise.
+ * @return a {@code boolean} indicating if the InetAddress is a loopback
+ * address; or false otherwise.
+ *
* @since 1.4
*/
@Override
@@ -498,8 +504,9 @@
/**
* Utility routine to check if the InetAddress is an link local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * a link local address; or false if address is not a link local unicast address.
+ * @return a {@code boolean} indicating if the InetAddress is a link local
+ * address; or false if address is not a link local unicast address.
+ *
* @since 1.4
*/
@Override
@@ -511,8 +518,9 @@
/**
* Utility routine to check if the InetAddress is a site local address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * a site local address; or false if address is not a site local unicast address.
+ * @return a {@code boolean} indicating if the InetAddress is a site local
+ * address; or false if address is not a site local unicast address.
+ *
* @since 1.4
*/
@Override
@@ -524,9 +532,10 @@
/**
* Utility routine to check if the multicast address has global scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of global scope, false if it is not
- * of global scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of global scope, false if it is not of global scope or
+ * it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -538,9 +547,10 @@
/**
* Utility routine to check if the multicast address has node scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of node-local scope, false if it is not
- * of node-local scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of node-local scope, false if it is not of node-local
+ * scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -552,9 +562,10 @@
/**
* Utility routine to check if the multicast address has link scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of link-local scope, false if it is not
- * of link-local scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of link-local scope, false if it is not of link-local
+ * scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -566,9 +577,10 @@
/**
* Utility routine to check if the multicast address has site scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of site-local scope, false if it is not
- * of site-local scope or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of site-local scope, false if it is not of site-local
+ * scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -580,10 +592,10 @@
/**
* Utility routine to check if the multicast address has organization scope.
*
- * @return a <code>boolean</code> indicating if the address has
- * is a multicast address of organization-local scope,
- * false if it is not of organization-local scope
- * or it is not a multicast address
+ * @return a {@code boolean} indicating if the address has is a multicast
+ * address of organization-local scope, false if it is not of
+ * organization-local scope or it is not a multicast address
+ *
* @since 1.4
*/
@Override
@@ -593,9 +605,9 @@
}
/**
- * Returns the raw IP address of this <code>InetAddress</code>
- * object. The result is in network byte order: the highest order
- * byte of the address is in <code>getAddress()[0]</code>.
+ * Returns the raw IP address of this {@code InetAddress} object. The result
+ * is in network byte order: the highest order byte of the address is in
+ * {@code getAddress()[0]}.
*
* @return the raw IP address of this object.
*/
@@ -609,9 +621,10 @@
* an interface. If no scoped_id is set, the returned value is zero.
*
* @return the scopeId, or zero if not set.
+ *
* @since 1.5
*/
- public int getScopeId () {
+ public int getScopeId() {
return scope_id;
}
@@ -622,22 +635,23 @@
* @return the scoped interface, or null if not set.
* @since 1.5
*/
- public NetworkInterface getScopedInterface () {
+ public NetworkInterface getScopedInterface() {
return scope_ifname;
}
/**
- * Returns the IP address string in textual presentation. If the instance was created
- * specifying a scope identifier then the scope id is appended to the IP address preceded by
- * a "%" (per-cent) character. This can be either a numeric value or a string, depending on which
- * was used to createthe instance.
+ * Returns the IP address string in textual presentation. If the instance
+ * was created specifying a scope identifier then the scope id is appended
+ * to the IP address preceded by a "%" (per-cent) character. This can be
+ * either a numeric value or a string, depending on which was used to create
+ * the instance.
*
* @return the raw IP address in a string format.
*/
@Override
public String getHostAddress() {
String s = numericToTextFormat(ipaddress);
- if (scope_ifname_set) { /* must check this first */
+ if (scope_ifname != null) { /* must check this first */
s = s + "%" + scope_ifname.getName();
} else if (scope_id_set) {
s = s + "%" + scope_id;
@@ -674,29 +688,27 @@
}
/**
- * Compares this object against the specified object.
- * The result is <code>true</code> if and only if the argument is
- * not <code>null</code> and it represents the same IP address as
- * this object.
- * <p>
- * Two instances of <code>InetAddress</code> represent the same IP
- * address if the length of the byte arrays returned by
- * <code>getAddress</code> is the same for both, and each of the
- * array components is the same for the byte arrays.
+ * Compares this object against the specified object. The result is {@code
+ * true} if and only if the argument is not {@code null} and it represents
+ * the same IP address as this object.
+ *
+ * <p> Two instances of {@code InetAddress} represent the same IP address
+ * if the length of the byte arrays returned by {@code getAddress} is the
+ * same for both, and each of the array components is the same for the byte
+ * arrays.
*
* @param obj the object to compare against.
- * @return <code>true</code> if the objects are the same;
- * <code>false</code> otherwise.
+ *
+ * @return {@code true} if the objects are the same; {@code false} otherwise.
+ *
* @see java.net.InetAddress#getAddress()
*/
@Override
public boolean equals(Object obj) {
- if (obj == null ||
- !(obj instanceof Inet6Address))
+ if (obj == null || !(obj instanceof Inet6Address))
return false;
Inet6Address inetAddr = (Inet6Address)obj;
-
for (int i = 0; i < INADDRSZ; i++) {
if (ipaddress[i] != inetAddr.ipaddress[i])
return false;
@@ -709,8 +721,9 @@
* Utility routine to check if the InetAddress is an
* IPv4 compatible IPv6 address.
*
- * @return a <code>boolean</code> indicating if the InetAddress is
- * an IPv4 compatible IPv6 address; or false if address is IPv4 address.
+ * @return a {@code boolean} indicating if the InetAddress is an IPv4
+ * compatible IPv6 address; or false if address is IPv4 address.
+ *
* @since 1.4
*/
public boolean isIPv4CompatibleAddress() {
@@ -727,6 +740,7 @@
// Utilities
private final static int INT16SZ = 2;
+
/*
* Convert IPv6 binary address into presentation (printable) format.
*
@@ -735,9 +749,8 @@
* textual representation format
* @since 1.4
*/
- static String numericToTextFormat(byte[] src)
- {
- StringBuffer sb = new StringBuffer(39);
+ static String numericToTextFormat(byte[] src) {
+ StringBuilder sb = new StringBuilder(39);
for (int i = 0; i < (INADDRSZ / INT16SZ); i++) {
sb.append(Integer.toHexString(((src[i<<1]<<8) & 0xff00)
| (src[(i<<1)+1] & 0xff)));
@@ -766,9 +779,8 @@
private synchronized void writeObject(java.io.ObjectOutputStream s)
throws IOException
{
- if (scope_ifname_set) {
+ if (scope_ifname != null)
ifname = scope_ifname.getName();
- }
s.defaultWriteObject();
}
}
--- a/jdk/src/share/classes/java/net/doc-files/net-properties.html Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/net/doc-files/net-properties.html Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
@@ -237,6 +237,6 @@
</UL>
<P>Since these 2 properties are part of the security policy, they are
not set by either the -D option or the System.setProperty() API,
-instead they are set in the JRE security policy file <code>lib/security/java.security</code>.</P>
+instead they are set as security properties.</P>
</BODY>
</HTML>
--- a/jdk/src/share/classes/java/security/KeyStore.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/security/KeyStore.java Mon Dec 24 11:46:38 2012 -0800
@@ -695,27 +695,23 @@
}
/**
- * Returns the default keystore type as specified in the Java security
- * properties file, or the string
- * "jks" (acronym for "Java keystore")
+ * Returns the default keystore type as specified by the
+ * {@code keystore.type} security property, or the string
+ * {@literal "jks"} (acronym for {@literal "Java keystore"})
* if no such property exists.
- * The Java security properties file is located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
*
* <p>The default keystore type can be used by applications that do not
* want to use a hard-coded keystore type when calling one of the
- * <code>getInstance</code> methods, and want to provide a default keystore
+ * {@code getInstance} methods, and want to provide a default keystore
* type in case a user does not specify its own.
*
* <p>The default keystore type can be changed by setting the value of the
- * "keystore.type" security property (in the Java security properties
- * file) to the desired keystore type.
+ * {@code keystore.type} security property to the desired keystore type.
*
- * @return the default keystore type as specified in the
- * Java security properties file, or the string "jks"
+ * @return the default keystore type as specified by the
+ * {@code keystore.type} security property, or the string {@literal "jks"}
* if no such property exists.
+ * @see java.security.Security security properties
*/
public final static String getDefaultType() {
String kstype;
--- a/jdk/src/share/classes/java/security/Policy.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/security/Policy.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -48,12 +48,8 @@
* <code>getPolicy</code> installs an instance of the default Policy
* implementation (a default subclass implementation of this abstract class).
* The default Policy implementation can be changed by setting the value
- * of the "policy.provider" security property (in the Java security properties
- * file) to the fully qualified name of the desired Policy subclass
- * implementation. The Java security properties file is located in the
- * file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * of the {@code policy.provider} security property to the fully qualified
+ * name of the desired Policy subclass implementation.
*
* <p> Application code can directly subclass Policy to provide a custom
* implementation. In addition, an instance of a Policy object can be
@@ -84,6 +80,7 @@
* @see java.security.Provider
* @see java.security.ProtectionDomain
* @see java.security.Permission
+ * @see java.security.Security security properties
*/
public abstract class Policy {
--- a/jdk/src/share/classes/java/security/Security.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/security/Security.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,10 @@
* <p>This class centralizes all security properties and common security
* methods. One of its primary uses is to manage providers.
*
+ * <p>The default values of security properties are read from an
+ * implementation-specific location, which is typically the properties file
+ * {@code lib/security/java.security} in the Java installation directory.
+ *
* @author Benjamin Renaud
*/
--- a/jdk/src/share/classes/java/security/cert/CertPathBuilder.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/security/cert/CertPathBuilder.java Mon Dec 24 11:46:38 2012 -0800
@@ -281,25 +281,23 @@
}
/**
- * Returns the default <code>CertPathBuilder</code> type as specified in
- * the Java security properties file, or the string "PKIX"
- * if no such property exists. The Java security properties file is
- * located in the file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * Returns the default {@code CertPathBuilder} type as specified by
+ * the {@code certpathbuilder.type} security property, or the string
+ * {@literal "PKIX"} if no such property exists.
*
- * <p>The default <code>CertPathBuilder</code> type can be used by
+ * <p>The default {@code CertPathBuilder} type can be used by
* applications that do not want to use a hard-coded type when calling one
- * of the <code>getInstance</code> methods, and want to provide a default
+ * of the {@code getInstance} methods, and want to provide a default
* type in case a user does not specify its own.
*
- * <p>The default <code>CertPathBuilder</code> type can be changed by
- * setting the value of the "certpathbuilder.type" security property
- * (in the Java security properties file) to the desired type.
+ * <p>The default {@code CertPathBuilder} type can be changed by
+ * setting the value of the {@code certpathbuilder.type} security property
+ * to the desired type.
*
- * @return the default <code>CertPathBuilder</code> type as specified
- * in the Java security properties file, or the string "PKIX"
- * if no such property exists.
+ * @see java.security.Security security properties
+ * @return the default {@code CertPathBuilder} type as specified
+ * by the {@code certpathbuilder.type} security property, or the string
+ * {@literal "PKIX"} if no such property exists.
*/
public final static String getDefaultType() {
String cpbtype =
--- a/jdk/src/share/classes/java/security/cert/CertPathValidator.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/security/cert/CertPathValidator.java Mon Dec 24 11:46:38 2012 -0800
@@ -293,25 +293,23 @@
}
/**
- * Returns the default <code>CertPathValidator</code> type as specified in
- * the Java security properties file, or the string "PKIX"
- * if no such property exists. The Java security properties file is
- * located in the file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * Returns the default {@code CertPathValidator} type as specified by
+ * the {@code certpathvalidator.type} security property, or the string
+ * {@literal "PKIX"} if no such property exists.
*
- * <p>The default <code>CertPathValidator</code> type can be used by
+ * <p>The default {@code CertPathValidator} type can be used by
* applications that do not want to use a hard-coded type when calling one
- * of the <code>getInstance</code> methods, and want to provide a default
+ * of the {@code getInstance} methods, and want to provide a default
* type in case a user does not specify its own.
*
- * <p>The default <code>CertPathValidator</code> type can be changed by
- * setting the value of the "certpathvalidator.type" security property
- * (in the Java security properties file) to the desired type.
+ * <p>The default {@code CertPathValidator} type can be changed by
+ * setting the value of the {@code certpathvalidator.type} security
+ * property to the desired type.
*
- * @return the default <code>CertPathValidator</code> type as specified
- * in the Java security properties file, or the string "PKIX"
- * if no such property exists.
+ * @see java.security.Security security properties
+ * @return the default {@code CertPathValidator} type as specified
+ * by the {@code certpathvalidator.type} security property, or the string
+ * {@literal "PKIX"} if no such property exists.
*/
public final static String getDefaultType() {
String cpvtype =
--- a/jdk/src/share/classes/java/security/cert/CertStore.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/security/cert/CertStore.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -389,25 +389,23 @@
}
/**
- * Returns the default <code>CertStore</code> type as specified in the
- * Java security properties file, or the string "LDAP" if no
- * such property exists. The Java security properties file is located in
- * the file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * Returns the default {@code CertStore} type as specified by the
+ * {@code certstore.type} security property, or the string
+ * {@literal "LDAP"} if no such property exists.
*
- * <p>The default <code>CertStore</code> type can be used by applications
+ * <p>The default {@code CertStore} type can be used by applications
* that do not want to use a hard-coded type when calling one of the
- * <code>getInstance</code> methods, and want to provide a default
- * <code>CertStore</code> type in case a user does not specify its own.
+ * {@code getInstance} methods, and want to provide a default
+ * {@code CertStore} type in case a user does not specify its own.
*
- * <p>The default <code>CertStore</code> type can be changed by setting
- * the value of the "certstore.type" security property (in the Java
- * security properties file) to the desired type.
+ * <p>The default {@code CertStore} type can be changed by setting
+ * the value of the {@code certstore.type} security property to the
+ * desired type.
*
- * @return the default <code>CertStore</code> type as specified in the
- * Java security properties file, or the string "LDAP"
- * if no such property exists.
+ * @see java.security.Security security properties
+ * @return the default {@code CertStore} type as specified by the
+ * {@code certstore.type} security property, or the string
+ * {@literal "LDAP"} if no such property exists.
*/
public final static String getDefaultType() {
String cstype;
--- a/jdk/src/share/classes/java/text/DateFormatSymbols.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/text/DateFormatSymbols.java Mon Dec 24 11:46:38 2012 -0800
@@ -688,7 +688,16 @@
}
ResourceBundle resource = adapter.getLocaleData().getDateFormatData(locale);
- eras = resource.getStringArray("Eras");
+ // JRE and CLDR use different keys
+ // JRE: Eras, short.Eras and narrow.Eras
+ // CLDR: long.Eras, Eras and narrow.Eras
+ if (resource.containsKey("Eras")) {
+ eras = resource.getStringArray("Eras");
+ } else if (resource.containsKey("long.Eras")) {
+ eras = resource.getStringArray("long.Eras");
+ } else if (resource.containsKey("short.Eras")) {
+ eras = resource.getStringArray("short.Eras");
+ }
months = resource.getStringArray("MonthNames");
shortMonths = resource.getStringArray("MonthAbbreviations");
ampms = resource.getStringArray("AmPmMarkers");
--- a/jdk/src/share/classes/java/text/SimpleDateFormat.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java Mon Dec 24 11:46:38 2012 -0800
@@ -48,12 +48,13 @@
import java.util.Locale;
import java.util.Map;
import java.util.SimpleTimeZone;
+import java.util.SortedMap;
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import sun.util.locale.provider.LocaleProviderAdapter;
import sun.util.calendar.CalendarUtils;
import sun.util.calendar.ZoneInfoFile;
+import sun.util.locale.provider.LocaleProviderAdapter;
/**
* <code>SimpleDateFormat</code> is a concrete class for formatting and
@@ -1593,6 +1594,17 @@
private int matchString(String text, int start, int field,
Map<String,Integer> data, CalendarBuilder calb) {
if (data != null) {
+ // TODO: make this default when it's in the spec.
+ if (data instanceof SortedMap) {
+ for (String name : data.keySet()) {
+ if (text.regionMatches(true, start, name, 0, name.length())) {
+ calb.set(field, data.get(name));
+ return start + name.length();
+ }
+ }
+ return -start;
+ }
+
String bestMatch = null;
for (String name : data.keySet()) {
@@ -1803,7 +1815,7 @@
boolean obeyCount, boolean[] ambiguousYear,
ParsePosition origPos,
boolean useFollowingMinusSignAsDelimiter, CalendarBuilder calb) {
- Number number = null;
+ Number number;
int value = 0;
ParsePosition pos = new ParsePosition(0);
pos.index = start;
@@ -1876,9 +1888,7 @@
return index;
}
} else {
- Map<String, Integer> map = calendar.getDisplayNames(field,
- Calendar.ALL_STYLES,
- locale);
+ Map<String, Integer> map = getDisplayNamesMap(field, locale);
if ((index = matchString(text, start, field, map, calb)) > 0) {
return index;
}
@@ -1940,7 +1950,7 @@
// count >= 3 // i.e., MMM or MMMM
// Want to be able to parse both short and long forms.
// Try count == 4 first:
- int newStart = 0;
+ int newStart;
if ((newStart = matchString(text, start, Calendar.MONTH,
formatData.getMonths(), calb)) > 0) {
return newStart;
@@ -1951,9 +1961,7 @@
return index;
}
} else {
- Map<String, Integer> map = calendar.getDisplayNames(field,
- Calendar.ALL_STYLES,
- locale);
+ Map<String, Integer> map = getDisplayNamesMap(field, locale);
if ((index = matchString(text, start, field, map, calb)) > 0) {
return index;
}
@@ -1979,7 +1987,7 @@
if (useDateFormatSymbols) {
// Want to be able to parse both short and long forms.
// Try count == 4 (DDDD) first:
- int newStart = 0;
+ int newStart;
if ((newStart=matchString(text, start, Calendar.DAY_OF_WEEK,
formatData.getWeekdays(), calb)) > 0) {
return newStart;
@@ -2008,7 +2016,7 @@
return index;
}
} else {
- Map<String,Integer> map = calendar.getDisplayNames(field, Calendar.ALL_STYLES, locale);
+ Map<String,Integer> map = getDisplayNamesMap(field, locale);
if ((index = matchString(text, start, field, map, calb)) > 0) {
return index;
}
@@ -2098,7 +2106,7 @@
break parsing;
}
- int sign = 0;
+ int sign;
char c = text.charAt(pos.index);
if (c == 'Z') {
calb.set(Calendar.ZONE_OFFSET, 0).set(Calendar.DST_OFFSET, 0);
@@ -2340,6 +2348,21 @@
&& formatData.equals(that.formatData));
}
+ private static final int[] REST_OF_STYLES = {
+ Calendar.SHORT_STANDALONE, Calendar.LONG_FORMAT, Calendar.LONG_STANDALONE,
+ };
+ private Map<String, Integer> getDisplayNamesMap(int field, Locale locale) {
+ Map<String, Integer> map = calendar.getDisplayNames(field, Calendar.SHORT_FORMAT, locale);
+ // Get all SHORT and LONG styles (avoid NARROW styles).
+ for (int style : REST_OF_STYLES) {
+ Map<String, Integer> m = calendar.getDisplayNames(field, style, locale);
+ if (m != null) {
+ map.putAll(m);
+ }
+ }
+ return map;
+ }
+
/**
* After reading an object from the input stream, the format
* pattern in the object is verified.
--- a/jdk/src/share/classes/java/util/Base64.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/Base64.java Mon Dec 24 11:46:38 2012 -0800
@@ -289,8 +289,8 @@
*
* <p> This method first encodes all input bytes into a base64 encoded
* byte array and then constructs a new String by using the encoded byte
- * array and the {@link java.nio.charset.StandardCharsets.ISO_8859_1 ISO-8859-1}
- * charset.
+ * array and the {@link java.nio.charset.StandardCharsets#ISO_8859_1
+ * ISO-8859-1} charset.
*
* <p> In other words, an invocation of this method has exactly the same
* effect as invoking
@@ -358,9 +358,9 @@
* to encode any more input bytes. The encoding operation can be
* continued, if there is more bytes in input buffer to be encoded,
* by invoking this method again with an output buffer that has more
- * {@linkplain Buffer#remaining remaining} bytes. This is typically
- * done by draining any encoded bytes from the output buffer. The
- * value returned from last invocation needs to be passed in as the
+ * {@linkplain java.nio.Buffer#remaining remaining} bytes. This is
+ * typically done by draining any encoded bytes from the output buffer.
+ * The value returned from last invocation needs to be passed in as the
* third parameter {@code bytesOut} if it is to continue an unfinished
* encoding, 0 otherwise.
*
@@ -806,9 +806,9 @@
* buffer has insufficient space to decode any more input bytes.
* The decoding operation can be continued, if there is more bytes
* in input buffer to be decoded, by invoking this method again with
- * an output buffer that has more {@linkplain Buffer#remaining remaining}
- * bytes.This is typically done by draining any decoded bytes from the
- * output buffer.
+ * an output buffer that has more {@linkplain java.nio.Buffer#remaining
+ * remaining} bytes. This is typically done by draining any decoded
+ * bytes from the output buffer.
*
* <p><b>Recommended Usage Example</b>
* <pre>
--- a/jdk/src/share/classes/java/util/Calendar.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/Calendar.java Mon Dec 24 11:46:38 2012 -0800
@@ -53,9 +53,7 @@
import java.text.DateFormatSymbols;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import java.util.spi.CalendarDataProvider;
import sun.util.BuddhistCalendar;
-import sun.util.locale.provider.LocaleProviderAdapter;
import sun.util.calendar.ZoneInfo;
import sun.util.locale.provider.CalendarDataUtility;
@@ -746,6 +744,32 @@
/**
* A style specifier for {@link #getDisplayName(int, int, Locale)
* getDisplayName} and {@link #getDisplayNames(int, int, Locale)
+ * getDisplayNames} indicating a narrow name used for format. Narrow names
+ * are typically single character strings, such as "M" for Monday.
+ *
+ * @see #NARROW_STANDALONE
+ * @see #SHORT_FORMAT
+ * @see #LONG_FOTMAT
+ * @since 1.8
+ */
+ public static final int NARROW_FORMAT = 4;
+
+ /**
+ * A style specifier for {@link #getDisplayName(int, int, Locale)
+ * getDisplayName} and {@link #getDisplayNames(int, int, Locale)
+ * getDisplayNames} indicating a narrow name independently. Narrow names
+ * are typically single character strings, such as "M" for Monday.
+ *
+ * @see #NARROW_FORMAT
+ * @see #SHORT_STANDALONE
+ * @see #LONG_STANDALONE
+ * @since 1.8
+ */
+ public static final int NARROW_STANDALONE = NARROW_FORMAT | STANDALONE_MASK;
+
+ /**
+ * A style specifier for {@link #getDisplayName(int, int, Locale)
+ * getDisplayName} and {@link #getDisplayNames(int, int, Locale)
* getDisplayNames} indicating a short name used for format.
*
* @see #SHORT_STANDALONE
@@ -1472,30 +1496,31 @@
* @param style
* the style applied to the string representation; one of {@link
* #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE},
- * {@link #LONG_FORMAT} ({@link #LONG}) or {@link #LONG_STANDALONE}.
+ * {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE},
+ * {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE}.
* @param locale
* the locale for the string representation
* (any calendar types specified by {@code locale} are ignored)
* @return the string representation of the given
- * <code>field</code> in the given <code>style</code>, or
- * <code>null</code> if no string representation is
+ * {@code field} in the given {@code style}, or
+ * {@code null} if no string representation is
* applicable.
* @exception IllegalArgumentException
- * if <code>field</code> or <code>style</code> is invalid,
- * or if this <code>Calendar</code> is non-lenient and any
+ * if {@code field} or {@code style} is invalid,
+ * or if this {@code Calendar} is non-lenient and any
* of the calendar fields have invalid values
* @exception NullPointerException
- * if <code>locale</code> is null
+ * if {@code locale} is null
* @since 1.6
*/
public String getDisplayName(int field, int style, Locale locale) {
- if (!checkDisplayNameParams(field, style, SHORT, LONG, locale,
+ if (!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale,
ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
return null;
}
- // the standalone styles are supported only through CalendarDataProviders.
- if (isStandaloneStyle(style)) {
+ // the standalone and narrow styles are supported only through CalendarDataProviders.
+ if (isStandaloneStyle(style) || isNarrowStyle(style)) {
return CalendarDataUtility.retrieveFieldValueName(getCalendarType(),
field, get(field),
style, locale);
@@ -1513,26 +1538,30 @@
}
/**
- * Returns a <code>Map</code> containing all names of the calendar
- * <code>field</code> in the given <code>style</code> and
- * <code>locale</code> and their corresponding field values. For
- * example, if this <code>Calendar</code> is a {@link
+ * Returns a {@code Map} containing all names of the calendar
+ * {@code field} in the given {@code style} and
+ * {@code locale} and their corresponding field values. For
+ * example, if this {@code Calendar} is a {@link
* GregorianCalendar}, the returned map would contain "Jan" to
* {@link #JANUARY}, "Feb" to {@link #FEBRUARY}, and so on, in the
* {@linkplain #SHORT short} style in an English locale.
*
+ * <p>Narrow names may not be unique due to use of single characters,
+ * such as "S" for Sunday and Saturday. In that case narrow names are not
+ * included in the returned {@code Map}.
+ *
* <p>The values of other calendar fields may be taken into
* account to determine a set of display names. For example, if
- * this <code>Calendar</code> is a lunisolar calendar system and
+ * this {@code Calendar} is a lunisolar calendar system and
* the year value given by the {@link #YEAR} field has a leap
* month, this method would return month names containing the leap
* month name, and month names are mapped to their values specific
* for the year.
*
* <p>The default implementation supports display names contained in
- * a {@link DateFormatSymbols}. For example, if <code>field</code>
- * is {@link #MONTH} and <code>style</code> is {@link
- * #ALL_STYLES}, this method returns a <code>Map</code> containing
+ * a {@link DateFormatSymbols}. For example, if {@code field}
+ * is {@link #MONTH} and {@code style} is {@link
+ * #ALL_STYLES}, this method returns a {@code Map} containing
* all strings returned by {@link DateFormatSymbols#getShortMonths()}
* and {@link DateFormatSymbols#getMonths()}.
*
@@ -1541,30 +1570,31 @@
* @param style
* the style applied to the string representation; one of {@link
* #SHORT_FORMAT} ({@link #SHORT}), {@link #SHORT_STANDALONE},
- * {@link #LONG_FORMAT} ({@link #LONG}) or {@link #LONG_STANDALONE}.
+ * {@link #LONG_FORMAT} ({@link #LONG}), {@link #LONG_STANDALONE},
+ * {@link #NARROW_FORMAT}, or {@link #NARROW_STANDALONE}
* @param locale
* the locale for the display names
- * @return a <code>Map</code> containing all display names in
- * <code>style</code> and <code>locale</code> and their
- * field values, or <code>null</code> if no display names
- * are defined for <code>field</code>
+ * @return a {@code Map} containing all display names in
+ * {@code style} and {@code locale} and their
+ * field values, or {@code null} if no display names
+ * are defined for {@code field}
* @exception IllegalArgumentException
- * if <code>field</code> or <code>style</code> is invalid,
- * or if this <code>Calendar</code> is non-lenient and any
+ * if {@code field} or {@code style} is invalid,
+ * or if this {@code Calendar} is non-lenient and any
* of the calendar fields have invalid values
* @exception NullPointerException
- * if <code>locale</code> is null
+ * if {@code locale} is null
* @since 1.6
*/
public Map<String, Integer> getDisplayNames(int field, int style, Locale locale) {
- if (!checkDisplayNameParams(field, style, ALL_STYLES, LONG, locale,
+ if (!checkDisplayNameParams(field, style, ALL_STYLES, NARROW_FORMAT, locale,
ERA_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
return null;
}
if (style == ALL_STYLES || isStandaloneStyle(style)) {
return CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
}
- // SHORT or LONG
+ // SHORT, LONG, or NARROW
return getDisplayNamesImpl(field, style, locale);
}
@@ -1599,6 +1629,12 @@
private String[] getFieldStrings(int field, int style, DateFormatSymbols symbols) {
int baseStyle = getBaseStyle(style); // ignore the standalone mask
+
+ // DateFormatSymbols doesn't support any narrow names.
+ if (baseStyle == NARROW_FORMAT) {
+ return null;
+ }
+
String[] strings = null;
switch (field) {
case ERA:
@@ -1948,6 +1984,10 @@
return (style & STANDALONE_MASK) != 0;
}
+ boolean isNarrowStyle(int style) {
+ return style == NARROW_FORMAT || style == NARROW_STANDALONE;
+ }
+
/**
* Returns the pseudo-time-stamp for two fields, given their
* individual pseudo-time-stamps. If either of the fields
--- a/jdk/src/share/classes/java/util/JapaneseImperialCalendar.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/JapaneseImperialCalendar.java Mon Dec 24 11:46:38 2012 -0800
@@ -946,8 +946,9 @@
set(field, getRolledValue(internalGet(field), amount, min, max));
}
+ @Override
public String getDisplayName(int field, int style, Locale locale) {
- if (!checkDisplayNameParams(field, style, SHORT, LONG, locale,
+ if (!checkDisplayNameParams(field, style, SHORT, NARROW_FORMAT, locale,
ERA_MASK|YEAR_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
return null;
}
@@ -956,11 +957,12 @@
// "GanNen" is supported only in the LONG style.
if (field == YEAR
- && (getBaseStyle(style) == SHORT || fieldValue != 1 || get(ERA) == 0)) {
+ && (getBaseStyle(style) != LONG || fieldValue != 1 || get(ERA) == 0)) {
return null;
}
- String name = CalendarDataUtility.retrieveFieldValueName("japanese", field, fieldValue, style, locale);
+ String name = CalendarDataUtility.retrieveFieldValueName(getCalendarType(), field,
+ fieldValue, style, locale);
// If the ERA value is null, then
// try to get its name or abbreviation from the Era instance.
if (name == null && field == ERA && fieldValue < eras.length) {
@@ -970,27 +972,37 @@
return name;
}
+ @Override
public Map<String,Integer> getDisplayNames(int field, int style, Locale locale) {
- if (!checkDisplayNameParams(field, style, ALL_STYLES, LONG, locale,
+ if (!checkDisplayNameParams(field, style, ALL_STYLES, NARROW_FORMAT, locale,
ERA_MASK|YEAR_MASK|MONTH_MASK|DAY_OF_WEEK_MASK|AM_PM_MASK)) {
return null;
}
- Map<String, Integer> names = CalendarDataUtility.retrieveFieldValueNames("japanese", field, style, locale);
+ Map<String, Integer> names;
+ names = CalendarDataUtility.retrieveFieldValueNames(getCalendarType(), field, style, locale);
// If strings[] has fewer than eras[], get more names from eras[].
- if (field == ERA) {
- int size = names.size();
- if (style == ALL_STYLES) {
- size /= 2; // SHORT and LONG
- }
- if (size < eras.length) {
- int baseStyle = getBaseStyle(style);
- for (int i = size; i < eras.length; i++) {
- Era era = eras[i];
- if (baseStyle == ALL_STYLES || baseStyle == SHORT) {
- names.put(era.getAbbreviation(), i);
+ if (names != null) {
+ if (field == ERA) {
+ int size = names.size();
+ if (style == ALL_STYLES) {
+ Set<Integer> values = new HashSet<>();
+ // count unique era values
+ for (String key : names.keySet()) {
+ values.add(names.get(key));
}
- if (baseStyle == ALL_STYLES || baseStyle == LONG) {
- names.put(era.getName(), i);
+ size = values.size();
+ }
+ if (size < eras.length) {
+ int baseStyle = getBaseStyle(style);
+ for (int i = size; i < eras.length; i++) {
+ Era era = eras[i];
+ if (baseStyle == ALL_STYLES || baseStyle == SHORT
+ || baseStyle == NARROW_FORMAT) {
+ names.put(era.getAbbreviation(), i);
+ }
+ if (baseStyle == ALL_STYLES || baseStyle == LONG) {
+ names.put(era.getName(), i);
+ }
}
}
}
--- a/jdk/src/share/classes/java/util/TimeZone.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/TimeZone.java Mon Dec 24 11:46:38 2012 -0800
@@ -43,12 +43,12 @@
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.concurrent.ConcurrentHashMap;
+import sun.misc.JavaAWTAccess;
import sun.misc.SharedSecrets;
-import sun.misc.JavaAWTAccess;
import sun.security.action.GetPropertyAction;
-import sun.util.locale.provider.TimeZoneNameUtility;
import sun.util.calendar.ZoneInfo;
import sun.util.calendar.ZoneInfoFile;
+import sun.util.locale.provider.TimeZoneNameUtility;
/**
* <code>TimeZone</code> represents a time zone offset, and also figures out daylight
@@ -399,28 +399,23 @@
if (style != SHORT && style != LONG) {
throw new IllegalArgumentException("Illegal style: " + style);
}
-
String id = getID();
- String[] names = getDisplayNames(id, locale);
- if (names == null) {
- if (id.startsWith("GMT") && id.length() > 3) {
- char sign = id.charAt(3);
- if (sign == '+' || sign == '-') {
- return id;
- }
- }
- int offset = getRawOffset();
- if (daylight) {
- offset += getDSTSavings();
- }
- return ZoneInfoFile.toCustomID(offset);
+ String name = TimeZoneNameUtility.retrieveDisplayName(id, daylight, style, locale);
+ if (name != null) {
+ return name;
}
- int index = daylight ? 3 : 1;
- if (style == SHORT) {
- index++;
+ if (id.startsWith("GMT") && id.length() > 3) {
+ char sign = id.charAt(3);
+ if (sign == '+' || sign == '-') {
+ return id;
+ }
}
- return names[index];
+ int offset = getRawOffset();
+ if (daylight) {
+ offset += getDSTSavings();
+ }
+ return ZoneInfoFile.toCustomID(offset);
}
private static class DisplayNames {
@@ -429,9 +424,12 @@
// Map(key=id, value=SoftReference(Map(key=locale, value=displaynames)))
private static final Map<String, SoftReference<Map<Locale, String[]>>> CACHE =
new ConcurrentHashMap<>();
+
+ private DisplayNames() {
+ }
}
- private static final String[] getDisplayNames(String id, Locale locale) {
+ private static String[] getDisplayNames(String id, Locale locale) {
Map<String, SoftReference<Map<Locale, String[]>>> displayNames = DisplayNames.CACHE;
SoftReference<Map<Locale, String[]>> ref = displayNames.get(id);
@@ -631,14 +629,14 @@
}
private static synchronized TimeZone setDefaultZone() {
- TimeZone tz = null;
+ TimeZone tz;
// get the time zone ID from the system properties
String zoneID = AccessController.doPrivileged(
new GetPropertyAction("user.timezone"));
// if the time zone ID is not set (yet), perform the
// platform to Java time zone ID mapping.
- if (zoneID == null || zoneID.equals("")) {
+ if (zoneID == null || zoneID.isEmpty()) {
String country = AccessController.doPrivileged(
new GetPropertyAction("user.country"));
String javaHome = AccessController.doPrivileged(
@@ -670,8 +668,9 @@
assert tz != null;
final String id = zoneID;
- AccessController.doPrivileged(new PrivilegedAction<Object>() {
- public Object run() {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ @Override
+ public Void run() {
System.setProperty("user.timezone", id);
return null;
}
--- a/jdk/src/share/classes/java/util/logging/LogManager.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,10 +31,10 @@
import java.security.*;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeEvent;
-import java.net.URL;
-import sun.security.action.GetPropertyAction;
/**
* There is a single global LogManager object that is used to
@@ -150,7 +150,7 @@
// The map of the registered listeners. The map value is the registration
// count to allow for cases where the same listener is registered many times.
- private final Map<PropertyChangeListener,Integer> listenerMap = new HashMap<>();
+ private final Map<Object,Integer> listenerMap = new HashMap<>();
// Table of named Loggers that maps names to Loggers.
private Hashtable<String,LoggerWeakRef> namedLoggers = new Hashtable<>();
@@ -243,7 +243,7 @@
* Protected constructor. This is protected so that container applications
* (such as J2EE containers) can subclass the object. It is non-public as
* it is intended that there only be one LogManager object, whose value is
- * retrieved by calling Logmanager.getLogManager.
+ * retrieved by calling LogManager.getLogManager.
*/
protected LogManager() {
// Add a shutdown hook to close the global handlers.
@@ -971,22 +971,24 @@
// Notify any interested parties that our properties have changed.
// We first take a copy of the listener map so that we aren't holding any
// locks when calling the listeners.
- Map<PropertyChangeListener,Integer> listeners = null;
+ Map<Object,Integer> listeners = null;
synchronized (listenerMap) {
if (!listenerMap.isEmpty())
listeners = new HashMap<>(listenerMap);
}
if (listeners != null) {
- PropertyChangeEvent ev = new PropertyChangeEvent(LogManager.class, null, null, null);
- for (Map.Entry<PropertyChangeListener,Integer> entry : listeners.entrySet()) {
- PropertyChangeListener listener = entry.getKey();
+ assert Beans.isBeansPresent();
+ Object ev = Beans.newPropertyChangeEvent(LogManager.class, null, null, null);
+ for (Map.Entry<Object,Integer> entry : listeners.entrySet()) {
+ Object listener = entry.getKey();
int count = entry.getValue().intValue();
for (int i = 0; i < count; i++) {
- listener.propertyChange(ev);
+ Beans.invokePropertyChange(listener, ev);
}
}
}
+
// Note that we need to reinitialize global handles when
// they are first referenced.
synchronized (this) {
@@ -1269,4 +1271,100 @@
return loggingMXBean;
}
+ /**
+ * A class that provides access to the java.beans.PropertyChangeListener
+ * and java.beans.PropertyChangeEvent without creating a static dependency
+ * on java.beans. This class can be removed once the addPropertyChangeListener
+ * and removePropertyChangeListener methods are removed.
+ */
+ private static class Beans {
+ private static final Class<?> propertyChangeListenerClass =
+ getClass("java.beans.PropertyChangeListener");
+
+ private static final Class<?> propertyChangeEventClass =
+ getClass("java.beans.PropertyChangeEvent");
+
+ private static final Method propertyChangeMethod =
+ getMethod(propertyChangeListenerClass,
+ "propertyChange",
+ propertyChangeEventClass);
+
+ private static final Constructor<?> propertyEventCtor =
+ getConstructor(propertyChangeEventClass,
+ Object.class,
+ String.class,
+ Object.class,
+ Object.class);
+
+ private static Class<?> getClass(String name) {
+ try {
+ return Class.forName(name, true, Beans.class.getClassLoader());
+ } catch (ClassNotFoundException e) {
+ return null;
+ }
+ }
+ private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
+ try {
+ return (c == null) ? null : c.getDeclaredConstructor(types);
+ } catch (NoSuchMethodException x) {
+ throw new AssertionError(x);
+ }
+ }
+
+ private static Method getMethod(Class<?> c, String name, Class<?>... types) {
+ try {
+ return (c == null) ? null : c.getMethod(name, types);
+ } catch (NoSuchMethodException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ /**
+ * Returns {@code true} if java.beans is present.
+ */
+ static boolean isBeansPresent() {
+ return propertyChangeListenerClass != null &&
+ propertyChangeEventClass != null;
+ }
+
+ /**
+ * Returns a new PropertyChangeEvent with the given source, property
+ * name, old and new values.
+ */
+ static Object newPropertyChangeEvent(Object source, String prop,
+ Object oldValue, Object newValue)
+ {
+ try {
+ return propertyEventCtor.newInstance(source, prop, oldValue, newValue);
+ } catch (InstantiationException | IllegalAccessException x) {
+ throw new AssertionError(x);
+ } catch (InvocationTargetException x) {
+ Throwable cause = x.getCause();
+ if (cause instanceof Error)
+ throw (Error)cause;
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException)cause;
+ throw new AssertionError(x);
+ }
+ }
+
+ /**
+ * Invokes the given PropertyChangeListener's propertyChange method
+ * with the given event.
+ */
+ static void invokePropertyChange(Object listener, Object ev) {
+ try {
+ propertyChangeMethod.invoke(listener, ev);
+ } catch (IllegalAccessException x) {
+ throw new AssertionError(x);
+ } catch (InvocationTargetException x) {
+ Throwable cause = x.getCause();
+ if (cause instanceof Error)
+ throw (Error)cause;
+ if (cause instanceof RuntimeException)
+ throw (RuntimeException)cause;
+ throw new AssertionError(x);
+ }
+ }
+ }
}
--- a/jdk/src/share/classes/java/util/spi/CalendarNameProvider.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/spi/CalendarNameProvider.java Mon Dec 24 11:46:38 2012 -0800
@@ -174,7 +174,8 @@
* <p>{@code style} gives the style of the string representation. It is one
* of {@link Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}),
* {@link Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT}
- * ({@link Calendar#LONG LONG}), or {@link Calendar#LONG_STANDALONE}.
+ * ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE},
+ * {@link Calendar#NARROW_FORMAT}, or {@link Calendar#NARROW_STANDALONE}.
*
* <p>For example, the following call will return {@code "Sunday"}.
* <pre>
@@ -195,8 +196,10 @@
* the string representation style: one of {@link
* Calendar#SHORT_FORMAT} ({@link Calendar#SHORT SHORT}),
* {@link Calendar#SHORT_STANDALONE}, {@link
- * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), or
- * {@link Calendar#LONG_STANDALONE}
+ * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}),
+ * {@link Calendar#LONG_STANDALONE},
+ * {@link Calendar#NARROW_FORMAT},
+ * or {@link Calendar#NARROW_STANDALONE}
* @param locale
* the desired locale
* @return the string representation of the {@code field value}, or {@code
@@ -226,8 +229,11 @@
* <p>{@code style} gives the style of the string representation. It must be
* one of {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT} ({@link
* Calendar#SHORT SHORT}), {@link Calendar#SHORT_STANDALONE}, {@link
- * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), or {@link
- * Calendar#LONG_STANDALONE}.
+ * Calendar#LONG_FORMAT} ({@link Calendar#LONG LONG}), {@link
+ * Calendar#LONG_STANDALONE}, {@link Calendar#NARROW_FORMAT}, or
+ * {@link Calendar#NARROW_STANDALONE}. Note that narrow names may
+ * not be unique due to use of single characters, such as "S" for Sunday
+ * and Saturday, and that no narrow names are included in that case.
*
* <p>For example, the following call will return a {@code Map} containing
* {@code "January"} to {@link Calendar#JANUARY}, {@code "Jan"} to {@link
@@ -247,8 +253,9 @@
* {@link Calendar#ALL_STYLES}, {@link Calendar#SHORT_FORMAT}
* ({@link Calendar#SHORT SHORT}), {@link
* Calendar#SHORT_STANDALONE}, {@link Calendar#LONG_FORMAT}
- * ({@link Calendar#LONG LONG}), or {@link
- * Calendar#LONG_STANDALONE}.
+ * ({@link Calendar#LONG LONG}), {@link Calendar#LONG_STANDALONE},
+ * {@link Calendar#NARROW_FORMAT},
+ * or {@link Calendar#NARROW_STANDALONE}
* @param locale
* the desired locale
* @return a {@code Map} containing all display names of {@code field} in
--- a/jdk/src/share/classes/java/util/spi/TimeZoneNameProvider.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/java/util/spi/TimeZoneNameProvider.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -77,4 +77,34 @@
* @see java.util.TimeZone#getDisplayName(boolean, int, java.util.Locale)
*/
public abstract String getDisplayName(String ID, boolean daylight, int style, Locale locale);
+
+ /**
+ * Returns a generic name for the given time zone {@code ID} that's suitable
+ * for presentation to the user in the specified {@code locale}. Generic
+ * time zone names are neutral from standard time and daylight saving
+ * time. For example, "PT" is the short generic name of time zone ID {@code
+ * America/Los_Angeles}, while its short standard time and daylight saving
+ * time names are "PST" and "PDT", respectively. Refer to
+ * {@link #getDisplayName(String, boolean, int, Locale) getDisplayName}
+ * for valid time zone IDs.
+ *
+ * <p>The default implementation of this method returns {@code null}.
+ *
+ * @param ID a time zone ID string
+ * @param style either {@link java.util.TimeZone#LONG TimeZone.LONG} or
+ * {@link java.util.TimeZone#SHORT TimeZone.SHORT}
+ * @param locale the desired locale
+ * @return the human-readable generic name of the given time zone in the
+ * given locale, or {@code null} if it's not available.
+ * @exception IllegalArgumentException if <code>style</code> is invalid,
+ * or <code>locale</code> isn't one of the locales returned from
+ * {@link LocaleServiceProvider#getAvailableLocales()
+ * getAvailableLocales()}.
+ * @exception NullPointerException if <code>ID</code> or <code>locale</code>
+ * is {@code null}
+ * @since 1.8
+ */
+ public String getGenericDisplayName(String ID, int style, Locale locale) {
+ return null;
+ }
}
--- a/jdk/src/share/classes/javax/net/ssl/KeyManagerFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/net/ssl/KeyManagerFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,17 +53,13 @@
* Obtains the default KeyManagerFactory algorithm name.
*
* <p>The default algorithm can be changed at runtime by setting
- * the value of the "ssl.KeyManagerFactory.algorithm" security
- * property (set in the Java security properties file or by calling
- * {@link java.security.Security#setProperty(java.lang.String,
- * java.lang.String)})
- * to the desired algorithm name.
+ * the value of the {@code ssl.KeyManagerFactory.algorithm}
+ * security property to the desired algorithm name.
*
- * @see java.security.Security#setProperty(java.lang.String,
- * java.lang.String)
- * @return the default algorithm name as specified in the
- * Java security properties, or an implementation-specific
- * default if no such property exists.
+ * @see java.security.Security security properties
+ * @return the default algorithm name as specified by the
+ * {@code ssl.KeyManagerFactory.algorithm} security property, or an
+ * implementation-specific default if no such property exists.
*/
public final static String getDefaultAlgorithm() {
String type;
--- a/jdk/src/share/classes/javax/net/ssl/TrustManagerFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/net/ssl/TrustManagerFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -53,14 +53,13 @@
* Obtains the default TrustManagerFactory algorithm name.
*
* <p>The default TrustManager can be changed at runtime by setting
- * the value of the "ssl.TrustManagerFactory.algorithm" security
- * property (set in the Java security properties file or by calling
- * {@link java.security.Security#setProperty(String, String) })
- * to the desired algorithm name.
+ * the value of the {@code ssl.TrustManagerFactory.algorithm}
+ * security property to the desired algorithm name.
*
- * @return the default algorithm name as specified in the
- * Java security properties, or an implementation-specific default
- * if no such property exists.
+ * @see java.security.Security security properties
+ * @return the default algorithm name as specified by the
+ * {@code ssl.TrustManagerFactory.algorithm} security property, or an
+ * implementation-specific default if no such property exists.
*/
public final static String getDefaultAlgorithm() {
String type;
--- a/jdk/src/share/classes/javax/security/auth/Policy.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/security/auth/Policy.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -126,14 +126,9 @@
* are rejected. Such permission must be listed in the
* <code>java.security.Policy</code>.
*
- * <p> The default <code>Policy</code> implementation can be changed by
- * setting the value of the "auth.policy.provider" security property
- * (in the Java security properties file) to the fully qualified name of
- * the desired <code>Policy</code> implementation class.
- * The Java security properties file is located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <p> The default {@code Policy} implementation can be changed by
+ * setting the value of the {@code auth.policy.provider} security property to
+ * the fully qualified name of the desired {@code Policy} implementation class.
*
* @deprecated as of JDK version 1.4 -- Replaced by java.security.Policy.
* java.security.Policy has a method:
@@ -154,7 +149,7 @@
* These two APIs provide callers the means to query the
* Policy for Principal-based Permission entries.
*
- *
+ * @see java.security.Security security properties
*/
@Deprecated
public abstract class Policy {
--- a/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/security/auth/callback/CallbackHandler.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,13 +49,9 @@
* can then choose to prompt for a username and password serially,
* or to prompt for both in a single window.
*
- * <p> A default <code>CallbackHandler</code> class implementation
- * may be specified in the <i>auth.login.defaultCallbackHandler</i>
- * security property. The security property can be set
- * in the Java security properties file located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <p> A default {@code CallbackHandler} class implementation
+ * may be specified by setting the value of the
+ * {@code auth.login.defaultCallbackHandler} security property.
*
* <p> If the security property is set to the fully qualified name of a
* <code>CallbackHandler</code> implementation class,
@@ -67,6 +63,7 @@
* <p> All default handler implementations must provide a public
* zero-argument constructor.
*
+ * @see java.security.Security security properties
*/
public interface CallbackHandler {
--- a/jdk/src/share/classes/javax/security/auth/login/Configuration.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/security/auth/login/Configuration.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -173,12 +173,8 @@
* Configuration implementation (a default subclass implementation of this
* abstract class).
* The default Configuration implementation can be changed by setting the value
- * of the "login.configuration.provider" security property (in the Java
- * security properties file) to the fully qualified name of the desired
- * Configuration subclass implementation. The Java security properties file
- * is located in the file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * of the {@code login.configuration.provider} security property to the fully
+ * qualified name of the desired Configuration subclass implementation.
*
* <p> Application code can directly subclass Configuration to provide a custom
* implementation. In addition, an instance of a Configuration object can be
@@ -190,6 +186,7 @@
* for a list of standard Configuration types.
*
* @see javax.security.auth.login.LoginContext
+ * @see java.security.Security security properties
*/
public abstract class Configuration {
--- a/jdk/src/share/classes/javax/security/auth/login/LoginContext.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/security/auth/login/LoginContext.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -163,9 +163,9 @@
* input parameter, or if the caller specifies a <code>null</code>
* CallbackHandler object (and a <code>null</code> value is permitted),
* the LoginContext queries the
- * <i>auth.login.defaultCallbackHandler</i> security property
- * for the fully qualified class name of a default handler implementation.
- * If the security property is not set,
+ * {@code auth.login.defaultCallbackHandler} security property for the
+ * fully qualified class name of a default handler
+ * implementation. If the security property is not set,
* then the underlying modules will not have a
* CallbackHandler for use in communicating
* with users. The caller thus assumes that the configured
@@ -184,21 +184,13 @@
* </ul>
* </ol>
*
- * <p> Note that Security Properties
- * (such as <code>auth.login.defaultCallbackHandler</code>)
- * can be set programmatically via the
- * <code>java.security.Security</code> class,
- * or statically in the Java security properties file located in the
- * file named <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
- *
* @see java.security.Security
* @see javax.security.auth.AuthPermission
* @see javax.security.auth.Subject
* @see javax.security.auth.callback.CallbackHandler
* @see javax.security.auth.login.Configuration
* @see javax.security.auth.spi.LoginModule
+ * @see java.security.Security security properties
*/
public class LoginContext {
--- a/jdk/src/share/classes/javax/security/cert/X509Certificate.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/security/cert/X509Certificate.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -96,21 +96,17 @@
* </pre>
* <p>
* In either case, the code that instantiates an X.509 certificate
- * consults the Java security properties file to locate the actual
- * implementation or instantiates a default implementation.
+ * consults the value of the {@code cert.provider.x509v1} security property
+ * to locate the actual implementation or instantiates a default implementation.
* <p>
- * The Java security properties file is located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
- * In the Security properties file, a default implementation
- * for X.509 v1 may be given such as:
+ * The {@code cert.provider.x509v1} property is set to a default
+ * implementation for X.509 such as:
* <pre>
* cert.provider.x509v1=com.sun.security.cert.internal.x509.X509V1CertImpl
* </pre>
* <p>
- * The value of this <code>cert.provider.x509v1</code> property has to be
- * changed to instatiate another implementation. If this security
+ * The value of this {@code cert.provider.x509v1} property has to be
+ * changed to instantiate another implementation. If this security
* property is not set, a default implementation will be used.
* Currently, due to possible security restrictions on access to
* Security properties, this value is looked up and cached at class
@@ -127,6 +123,7 @@
* @since 1.4
* @see Certificate
* @see java.security.cert.X509Extension
+ * @see java.security.Security security properties
*/
public abstract class X509Certificate extends Certificate {
@@ -156,8 +153,7 @@
* the data read from the input stream <code>inStream</code>.
* The implementation (X509Certificate is an abstract class) is
* provided by the class specified as the value of the
- * <code>cert.provider.x509v1</code>
- * property in the security properties file.
+ * {@code cert.provider.x509v1} security property.
*
* <p>Note: Only one DER-encoded
* certificate is expected to be in the input stream.
@@ -184,8 +180,7 @@
* the specified byte array.
* The implementation (X509Certificate is an abstract class) is
* provided by the class specified as the value of the
- * <code>cert.provider.x509v1</code>
- * property in the security properties file.
+ * {@code cert.provider.x509v1} security property.
*
* <p>Note: All X509Certificate
* subclasses must provide a constructor of the form:
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialArray.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,6 +31,7 @@
import java.net.URL;
import java.util.Arrays;
+
/**
* A serialized version of an <code>Array</code>
* object, which is the mapping in the Java programming language of an SQL
@@ -41,44 +42,52 @@
* methods for getting the base type and the SQL name for the base type, and
* methods for copying all or part of a <code>SerialArray</code> object.
* <P>
+ *
* Note: In order for this class to function correctly, a connection to the
* data source
* must be available in order for the SQL <code>Array</code> object to be
* materialized (have all of its elements brought to the client server)
* if necessary. At this time, logical pointers to the data in the data source,
* such as locators, are not currently supported.
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialArray is not safe for use by multiple concurrent threads. If a
+ * SerialArray is to be used by more than one thread then access to the
+ * SerialArray should be controlled by appropriate synchronization.
+ *
*/
public class SerialArray implements Array, Serializable, Cloneable {
- /**
- * A serialized array in which each element is an <code>Object</code>
- * in the Java programming language that represents an element
- * in the SQL <code>ARRAY</code> value.
- * @serial
- */
+ /**
+ * A serialized array in which each element is an <code>Object</code>
+ * in the Java programming language that represents an element
+ * in the SQL <code>ARRAY</code> value.
+ * @serial
+ */
private Object[] elements;
- /**
- * The SQL type of the elements in this <code>SerialArray</code> object. The
- * type is expressed as one of the constants from the class
- * <code>java.sql.Types</code>.
- * @serial
- */
+ /**
+ * The SQL type of the elements in this <code>SerialArray</code> object. The
+ * type is expressed as one of the constants from the class
+ * <code>java.sql.Types</code>.
+ * @serial
+ */
private int baseType;
- /**
- * The type name used by the DBMS for the elements in the SQL <code>ARRAY</code>
- * value that this <code>SerialArray</code> object represents.
- * @serial
- */
+ /**
+ * The type name used by the DBMS for the elements in the SQL <code>ARRAY</code>
+ * value that this <code>SerialArray</code> object represents.
+ * @serial
+ */
private String baseTypeName;
- /**
- * The number of elements in this <code>SerialArray</code> object, which
- * is also the number of elements in the SQL <code>ARRAY</code> value
- * that this <code>SerialArray</code> object represents.
- * @serial
- */
+ /**
+ * The number of elements in this <code>SerialArray</code> object, which
+ * is also the number of elements in the SQL <code>ARRAY</code> value
+ * that this <code>SerialArray</code> object represents.
+ * @serial
+ */
private int len;
/**
@@ -192,24 +201,19 @@
}
/**
- * This method frees the <code>Array</code> object and releases the resources that
- * it holds. The object is invalid once the <code>free</code>
- * method is called.
- *<p>
- * After <code>free</code> has been called, any attempt to invoke a
- * method other than <code>free</code> will result in a <code>SQLException</code>
- * being thrown. If <code>free</code> is called multiple times, the subsequent
- * calls to <code>free</code> are treated as a no-op.
- *<p>
+ * This method frees the {@code SeriableArray} object and releases the
+ * resources that it holds. The object is invalid once the {@code free}
+ * method is called. <p> If {@code free} is called multiple times, the
+ * subsequent calls to {@code free} are treated as a no-op. </P>
*
- * @throws SQLException if an error occurs releasing
- * the Array's resources
- * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
- * this method
+ * @throws SQLException if an error occurs releasing the SerialArray's resources
* @since 1.6
*/
public void free() throws SQLException {
- throw new SQLFeatureNotSupportedException("Feature not supported");
+ if (elements != null) {
+ elements = null;
+ baseTypeName= null;
+ }
}
/**
@@ -292,129 +296,140 @@
}
- /**
- * Returns a new array that is a copy of this <code>SerialArray</code>
- * object.
- *
- * @return a copy of this <code>SerialArray</code> object as an
- * <code>Object</code> in the Java programming language
- * @throws SerialException if an error occurs retrieving a copy of
- * this <code>SerialArray</code> object
- */
+ /**
+ * Returns a new array that is a copy of this <code>SerialArray</code>
+ * object.
+ *
+ * @return a copy of this <code>SerialArray</code> object as an
+ * <code>Object</code> in the Java programming language
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
+ */
public Object getArray() throws SerialException {
+ isValid();
Object dst = new Object[len];
System.arraycopy((Object)elements, 0, dst, 0, len);
return dst;
}
//[if an error occurstype map used??]
- /**
- * Returns a new array that is a copy of this <code>SerialArray</code>
- * object, using the given type map for the custom
- * mapping of each element when the elements are SQL UDTs.
- * <P>
- * This method does custom mapping if the array elements are a UDT
- * and the given type map has an entry for that UDT.
+ /**
+ * Returns a new array that is a copy of this <code>SerialArray</code>
+ * object, using the given type map for the custom
+ * mapping of each element when the elements are SQL UDTs.
+ * <P>
+ * This method does custom mapping if the array elements are a UDT
+ * and the given type map has an entry for that UDT.
* Custom mapping is recursive,
- * meaning that if, for instance, an element of an SQL structured type
- * is an SQL structured type that itself has an element that is an SQL
- * structured type, each structured type that has a custom mapping will be
- * mapped according to the given type map.
- *
+ * meaning that if, for instance, an element of an SQL structured type
+ * is an SQL structured type that itself has an element that is an SQL
+ * structured type, each structured type that has a custom mapping will be
+ * mapped according to the given type map.
+ *
* @param map a <code>java.util.Map</code> object in which
* each entry consists of 1) a <code>String</code> object
* giving the fully qualified name of a UDT and 2) the
* <code>Class</code> object for the <code>SQLData</code> implementation
* that defines how the UDT is to be mapped
- * @return a copy of this <code>SerialArray</code> object as an
- * <code>Object</code> in the Java programming language
- * @throws SerialException if an error occurs
- */
+ * @return a copy of this <code>SerialArray</code> object as an
+ * <code>Object</code> in the Java programming language
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
+ */
public Object getArray(Map<String, Class<?>> map) throws SerialException {
+ isValid();
Object dst[] = new Object[len];
System.arraycopy((Object)elements, 0, dst, 0, len);
return dst;
}
- /**
- * Returns a new array that is a copy of a slice
- * of this <code>SerialArray</code> object, starting with the
- * element at the given index and containing the given number
- * of consecutive elements.
- *
- * @param index the index into this <code>SerialArray</code> object
- * of the first element to be copied;
- * the index of the first element is <code>0</code>
- * @param count the number of consecutive elements to be copied, starting
- * at the given index
- * @return a copy of the designated elements in this <code>SerialArray</code>
- * object as an <code>Object</code> in the Java programming language
- * @throws SerialException if an error occurs
- */
+ /**
+ * Returns a new array that is a copy of a slice
+ * of this <code>SerialArray</code> object, starting with the
+ * element at the given index and containing the given number
+ * of consecutive elements.
+ *
+ * @param index the index into this <code>SerialArray</code> object
+ * of the first element to be copied;
+ * the index of the first element is <code>0</code>
+ * @param count the number of consecutive elements to be copied, starting
+ * at the given index
+ * @return a copy of the designated elements in this <code>SerialArray</code>
+ * object as an <code>Object</code> in the Java programming language
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
+ */
public Object getArray(long index, int count) throws SerialException {
+ isValid();
Object dst = new Object[count];
System.arraycopy((Object)elements, (int)index, dst, 0, count);
return dst;
}
- /**
- * Returns a new array that is a copy of a slice
- * of this <code>SerialArray</code> object, starting with the
- * element at the given index and containing the given number
- * of consecutive elements.
- * <P>
- * This method does custom mapping if the array elements are a UDT
- * and the given type map has an entry for that UDT.
+ /**
+ * Returns a new array that is a copy of a slice
+ * of this <code>SerialArray</code> object, starting with the
+ * element at the given index and containing the given number
+ * of consecutive elements.
+ * <P>
+ * This method does custom mapping if the array elements are a UDT
+ * and the given type map has an entry for that UDT.
* Custom mapping is recursive,
- * meaning that if, for instance, an element of an SQL structured type
- * is an SQL structured type that itself has an element that is an SQL
- * structured type, each structured type that has a custom mapping will be
- * mapped according to the given type map.
- *
- * @param index the index into this <code>SerialArray</code> object
- * of the first element to be copied; the index of the
- * first element in the array is <code>0</code>
- * @param count the number of consecutive elements to be copied, starting
- * at the given index
+ * meaning that if, for instance, an element of an SQL structured type
+ * is an SQL structured type that itself has an element that is an SQL
+ * structured type, each structured type that has a custom mapping will be
+ * mapped according to the given type map.
+ *
+ * @param index the index into this <code>SerialArray</code> object
+ * of the first element to be copied; the index of the
+ * first element in the array is <code>0</code>
+ * @param count the number of consecutive elements to be copied, starting
+ * at the given index
* @param map a <code>java.util.Map</code> object in which
* each entry consists of 1) a <code>String</code> object
* giving the fully qualified name of a UDT and 2) the
* <code>Class</code> object for the <code>SQLData</code> implementation
* that defines how the UDT is to be mapped
- * @return a copy of the designated elements in this <code>SerialArray</code>
- * object as an <code>Object</code> in the Java programming language
- * @throws SerialException if an error occurs
- */
+ * @return a copy of the designated elements in this <code>SerialArray</code>
+ * object as an <code>Object</code> in the Java programming language
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
+ */
public Object getArray(long index, int count, Map<String,Class<?>> map)
throws SerialException
{
+ isValid();
Object dst = new Object[count];
System.arraycopy((Object)elements, (int)index, dst, 0, count);
return dst;
}
- /**
- * Retrieves the SQL type of the elements in this <code>SerialArray</code>
- * object. The <code>int</code> returned is one of the constants in the class
- * <code>java.sql.Types</code>.
- *
- * @return one of the constants in <code>java.sql.Types</code>, indicating
- * the SQL type of the elements in this <code>SerialArray</code> object
- * @throws SerialException if an error occurs
- */
+ /**
+ * Retrieves the SQL type of the elements in this <code>SerialArray</code>
+ * object. The <code>int</code> returned is one of the constants in the class
+ * <code>java.sql.Types</code>.
+ *
+ * @return one of the constants in <code>java.sql.Types</code>, indicating
+ * the SQL type of the elements in this <code>SerialArray</code> object
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
+ */
public int getBaseType() throws SerialException {
+ isValid();
return baseType;
}
- /**
- * Retrieves the DBMS-specific type name for the elements in this
- * <code>SerialArray</code> object.
- *
- * @return the SQL type name used by the DBMS for the base type of this
+ /**
+ * Retrieves the DBMS-specific type name for the elements in this
+ * <code>SerialArray</code> object.
+ *
+ * @return the SQL type name used by the DBMS for the base type of this
* <code>SerialArray</code> object
- * @throws SerialException if an error occurs
- */
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
+ */
public String getBaseTypeName() throws SerialException {
+ isValid();
return baseTypeName;
}
@@ -434,11 +449,13 @@
* @return a <code>ResultSet</code> object containing the designated
* elements in this <code>SerialArray</code> object, with a
* separate row for each element
- * @throws SerialException, which in turn throws an
- * <code>UnsupportedOperationException</code>, if this method is called
+ * @throws SerialException if called with the cause set to
+ * {@code UnsupportedOperationException}
*/
public ResultSet getResultSet(long index, int count) throws SerialException {
- throw new UnsupportedOperationException();
+ SerialException se = new SerialException();
+ se.initCause(new UnsupportedOperationException());
+ throw se;
}
/**
@@ -461,13 +478,15 @@
* @return a <code>ResultSet</code> object containing all of the
* elements in this <code>SerialArray</code> object, with a
* separate row for each element
- * @throws SerialException, which in turn throws an
- * <code>UnsupportedOperationException</code>, if this method is called
+ * @throws SerialException if called with the cause set to
+ * {@code UnsupportedOperationException}
*/
public ResultSet getResultSet(Map<String, Class<?>> map)
throws SerialException
{
- throw new UnsupportedOperationException();
+ SerialException se = new SerialException();
+ se.initCause(new UnsupportedOperationException());
+ throw se;
}
/**
@@ -480,11 +499,13 @@
* @return a <code>ResultSet</code> object containing all of the
* elements in this <code>SerialArray</code> object, with a
* separate row for each element
- * @throws SerialException if called, which in turn throws an
- * <code>UnsupportedOperationException</code>, if this method is called
+ * @throws SerialException if called with the cause set to
+ * {@code UnsupportedOperationException}
*/
public ResultSet getResultSet() throws SerialException {
- throw new UnsupportedOperationException();
+ SerialException se = new SerialException();
+ se.initCause(new UnsupportedOperationException());
+ throw se;
}
@@ -514,16 +535,19 @@
* @return a <code>ResultSet</code> object containing the designated
* elements in this <code>SerialArray</code> object, with a
* separate row for each element
- * @throws SerialException if called, which in turn throws an
- * <code>UnsupportedOperationException</code>
+ * @throws SerialException if called with the cause set to
+ * {@code UnsupportedOperationException}
*/
public ResultSet getResultSet(long index, int count,
Map<String,Class<?>> map)
throws SerialException
{
- throw new UnsupportedOperationException();
+ SerialException se = new SerialException();
+ se.initCause(new UnsupportedOperationException());
+ throw se;
}
+
/**
* Compares this SerialArray to the specified object. The result is {@code
* true} if and only if the argument is not {@code null} and is a {@code
@@ -566,12 +590,12 @@
* reference to a clone of the underlying objects array, not a reference
* to the original underlying object array of this {@code SerialArray} object.
*
- * @return a clone of this SerialArray
+ * @return a clone of this SerialArray
*/
public Object clone() {
try {
SerialArray sa = (SerialArray) super.clone();
- sa.elements = Arrays.copyOf(elements, len);
+ sa.elements = (elements != null) ? Arrays.copyOf(elements, len) : null;
return sa;
} catch (CloneNotSupportedException ex) {
// this shouldn't happen, since we are Cloneable
@@ -616,6 +640,19 @@
}
/**
+ * Check to see if this object had previously had its {@code free} method
+ * called
+ *
+ * @throws SerialException
+ */
+ private void isValid() throws SerialException {
+ if (elements == null) {
+ throw new SerialException("Error: You cannot call a method on a "
+ + "SerialArray instance once free() has been called.");
+ }
+ }
+
+ /**
* The identifier that assists in the serialization of this <code>SerialArray</code>
* object.
*/
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java Mon Dec 24 11:46:38 2012 -0800
@@ -51,6 +51,12 @@
* <code>Blob</code> object within a <code>SerialBlob</code> object
* and to update or truncate a <code>Blob</code> object.
*
+ * <h4> Thread safety </h4>
+ *
+ * <p> A SerialBlob is not safe for use by multiple concurrent threads. If a
+ * SerialBlob is to be used by more than one thread then access to the SerialBlob
+ * should be controlled by appropriate synchronization.
+ *
* @author Jonathan Bruce
*/
public class SerialBlob implements Blob, Serializable, Cloneable {
@@ -76,7 +82,7 @@
private long len;
/**
- * The orginal number of bytes in this <code>SerialBlob</code> object's
+ * The original number of bytes in this <code>SerialBlob</code> object's
* array of bytes when it was first established.
* @serial
*/
@@ -160,9 +166,11 @@
* @return an array of bytes that is a copy of a region of this
* <code>SerialBlob</code> object, starting at the given
* position and containing the given number of consecutive bytes
- * @throws SerialException if the given starting position is out of bounds
+ * @throws SerialException if the given starting position is out of bounds;
+ * if {@code free} had previously been called on this object
*/
public byte[] getBytes(long pos, int length) throws SerialException {
+ isValid();
if (length > len) {
length = (int)len;
}
@@ -189,9 +197,11 @@
*
* @return a <code>long</code> indicating the length in bytes of this
* <code>SerialBlob</code> object's array of bytes
- * @throws SerialException if an error occurs
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
*/
public long length() throws SerialException {
+ isValid();
return len;
}
@@ -203,12 +213,14 @@
*
* @return a <code>java.io.InputStream</code> object that contains
* this <code>SerialBlob</code> object's array of bytes
- * @throws SerialException if an error occurs
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
* @see #setBinaryStream
*/
public java.io.InputStream getBinaryStream() throws SerialException {
- InputStream stream = new ByteArrayInputStream(buf);
- return stream;
+ isValid();
+ InputStream stream = new ByteArrayInputStream(buf);
+ return stream;
}
/**
@@ -227,12 +239,14 @@
* position; <code>-1</code> if the pattern is not found
* or the given starting position is out of bounds; position
* numbering for the return value starts at <code>1</code>
- * @throws SerialException if an error occurs when serializing the blob
+ * @throws SerialException if an error occurs when serializing the blob;
+ * if {@code free} had previously been called on this object
* @throws SQLException if there is an error accessing the <code>BLOB</code>
* value from the database
*/
public long position(byte[] pattern, long start)
throws SerialException, SQLException {
+ isValid();
if (start < 1 || start > len) {
return -1;
}
@@ -270,12 +284,14 @@
* at the specified position; <code>-1</code> if the pattern is
* not found or the given starting position is out of bounds;
* position numbering for the return value starts at <code>1</code>
- * @throws SerialException if an error occurs when serializing the blob
+ * @throws SerialException if an error occurs when serializing the blob;
+ * if {@code free} had previously been called on this object
* @throws SQLException if there is an error accessing the <code>BLOB</code>
* value from the database
*/
public long position(Blob pattern, long start)
throws SerialException, SQLException {
+ isValid();
return position(pattern.getBytes(1, (int)(pattern.length())), start);
}
@@ -293,7 +309,8 @@
* @return the number of bytes written
* @throws SerialException if there is an error accessing the
* <code>BLOB</code> value; or if an invalid position is set; if an
- * invalid offset value is set
+ * invalid offset value is set;
+ * if {@code free} had previously been called on this object
* @throws SQLException if there is an error accessing the <code>BLOB</code>
* value from the database
* @see #getBytes
@@ -328,7 +345,8 @@
* <code>BLOB</code> value; if an invalid position is set; if an
* invalid offset value is set; if number of bytes to be written
* is greater than the <code>SerialBlob</code> length; or the combined
- * values of the length and offset is greater than the Blob buffer
+ * values of the length and offset is greater than the Blob buffer;
+ * if {@code free} had previously been called on this object
* @throws SQLException if there is an error accessing the <code>BLOB</code>
* value from the database.
* @see #getBytes
@@ -336,6 +354,7 @@
public int setBytes(long pos, byte[] bytes, int offset, int length)
throws SerialException, SQLException {
+ isValid();
if (offset < 0 || offset > bytes.length) {
throw new SerialException("Invalid offset in byte array set");
}
@@ -378,11 +397,13 @@
* @throws SQLException if there is an error accessing the
* <code>BLOB</code> value
* @throws SerialException if the SerialBlob in not instantiated with a
- * <code>Blob</code> object that supports <code>setBinaryStream()</code>
+ * <code>Blob</code> object that supports <code>setBinaryStream()</code>;
+ * if {@code free} had previously been called on this object
* @see #getBinaryStream
*/
public java.io.OutputStream setBinaryStream(long pos)
throws SerialException, SQLException {
+ isValid();
if (this.blob != null) {
return this.blob.setBinaryStream(pos);
} else {
@@ -400,54 +421,75 @@
* value that this <code>Blob</code> object represents should be
* truncated
* @throws SerialException if there is an error accessing the Blob value;
- * or the length to truncate is greater that the SerialBlob length
+ * or the length to truncate is greater that the SerialBlob length;
+ * if {@code free} had previously been called on this object
*/
public void truncate(long length) throws SerialException {
- if (length > len) {
- throw new SerialException
- ("Length more than what can be truncated");
- } else if((int)length == 0) {
- buf = new byte[0];
- len = length;
- } else {
- len = length;
- buf = this.getBytes(1, (int)len);
- }
+ isValid();
+ if (length > len) {
+ throw new SerialException
+ ("Length more than what can be truncated");
+ } else if((int)length == 0) {
+ buf = new byte[0];
+ len = length;
+ } else {
+ len = length;
+ buf = this.getBytes(1, (int)len);
+ }
}
/**
- * Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value,
- * starting with the byte specified by pos, which is length bytes in length.
+ * Returns an
+ * <code>InputStream</code> object that contains a partial
+ * {@code Blob} value, starting with the byte specified by pos, which is
+ * length bytes in length.
*
- * @param pos the offset to the first byte of the partial value to be retrieved.
- * The first byte in the <code>Blob</code> is at position 1
+ * @param pos the offset to the first byte of the partial value to be
+ * retrieved. The first byte in the {@code Blob} is at position 1
* @param length the length in bytes of the partial value to be retrieved
- * @return <code>InputStream</code> through which the partial <code>Blob</code> value can be read.
- * @throws SQLException if pos is less than 1 or if pos is greater than the number of bytes
- * in the <code>Blob</code> or if pos + length is greater than the number of bytes
- * in the <code>Blob</code>
+ * @return
+ * <code>InputStream</code> through which the partial {@code Blob} value can
+ * be read.
+ * @throws SQLException if pos is less than 1 or if pos is greater than the
+ * number of bytes in the {@code Blob} or if pos + length is greater than
+ * the number of bytes in the {@code Blob}
+ * @throws SerialException if the {@code free} method had been previously
+ * called on this object
*
* @since 1.6
*/
- public InputStream getBinaryStream(long pos,long length) throws SQLException {
- throw new java.lang.UnsupportedOperationException("Not supported");
+ public InputStream getBinaryStream(long pos, long length) throws SQLException {
+ isValid();
+ if (pos < 1 || pos > this.length()) {
+ throw new SerialException("Invalid position in BLOB object set");
+ }
+ if (length < 1 || length > len - pos + 1) {
+ throw new SerialException("length is < 1 or pos + length >"
+ + "total number of bytes");
+ }
+ return new ByteArrayInputStream(buf, (int) pos - 1, (int) length);
}
/**
- * This method frees the <code>Blob</code> object and releases the resources that it holds.
- * <code>Blob</code> object. The object is invalid once the <code>free</code>
- * method is called. If <code>free</code> is called multiple times, the subsequent
- * calls to <code>free</code> are treated as a no-op.
+ * This method frees the {@code SeriableBlob} object and releases the
+ * resources that it holds. The object is invalid once the {@code free}
+ * method is called. <p> If {@code free} is called multiple times, the
+ * subsequent calls to {@code free} are treated as a no-op. </P>
*
- * @throws SQLException if an error occurs releasing
- * the Blob's resources
+ * @throws SQLException if an error occurs releasing the Blob's resources
* @since 1.6
*/
public void free() throws SQLException {
- throw new java.lang.UnsupportedOperationException("Not supported");
+ if (buf != null) {
+ buf = null;
+ if (blob != null) {
+ blob.free();
+ }
+ blob = null;
+ }
}
/**
@@ -494,7 +536,7 @@
public Object clone() {
try {
SerialBlob sb = (SerialBlob) super.clone();
- sb.buf = Arrays.copyOf(buf, (int)len);
+ sb.buf = (buf != null) ? Arrays.copyOf(buf, (int)len) : null;
sb.blob = null;
return sb;
} catch (CloneNotSupportedException ex) {
@@ -541,9 +583,21 @@
}
/**
- * The identifier that assists in the serialization of this <code>SerialBlob</code>
- * object.
+ * Check to see if this object had previously had its {@code free} method
+ * called
+ *
+ * @throws SerialException
*/
+ private void isValid() throws SerialException {
+ if (buf == null) {
+ throw new SerialException("Error: You cannot call a method on a "
+ + "SerialBlob instance once free() has been called.");
+ }
+ }
+ /**
+ * The identifier that assists in the serialization of this
+ * {@code SerialBlob} object.
+ */
static final long serialVersionUID = -8144641928112860441L;
}
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialClob.java Mon Dec 24 11:46:38 2012 -0800
@@ -44,6 +44,11 @@
* from a <code>SerialClob</code> object or to locate the start of
* a pattern of characters.
*
+ * <h4> Thread safety </h4>
+ *
+ * <p> A SerialClob is not safe for use by multiple concurrent threads. If a
+ * SerialClob is to be used by more than one thread then access to the SerialClob
+ * should be controlled by appropriate synchronization.
* @author Jonathan Bruce
*/
public class SerialClob implements Clob, Serializable, Cloneable {
@@ -180,9 +185,11 @@
*
* @return a <code>long</code> indicating the length in characters of this
* <code>SerialClob</code> object's array of character
- * @throws SerialException if an error occurs
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
*/
public long length() throws SerialException {
+ isValid();
return len;
}
@@ -194,9 +201,11 @@
*
* @return a <code>java.io.Reader</code> object containing this
* <code>SerialClob</code> object's data
- * @throws SerialException if an error occurs
+ * @throws SerialException if an error occurs;
+ * if {@code free} had previously been called on this object
*/
public java.io.Reader getCharacterStream() throws SerialException {
+ isValid();
return (java.io.Reader) new CharArrayReader(buf);
}
@@ -210,13 +219,15 @@
*
* @return a <code>java.io.InputStream</code> object containing
* this <code>SerialClob</code> object's data
- * @throws SerialException if this <code>SerialClob</code> object was not instantiated
- * with a <code>Clob</code> object
+ * @throws SerialException if this {@code SerialClob} object was not
+ * instantiated with a <code>Clob</code> object;
+ * if {@code free} had previously been called on this object
* @throws SQLException if there is an error accessing the
- * <code>CLOB</code> value represented by the <code>Clob</code> object that was
- * used to create this <code>SerialClob</code> object
+ * <code>CLOB</code> value represented by the <code>Clob</code> object
+ * that was used to create this <code>SerialClob</code> object
*/
public java.io.InputStream getAsciiStream() throws SerialException, SQLException {
+ isValid();
if (this.clob != null) {
return this.clob.getAsciiStream();
} else {
@@ -248,12 +259,14 @@
* this <code>SerialClob</code> object beginning at the
* given position and containing the specified number of
* consecutive characters
- * @throws SerialException if either of the arguments is out of bounds
+ * @throws SerialException if either of the arguments is out of bounds;
+ * if {@code free} had previously been called on this object
*/
public String getSubString(long pos, int length) throws SerialException {
+ isValid();
if (pos < 1 || pos > this.length()) {
- throw new SerialException("Invalid position in BLOB object set");
+ throw new SerialException("Invalid position in SerialClob object set");
}
if ((pos-1) + length > this.length()) {
@@ -287,13 +300,14 @@
* <code>-1</code> if the given <code>String</code> object is
* not found or the starting position is out of bounds; position
* numbering for the return value starts at <code>1</code>
- * @throws SerialException if an error occurs locating the String signature
- * @throws SQLException if there is an error accessing the Blob value
+ * @throws SerialException if the {@code free} method had been
+ * previously called on this object
+ * @throws SQLException if there is an error accessing the Clob value
* from the database.
*/
public long position(String searchStr, long start)
throws SerialException, SQLException {
-
+ isValid();
if (start < 1 || start > len) {
return -1;
}
@@ -332,13 +346,14 @@
* @return the position at which the given <code>Clob</code>
* object begins in this <code>SerialClob</code> object,
* at or after the specified starting position
- * @throws SerialException if an error occurs locating the Clob signature
- * @throws SQLException if there is an error accessing the Blob value
+ * @throws SerialException if an error occurs locating the Clob signature;
+ * if the {@code free} method had been previously called on this object
+ * @throws SQLException if there is an error accessing the Clob value
* from the database
*/
public long position(Clob searchStr, long start)
throws SerialException, SQLException {
-
+ isValid();
return position(searchStr.getSubString(1,(int)searchStr.length()), start);
}
@@ -358,7 +373,8 @@
* <code>CLOB</code> value; if an invalid position is set; if an
* invalid offset value is set; if number of bytes to be written
* is greater than the <code>SerialClob</code> length; or the combined
- * values of the length and offset is greater than the Clob buffer
+ * values of the length and offset is greater than the Clob buffer;
+ * if the {@code free} method had been previously called on this object
*/
public int setString(long pos, String str) throws SerialException {
return (setString(pos, str, 0, str.length()));
@@ -383,10 +399,12 @@
* <code>CLOB</code> value; if an invalid position is set; if an
* invalid offset value is set; if number of bytes to be written
* is greater than the <code>SerialClob</code> length; or the combined
- * values of the length and offset is greater than the Clob buffer
+ * values of the length and offset is greater than the Clob buffer;
+ * if the {@code free} method had been previously called on this object
*/
public int setString(long pos, String str, int offset, int length)
throws SerialException {
+ isValid();
String temp = str.substring(offset);
char cPattern[] = temp.toCharArray();
@@ -395,7 +413,7 @@
}
if (pos < 1 || pos > this.length()) {
- throw new SerialException("Invalid position in BLOB object set");
+ throw new SerialException("Invalid position in Clob object set");
}
if ((long)(length) > origLen) {
@@ -430,13 +448,15 @@
* <code>CLOB</code> object
* @return the stream to which ASCII encoded characters can be written
* @throws SerialException if SerialClob is not instantiated with a
- * Clob object that supports <code>setAsciiStream</code>
+ * Clob object;
+ * if the {@code free} method had been previously called on this object
* @throws SQLException if there is an error accessing the
* <code>CLOB</code> value
* @see #getAsciiStream
*/
public java.io.OutputStream setAsciiStream(long pos)
throws SerialException, SQLException {
+ isValid();
if (this.clob != null) {
return this.clob.setAsciiStream(pos);
} else {
@@ -460,13 +480,15 @@
*
* @return a stream to which Unicode encoded characters can be written
* @throws SerialException if the SerialClob is not instantiated with
- * a Clob object that supports <code>setCharacterStream</code>
+ * a Clob object;
+ * if the {@code free} method had been previously called on this object
* @throws SQLException if there is an error accessing the
* <code>CLOB</code> value
* @see #getCharacterStream
*/
public java.io.Writer setCharacterStream(long pos)
throws SerialException, SQLException {
+ isValid();
if (this.clob != null) {
return this.clob.setCharacterStream(pos);
} else {
@@ -486,33 +508,80 @@
*
* @param length the length, in bytes, to which the <code>CLOB</code>
* value should be truncated
- * @throws SQLException if there is an error accessing the
- * <code>CLOB</code> value
+ * @throws SerialLException if there is an error accessing the
+ * <code>CLOB</code> value;
+ * if the {@code free} method had been previously called on this object
*/
public void truncate(long length) throws SerialException {
- if (length > len) {
- throw new SerialException
- ("Length more than what can be truncated");
- } else {
- len = length;
- // re-size the buffer
+ isValid();
+ if (length > len) {
+ throw new SerialException
+ ("Length more than what can be truncated");
+ } else {
+ len = length;
+ // re-size the buffer
- if (len == 0) {
- buf = new char[] {};
- } else {
+ if (len == 0) {
+ buf = new char[] {};
+ } else {
buf = (this.getSubString(1, (int)len)).toCharArray();
- }
-
- }
+ }
+ }
}
+ /**
+ * Returns a {@code Reader} object that contains a partial
+ * {@code SerialClob} value, starting
+ * with the character specified by pos, which is length characters in length.
+ *
+ * @param pos the offset to the first character of the partial value to
+ * be retrieved. The first character in the {@code SerialClob} is at position 1.
+ * @param length the length in characters of the partial value to be retrieved.
+ * @return {@code Reader} through which the partial {@code SerialClob}
+ * value can be read.
+ * @throws SQLException if pos is less than 1 or if pos is greater than the
+ * number of characters in the {@code SerialClob} or if pos + length
+ * is greater than the number of characters in the {@code SerialClob};
+ * @throws SerialException if the {@code free} method had been previously
+ * called on this object
+ * @since 1.6
+ */
public Reader getCharacterStream(long pos, long length) throws SQLException {
- throw new java.lang.UnsupportedOperationException("Not supported");
+ isValid();
+ if (pos < 1 || pos > len) {
+ throw new SerialException("Invalid position in Clob object set");
+ }
+
+ if ((pos-1) + length > len) {
+ throw new SerialException("Invalid position and substring length");
+ }
+ if (length <= 0) {
+ throw new SerialException("Invalid length specified");
+ }
+ return new CharArrayReader(buf, (int)pos, (int)length);
}
+ /**
+ * This method frees the {@code SeriableClob} object and releases the
+ * resources that it holds.
+ * The object is invalid once the {@code free} method is called.
+ * <p>
+ * If {@code free} is called multiple times, the subsequent
+ * calls to {@code free} are treated as a no-op.
+ * </P>
+ * @throws SQLException if an error occurs releasing
+ * the Clob's resources
+ * @since 1.6
+ */
public void free() throws SQLException {
- throw new java.lang.UnsupportedOperationException("Not supported");
+ if (buf != null) {
+ buf = null;
+ if (clob != null) {
+ clob.free();
+ }
+ clob = null;
+ }
}
/**
@@ -559,7 +628,7 @@
public Object clone() {
try {
SerialClob sc = (SerialClob) super.clone();
- sc.buf = Arrays.copyOf(buf, (int)len);
+ sc.buf = (buf != null) ? Arrays.copyOf(buf, (int)len) : null;
sc.clob = null;
return sc;
} catch (CloneNotSupportedException ex) {
@@ -605,7 +674,20 @@
}
/**
- * The identifier that assists in the serialization of this <code>SerialClob</code>
+ * Check to see if this object had previously had its {@code free} method
+ * called
+ *
+ * @throws SerialException
+ */
+ private void isValid() throws SerialException {
+ if (buf == null) {
+ throw new SerialException("Error: You cannot call a method on a "
+ + "SerialClob instance once free() has been called.");
+ }
+ }
+
+ /**
+ * The identifier that assists in the serialization of this {@code SerialClob}
* object.
*/
static final long serialVersionUID = -1662519690087375313L;
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialDatalink.java Mon Dec 24 11:46:38 2012 -0800
@@ -42,6 +42,12 @@
* <pre>
* java.net.URL url = rowset.getURL(1);
* </pre>
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialDatalink is not safe for use by multiple concurrent threads. If a
+ * SerialDatalink is to be used by more than one thread then access to the
+ * SerialDatalink should be controlled by appropriate synchronization.
*/
public class SerialDatalink implements Serializable, Cloneable {
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialJavaObject.java Mon Dec 24 11:46:38 2012 -0800
@@ -44,6 +44,12 @@
* Static or transient fields cannot be serialized; an attempt to serialize
* them will result in a <code>SerialException</code> object being thrown.
*
+ * <h4> Thread safety </h4>
+ *
+ * A SerialJavaObject is not safe for use by multiple concurrent threads. If a
+ * SerialJavaObject is to be used by more than one thread then access to the
+ * SerialJavaObject should be controlled by appropriate synchronization.
+ *
* @author Jonathan Bruce
*/
public class SerialJavaObject implements Serializable, Cloneable {
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java Mon Dec 24 11:46:38 2012 -0800
@@ -36,6 +36,13 @@
* The <code>SerialRef</code> class provides a constructor for
* creating a <code>SerialRef</code> instance from a <code>Ref</code>
* object and provides methods for getting and setting the <code>Ref</code> object.
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialRef is not safe for use by multiple concurrent threads. If a
+ * SerialRef is to be used by more than one thread then access to the SerialRef
+ * should be controlled by appropriate synchronization.
+ *
*/
public class SerialRef implements Ref, Serializable, Cloneable {
--- a/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java Mon Dec 24 11:46:38 2012 -0800
@@ -50,6 +50,13 @@
* an instance from a <code>Struct</code> object, a method for retrieving
* the SQL type name of the SQL structured type in the database, and methods
* for retrieving its attribute values.
+ *
+ * <h4> Thread safety </h4>
+ *
+ * A SerialStruct is not safe for use by multiple concurrent threads. If a
+ * SerialStruct is to be used by more than one thread then access to the
+ * SerialStruct should be controlled by appropriate synchronization.
+ *
*/
public class SerialStruct implements Struct, Serializable, Cloneable {
--- a/jdk/src/share/classes/sun/net/www/MessageHeader.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/net/www/MessageHeader.java Mon Dec 24 11:46:38 2012 -0800
@@ -137,6 +137,43 @@
return null;
}
+ /**
+ * Removes bare Negotiate and Kerberos headers when an "NTLM ..."
+ * appears. All Performed on headers with key being k.
+ * @return true if there is a change
+ */
+ public boolean filterNTLMResponses(String k) {
+ boolean found = false;
+ for (int i=0; i<nkeys; i++) {
+ if (k.equalsIgnoreCase(keys[i])
+ && values[i] != null && values[i].length() > 5
+ && values[i].substring(0, 5).equalsIgnoreCase("NTLM ")) {
+ found = true;
+ break;
+ }
+ }
+ if (found) {
+ int j = 0;
+ for (int i=0; i<nkeys; i++) {
+ if (k.equalsIgnoreCase(keys[i]) && (
+ "Negotiate".equalsIgnoreCase(values[i]) ||
+ "Kerberos".equalsIgnoreCase(values[i]))) {
+ continue;
+ }
+ if (i != j) {
+ keys[j] = keys[i];
+ values[j] = values[i];
+ }
+ j++;
+ }
+ if (j != nkeys) {
+ nkeys = j;
+ return true;
+ }
+ }
+ return false;
+ }
+
class HeaderIterator implements Iterator<String> {
int index = 0;
int next = -1;
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Mon Dec 24 11:46:38 2012 -0800
@@ -1326,6 +1326,16 @@
if (logger.isLoggable(PlatformLogger.FINE)) {
logger.fine(responses.toString());
}
+
+ boolean b1 = responses.filterNTLMResponses("WWW-Authenticate");
+ boolean b2 = responses.filterNTLMResponses("Proxy-Authenticate");
+ if (b1 || b2) {
+ if (logger.isLoggable(PlatformLogger.FINE)) {
+ logger.fine(">>>> Headers are filtered");
+ logger.fine(responses.toString());
+ }
+ }
+
inputStream = http.getInputStream();
respCode = getResponseCode();
@@ -1784,6 +1794,13 @@
logger.fine(responses.toString());
}
+ if (responses.filterNTLMResponses("Proxy-Authenticate")) {
+ if (logger.isLoggable(PlatformLogger.FINE)) {
+ logger.fine(">>>> Headers are filtered");
+ logger.fine(responses.toString());
+ }
+ }
+
statusLine = responses.getValue(0);
StringTokenizer st = new StringTokenizer(statusLine);
st.nextToken();
--- a/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Util.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/security/jgss/krb5/Krb5Util.java Mon Dec 24 11:46:38 2012 -0800
@@ -40,10 +40,7 @@
import sun.security.krb5.KrbException;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
-import java.util.Objects;
-import java.util.Set;
import sun.security.krb5.KerberosSecrets;
import sun.security.krb5.PrincipalName;
/**
@@ -189,18 +186,6 @@
return subject;
}
- // A special KerberosKey, used as keys read from a KeyTab object.
- // Each time new keys are read from KeyTab objects in the private
- // credentials set, old ones are removed and new ones added.
- public static class KeysFromKeyTab extends KerberosKey {
- private static final long serialVersionUID = 8238092170252746927L;
-
- public KeysFromKeyTab(KerberosKey key) {
- super(key.getPrincipal(), key.getEncoded(),
- key.getKeyType(), key.getVersionNumber());
- }
- }
-
/**
* Credentials of a service, the private secret to authenticate its
* identity, which can be:
@@ -239,7 +224,7 @@
// Compatibility with old behavior: even when there is no
// KerberosPrincipal, we can find one from KerberosKeys
List<KerberosKey> keys = SubjectComber.findMany(
- subj, null, null, KerberosKey.class);
+ subj, serverPrincipal, null, KerberosKey.class);
if (!keys.isEmpty()) {
sc.kp = keys.get(0).getPrincipal();
serverPrincipal = sc.kp.getName();
@@ -255,9 +240,9 @@
subj, null, null, KeyTab.class);
sc.kk = SubjectComber.findMany(
subj, serverPrincipal, null, KerberosKey.class);
- sc.tgt = SubjectComber.find(subj, null, null, KerberosTicket.class);
-
- if (sc.ktabs.isEmpty() && sc.kk.isEmpty()) {
+ sc.tgt = SubjectComber.find(
+ subj, null, serverPrincipal, KerberosTicket.class);
+ if (sc.ktabs.isEmpty() && sc.kk.isEmpty() && sc.tgt == null) {
return null;
}
return sc;
@@ -268,37 +253,16 @@
}
public KerberosKey[] getKKeys() {
- if (ktabs.isEmpty()) {
- return kk.toArray(new KerberosKey[kk.size()]);
- } else {
- List<KerberosKey> keys = new ArrayList<>();
- for (KeyTab ktab: ktabs) {
- for (KerberosKey k: ktab.getKeys(kp)) {
- keys.add(k);
- }
+ List<KerberosKey> keys = new ArrayList<>();
+ for (KerberosKey k: kk) {
+ keys.add(k);
+ }
+ for (KeyTab ktab: ktabs) {
+ for (KerberosKey k: ktab.getKeys(kp)) {
+ keys.add(k);
}
- // Compatibility: also add keys to privCredSet. Remove old
- // ones first, only remove those from keytab.
- if (!subj.isReadOnly()) {
- Set<Object> pcs = subj.getPrivateCredentials();
- synchronized (pcs) {
- Iterator<Object> iterator = pcs.iterator();
- while (iterator.hasNext()) {
- Object obj = iterator.next();
- if (obj instanceof KeysFromKeyTab) {
- KerberosKey key = (KerberosKey)obj;
- if (Objects.equals(key.getPrincipal(), kp)) {
- iterator.remove();
- }
- }
- }
- }
- for (KerberosKey key: keys) {
- subj.getPrivateCredentials().add(new KeysFromKeyTab(key));
- }
- }
- return keys.toArray(new KerberosKey[keys.size()]);
}
+ return keys.toArray(new KerberosKey[keys.size()]);
}
public EncryptionKey[] getEKeys() {
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Mon Dec 24 11:46:38 2012 -0800
@@ -90,10 +90,6 @@
"libgssapi_krb5.so",
"libgssapi_krb5.so.2",
};
- } else if (osname.contains("OS X")) {
- gssLibs = new String[]{
- "/usr/lib/sasl2/libgssapiv2.2.so",
- };
}
} else {
gssLibs = new String[]{ defaultLib };
--- a/jdk/src/share/classes/sun/text/resources/FormatData.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/FormatData.java Mon Dec 24 11:46:38 2012 -0800
@@ -50,6 +50,20 @@
* Overrides ListResourceBundle
*/
protected final Object[][] getContents() {
+ final String[] buddhistEras = new String[] { // Thai Buddhist calendar era strings
+ "BC", // BC
+ "B.E." // Buddhist Era
+ };
+
+ // Japanese imperial calendar era abbreviations
+ final String[] japaneseEraAbbrs = new String[] {
+ "",
+ "M",
+ "T",
+ "S",
+ "H",
+ };
+
return new Object[][] {
{ "MonthNames",
new String[] {
@@ -107,29 +121,49 @@
"Sat" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "T",
+ "W",
+ "T",
+ "F",
+ "S",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"AM", // am marker
"PM" // pm marker
}
},
+ { "narrow.AmPmMarkers",
+ new String[] {
+ "a", // am marker
+ "p" // pm marker
+ }
+ },
{ "Eras",
new String[] { // era strings for GregorianCalendar
"BC",
"AD"
}
},
- { "buddhist.Eras",
- new String[] { // Thai Buddhist calendar era strings
- "BC", // BC
- "B.E." // Buddhist Era
+ { "narrow.Eras",
+ new String[] {
+ "B",
+ "A",
}
},
+ { "buddhist.Eras",
+ buddhistEras
+ },
{ "buddhist.short.Eras",
- new String[] { // Thai Buddhist calendar era strings
- "BC", // BC
- "B.E." // Buddhist Era
- }
+ buddhistEras
+ },
+ { "buddhist.narrow.Eras",
+ buddhistEras
},
{ "japanese.Eras",
new String[] { // Japanese imperial calendar era strings
@@ -141,13 +175,10 @@
}
},
{ "japanese.short.Eras",
- new String[] { // Japanese imperial calendar era abbreviations
- "",
- "M",
- "T",
- "S",
- "H",
- }
+ japaneseEraAbbrs
+ },
+ { "japanese.narrow.Eras",
+ japaneseEraAbbrs
},
{ "japanese.FirstYear",
new String[] { // Japanese imperial calendar year name
--- a/jdk/src/share/classes/sun/text/resources/ar/FormatData_ar.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ar/FormatData_ar.java Mon Dec 24 11:46:38 2012 -0800
@@ -107,6 +107,17 @@
"\u0633" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u062d",
+ "\u0646",
+ "\u062b",
+ "\u0631",
+ "\u062e",
+ "\u062c",
+ "\u0633",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\u0635", // am marker
--- a/jdk/src/share/classes/sun/text/resources/be/FormatData_be.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/be/FormatData_be.java Mon Dec 24 11:46:38 2012 -0800
@@ -85,6 +85,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "\u0441",
+ "\u043b",
+ "\u0441",
+ "\u043a",
+ "\u043c",
+ "\u0447",
+ "\u043b",
+ "\u0436",
+ "\u0432",
+ "\u043a",
+ "\u043b",
+ "\u0441",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"\u043d\u044f\u0434\u0437\u0435\u043b\u044f", // Sunday
@@ -107,6 +124,17 @@
"\u0441\u0431" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u043d",
+ "\u043f",
+ "\u0430",
+ "\u0441",
+ "\u0447",
+ "\u043f",
+ "\u0441",
+ }
+ },
{ "Eras",
new String[] { // era strings
"\u0434\u0430 \u043d.\u0435.",
--- a/jdk/src/share/classes/sun/text/resources/bg/FormatData_bg.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/bg/FormatData_bg.java Mon Dec 24 11:46:38 2012 -0800
@@ -107,6 +107,17 @@
"\u0421\u0431" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u043d",
+ "\u043f",
+ "\u0432",
+ "\u0441",
+ "\u0447",
+ "\u043f",
+ "\u0441",
+ }
+ },
{ "Eras",
new String[] { // era strings
"\u043f\u0440.\u043d.\u0435.",
--- a/jdk/src/share/classes/sun/text/resources/ca/FormatData_ca.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ca/FormatData_ca.java Mon Dec 24 11:46:38 2012 -0800
@@ -119,6 +119,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "g",
+ "f",
+ "m",
+ "a",
+ "m",
+ "j",
+ "j",
+ "a",
+ "s",
+ "o",
+ "n",
+ "d",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"diumenge", // Sunday
@@ -141,6 +158,28 @@
"ds." // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "G",
+ "L", // Note: contributed item in CDLR
+ "T",
+ "C",
+ "J",
+ "V",
+ "S",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "g",
+ "l",
+ "t",
+ "c",
+ "j",
+ "v",
+ "s",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal separator
--- a/jdk/src/share/classes/sun/text/resources/cs/FormatData_cs.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/cs/FormatData_cs.java Mon Dec 24 11:46:38 2012 -0800
@@ -141,6 +141,17 @@
"So" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "N",
+ "P",
+ "\u00da",
+ "S",
+ "\u010c",
+ "P",
+ "S",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"dop.", // am marker
--- a/jdk/src/share/classes/sun/text/resources/da/FormatData_da.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/da/FormatData_da.java Mon Dec 24 11:46:38 2012 -0800
@@ -124,6 +124,17 @@
"l\u00f8" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "T",
+ "O",
+ "T",
+ "F",
+ "L",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal separator
--- a/jdk/src/share/classes/sun/text/resources/de/FormatData_de.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/de/FormatData_de.java Mon Dec 24 11:46:38 2012 -0800
@@ -124,6 +124,17 @@
"Sa" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "D",
+ "M",
+ "D",
+ "F",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"v. Chr.",
--- a/jdk/src/share/classes/sun/text/resources/el/FormatData_el.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/el/FormatData_el.java Mon Dec 24 11:46:38 2012 -0800
@@ -124,6 +124,17 @@
"\u03a3\u03b1\u03b2" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u039a",
+ "\u0394",
+ "\u03a4",
+ "\u03a4",
+ "\u03a0",
+ "\u03a0",
+ "\u03a3",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\u03c0\u03bc", // am marker
--- a/jdk/src/share/classes/sun/text/resources/es/FormatData_es.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/es/FormatData_es.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"s\u00e1b" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "D",
+ "L",
+ "M",
+ "X",
+ "J",
+ "V",
+ "S",
+ }
+ },
{ "NumberPatterns",
new String[] {
"#,##0.###;-#,##0.###", // decimal pattern
--- a/jdk/src/share/classes/sun/text/resources/et/FormatData_et.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/et/FormatData_et.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"L" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "P",
+ "E",
+ "T",
+ "K",
+ "N",
+ "R",
+ "L",
+ }
+ },
{ "Eras",
new String[] { // era strings
"e.m.a.",
--- a/jdk/src/share/classes/sun/text/resources/fi/FormatData_fi.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/fi/FormatData_fi.java Mon Dec 24 11:46:38 2012 -0800
@@ -116,6 +116,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "T",
+ "H",
+ "M",
+ "H",
+ "T",
+ "K",
+ "H",
+ "E",
+ "S",
+ "L",
+ "M",
+ "J",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"sunnuntai", // Sunday
@@ -138,6 +155,28 @@
"la" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "T",
+ "K",
+ "T",
+ "P",
+ "L",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "T",
+ "K",
+ "T",
+ "P",
+ "L",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal separator
@@ -181,6 +220,12 @@
"ip." // pm marker
}
},
+ { "narrow.AmPmMarkers",
+ new String[] {
+ "ap.",
+ "ip.",
+ }
+ },
};
}
}
--- a/jdk/src/share/classes/sun/text/resources/fr/FormatData_fr.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/fr/FormatData_fr.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"sam." // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "D",
+ "L",
+ "M",
+ "M",
+ "J",
+ "V",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"BC",
--- a/jdk/src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/hi/FormatData_hi_IN.java Mon Dec 24 11:46:38 2012 -0800
@@ -99,6 +99,17 @@
"\u0936\u0928\u093f" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u0930",
+ "\u0938\u094b",
+ "\u092e\u0902",
+ "\u092c\u0941",
+ "\u0917\u0941",
+ "\u0936\u0941",
+ "\u0936",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\u092a\u0942\u0930\u094d\u0935\u093e\u0939\u094d\u0928", // am marker
--- a/jdk/src/share/classes/sun/text/resources/hr/FormatData_hr.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/hr/FormatData_hr.java Mon Dec 24 11:46:38 2012 -0800
@@ -116,6 +116,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "1.",
+ "2.",
+ "3.",
+ "4.",
+ "5.",
+ "6.",
+ "7.",
+ "8.",
+ "9.",
+ "10.",
+ "11.",
+ "12.",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"nedjelja", // Sunday
@@ -138,6 +155,28 @@
"sub" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "N",
+ "P",
+ "U",
+ "S",
+ "\u010c",
+ "P",
+ "S",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "n",
+ "p",
+ "u",
+ "s",
+ "\u010d",
+ "p",
+ "s",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal separator
--- a/jdk/src/share/classes/sun/text/resources/hu/FormatData_hu.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/hu/FormatData_hu.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"Szo" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "V",
+ "H",
+ "K",
+ "Sz",
+ "Cs",
+ "P",
+ "Sz",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"DE", // am marker
--- a/jdk/src/share/classes/sun/text/resources/is/FormatData_is.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/is/FormatData_is.java Mon Dec 24 11:46:38 2012 -0800
@@ -82,6 +82,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "j",
+ "f",
+ "m",
+ "a",
+ "m",
+ "j",
+ "j",
+ "\u00e1",
+ "s",
+ "o",
+ "n",
+ "d",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"sunnudagur", // Sunday
@@ -104,6 +121,28 @@
"lau." // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "\u00de",
+ "M",
+ "F",
+ "F",
+ "L",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "s",
+ "m",
+ "\u00fe",
+ "m",
+ "f",
+ "f",
+ "l",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal separator
--- a/jdk/src/share/classes/sun/text/resources/it/FormatData_it.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/it/FormatData_it.java Mon Dec 24 11:46:38 2012 -0800
@@ -121,6 +121,17 @@
"sab" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "D",
+ "L",
+ "M",
+ "M",
+ "G",
+ "V",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"BC",
--- a/jdk/src/share/classes/sun/text/resources/iw/FormatData_iw.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/iw/FormatData_iw.java Mon Dec 24 11:46:38 2012 -0800
@@ -121,6 +121,28 @@
"\u05e9" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u05d0",
+ "\u05d1",
+ "\u05d2",
+ "\u05d3",
+ "\u05d4",
+ "\u05d5",
+ "\u05e9",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "\u05d0",
+ "\u05d1",
+ "\u05d2",
+ "\u05d3",
+ "\u05d4",
+ "\u05d5",
+ "\u05e9",
+ }
+ },
{ "Eras",
new String[] { // era strings
"\u05dc\u05e1\u05d4\"\u05e0",
--- a/jdk/src/share/classes/sun/text/resources/ja/FormatData_ja.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ja/FormatData_ja.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"\u571f" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u65e5",
+ "\u6708",
+ "\u706b",
+ "\u6c34",
+ "\u6728",
+ "\u91d1",
+ "\u571f",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\u5348\u524d", // am marker
--- a/jdk/src/share/classes/sun/text/resources/ko/FormatData_ko.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ko/FormatData_ko.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"\ud1a0" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\uc77c",
+ "\uc6d4",
+ "\ud654",
+ "\uc218",
+ "\ubaa9",
+ "\uae08",
+ "\ud1a0",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\uc624\uc804", // am marker
--- a/jdk/src/share/classes/sun/text/resources/lt/FormatData_lt.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/lt/FormatData_lt.java Mon Dec 24 11:46:38 2012 -0800
@@ -99,6 +99,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "S",
+ "V",
+ "K",
+ "B",
+ "G",
+ "B",
+ "L",
+ "R",
+ "R",
+ "S",
+ "L",
+ "G",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"Sekmadienis", // Sunday
@@ -121,6 +138,28 @@
"\u0160t" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "P",
+ "A",
+ "T",
+ "K",
+ "P",
+ "\u0160",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "S",
+ "P",
+ "A",
+ "T",
+ "K",
+ "P",
+ "\u0160",
+ }
+ },
{ "Eras",
new String[] { // era strings
"pr.Kr.",
--- a/jdk/src/share/classes/sun/text/resources/lv/FormatData_lv.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/lv/FormatData_lv.java Mon Dec 24 11:46:38 2012 -0800
@@ -121,6 +121,17 @@
"S" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "P",
+ "O",
+ "T",
+ "C",
+ "P",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"pm\u0113",
--- a/jdk/src/share/classes/sun/text/resources/mk/FormatData_mk.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/mk/FormatData_mk.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"\u0441\u0430\u0431." // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u043d",
+ "\u043f",
+ "\u0432",
+ "\u0441",
+ "\u0447",
+ "\u043f",
+ "\u0441",
+ }
+ },
{ "Eras",
new String[] { // era strings
"\u043f\u0440.\u043d.\u0435.",
--- a/jdk/src/share/classes/sun/text/resources/ms/FormatData_ms.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ms/FormatData_ms.java Mon Dec 24 11:46:38 2012 -0800
@@ -81,6 +81,23 @@
"",
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "J",
+ "F",
+ "M",
+ "A",
+ "M",
+ "J",
+ "J",
+ "O",
+ "S",
+ "O",
+ "N",
+ "D",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"Ahad",
@@ -103,6 +120,28 @@
"Sab",
}
},
+ { "DayNarrows",
+ new String[] {
+ "A",
+ "I",
+ "S",
+ "R",
+ "K",
+ "J",
+ "S",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "A",
+ "I",
+ "S",
+ "R",
+ "K",
+ "J",
+ "S",
+ }
+ },
{ "Eras",
new String[] {
"BCE",
--- a/jdk/src/share/classes/sun/text/resources/mt/FormatData_mt.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/mt/FormatData_mt.java Mon Dec 24 11:46:38 2012 -0800
@@ -103,6 +103,17 @@
"Sib",
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u0126",
+ "T",
+ "T",
+ "E",
+ "\u0126",
+ "\u0120",
+ "S",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"QN",
--- a/jdk/src/share/classes/sun/text/resources/nl/FormatData_nl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/nl/FormatData_nl.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"za" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "Z",
+ "M",
+ "D",
+ "W",
+ "D",
+ "V",
+ "Z",
+ }
+ },
{ "Eras",
new String[] { // era strings for GregorianCalendar
"v. Chr.",
--- a/jdk/src/share/classes/sun/text/resources/pl/FormatData_pl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/pl/FormatData_pl.java Mon Dec 24 11:46:38 2012 -0800
@@ -121,6 +121,17 @@
"So" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "N",
+ "P",
+ "W",
+ "\u015a",
+ "C",
+ "P",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"p.n.e.",
--- a/jdk/src/share/classes/sun/text/resources/pt/FormatData_pt.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/pt/FormatData_pt.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"S\u00e1b" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "D",
+ "S",
+ "T",
+ "Q",
+ "Q",
+ "S",
+ "S",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal al separator
--- a/jdk/src/share/classes/sun/text/resources/ro/FormatData_ro.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ro/FormatData_ro.java Mon Dec 24 11:46:38 2012 -0800
@@ -82,6 +82,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "I",
+ "F",
+ "M",
+ "A",
+ "M",
+ "I",
+ "I",
+ "A",
+ "S",
+ "O",
+ "N",
+ "D",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"duminic\u0103", // Sunday
@@ -104,6 +121,29 @@
"S" // abb Saturday
}
},
+ // commented out DayNarrows because most names are contributed.
+// { "DayNarrows",
+// new String[] {
+// "D",
+// "",
+// "",
+// "",
+// "",
+// "",
+// "",
+// }
+// },
+ { "standalone.DayNarrows",
+ new String[] {
+ "D",
+ "L",
+ "M",
+ "M",
+ "J",
+ "V",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"d.C.",
--- a/jdk/src/share/classes/sun/text/resources/ru/FormatData_ru.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/ru/FormatData_ru.java Mon Dec 24 11:46:38 2012 -0800
@@ -138,6 +138,28 @@
"\u0421\u0431" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u0412",
+ "\u041f\u043d",
+ "\u0412\u0442",
+ "\u0421",
+ "\u0427",
+ "\u041f",
+ "\u0421", // contributed item in CLDR
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "\u0412",
+ "\u041f",
+ "\u0412",
+ "\u0421",
+ "\u0427",
+ "\u041f",
+ "\u0421",
+ }
+ },
{ "Eras",
new String[] { // era strings
"\u0434\u043e \u043d.\u044d.",
--- a/jdk/src/share/classes/sun/text/resources/sk/FormatData_sk.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/sk/FormatData_sk.java Mon Dec 24 11:46:38 2012 -0800
@@ -138,6 +138,17 @@
"So" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "N",
+ "P",
+ "U",
+ "S",
+ "\u0160",
+ "P",
+ "S",
+ }
+ },
{ "Eras",
new String[] { // era strings
"pred n.l.",
--- a/jdk/src/share/classes/sun/text/resources/sl/FormatData_sl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/sl/FormatData_sl.java Mon Dec 24 11:46:38 2012 -0800
@@ -121,6 +121,17 @@
"Sob" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "n",
+ "p",
+ "t",
+ "s",
+ "\u010d",
+ "p",
+ "s",
+ }
+ },
{ "Eras",
new String[] { // era strings
"pr.n.\u0161.",
--- a/jdk/src/share/classes/sun/text/resources/sq/FormatData_sq.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/sq/FormatData_sq.java Mon Dec 24 11:46:38 2012 -0800
@@ -104,6 +104,17 @@
"Sht" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "D",
+ "H",
+ "M",
+ "M",
+ "E",
+ "P",
+ "S",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"PD", // am marker
--- a/jdk/src/share/classes/sun/text/resources/sr/FormatData_sr.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/sr/FormatData_sr.java Mon Dec 24 11:46:38 2012 -0800
@@ -103,12 +103,35 @@
"\u0441\u0443\u0431",
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u043d",
+ "\u043f",
+ "\u0443",
+ "\u0441",
+ "\u0447",
+ "\u043f",
+ "\u0441",
+ }
+ },
{ "Eras",
new String[] {
"\u043f. \u043d. \u0435.",
"\u043d. \u0435",
}
},
+ { "short.Eras",
+ new String[] {
+ "\u043f. \u043d. \u0435.",
+ "\u043d. \u0435.",
+ }
+ },
+ { "narrow.Eras",
+ new String[] {
+ "\u043f.\u043d.\u0435.",
+ "\u043d.\u0435.",
+ }
+ },
{ "NumberPatterns",
new String[] {
"#,##0.###",
--- a/jdk/src/share/classes/sun/text/resources/sv/FormatData_sv.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/sv/FormatData_sv.java Mon Dec 24 11:46:38 2012 -0800
@@ -82,6 +82,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "J",
+ "F",
+ "M",
+ "A",
+ "M",
+ "J",
+ "J",
+ "A",
+ "S",
+ "O",
+ "N",
+ "D",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"s\u00f6ndag", // Sunday
@@ -104,12 +121,46 @@
"l\u00f6" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "T",
+ "O",
+ "T",
+ "F",
+ "L",
+ }
+ },
+ { "standalone.DayNarrows",
+ new String[] {
+ "S",
+ "M",
+ "T",
+ "O",
+ "T",
+ "F",
+ "L",
+ }
+ },
+ { "narrow.Eras",
+ new String[] {
+ "f.Kr.",
+ "e.Kr.",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"fm", // am marker
"em" // pm marker
}
},
+ { "narrow.AmPmMarkers",
+ new String[] {
+ "f",
+ "e",
+ }
+ },
{ "NumberElements",
new String[] {
",", // decimal separator
--- a/jdk/src/share/classes/sun/text/resources/th/FormatData_th.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/th/FormatData_th.java Mon Dec 24 11:46:38 2012 -0800
@@ -99,6 +99,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "\u0e21.\u0e04.",
+ "\u0e01.\u0e1e.",
+ "\u0e21\u0e35.\u0e04.",
+ "\u0e40\u0e21.\u0e22.",
+ "\u0e1e.\u0e04.",
+ "\u0e21\u0e34.\u0e22.",
+ "\u0e01.\u0e04.",
+ "\u0e2a.\u0e04.",
+ "\u0e01.\u0e22.",
+ "\u0e15.\u0e04.",
+ "\u0e1e.\u0e22.",
+ "\u0e18.\u0e04.",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c", // Sunday
@@ -121,6 +138,17 @@
"\u0e2a." // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u0e2d",
+ "\u0e08",
+ "\u0e2d",
+ "\u0e1e",
+ "\u0e1e",
+ "\u0e28",
+ "\u0e2a",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07", // am marker
@@ -145,6 +173,12 @@
"\u0e04.\u0e28."
}
},
+ { "narrow.Eras",
+ new String[] {
+ "\u0e01\u0e48\u0e2d\u0e19 \u0e04.\u0e28.",
+ "\u0e04.\u0e28.",
+ }
+ },
{ "buddhist.TimePatterns",
timePatterns
},
--- a/jdk/src/share/classes/sun/text/resources/tr/FormatData_tr.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/tr/FormatData_tr.java Mon Dec 24 11:46:38 2012 -0800
@@ -82,6 +82,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "O",
+ "\u015e",
+ "M",
+ "N",
+ "M",
+ "H",
+ "T",
+ "A",
+ "E",
+ "E",
+ "K",
+ "A",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"Pazar", // Sunday
@@ -104,6 +121,17 @@
"Cmt" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "P",
+ "P",
+ "S",
+ "\u00c7",
+ "P",
+ "C",
+ "C",
+ }
+ },
{ "NumberPatterns",
new String[] {
"#,##0.###;-#,##0.###", // decimal pattern
--- a/jdk/src/share/classes/sun/text/resources/uk/FormatData_uk.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/uk/FormatData_uk.java Mon Dec 24 11:46:38 2012 -0800
@@ -138,6 +138,17 @@
"\u0441\u0431" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u041d",
+ "\u041f",
+ "\u0412",
+ "\u0421",
+ "\u0427",
+ "\u041f",
+ "\u0421",
+ }
+ },
{ "Eras",
new String[] { // era strings
"\u0434\u043e \u043d.\u0435.",
--- a/jdk/src/share/classes/sun/text/resources/vi/FormatData_vi.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/vi/FormatData_vi.java Mon Dec 24 11:46:38 2012 -0800
@@ -106,6 +106,17 @@
"Th 7" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "CN",
+ "T2",
+ "T3",
+ "T4",
+ "T5",
+ "T6",
+ "T7",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"SA", // am marker
--- a/jdk/src/share/classes/sun/text/resources/zh/FormatData_zh.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/text/resources/zh/FormatData_zh.java Mon Dec 24 11:46:38 2012 -0800
@@ -82,6 +82,23 @@
"" // abb month 13 if applicable
}
},
+ { "standalone.MonthNarrows",
+ new String[] {
+ "1\u6708",
+ "2\u6708",
+ "3\u6708",
+ "4\u6708",
+ "5\u6708",
+ "6\u6708",
+ "7\u6708",
+ "8\u6708",
+ "9\u6708",
+ "10\u6708",
+ "11\u6708",
+ "12\u6708",
+ "",
+ }
+ },
{ "DayNames",
new String[] {
"\u661f\u671f\u65e5", // Sunday
@@ -104,6 +121,17 @@
"\u661f\u671f\u516d" // abb Saturday
}
},
+ { "DayNarrows",
+ new String[] {
+ "\u65e5",
+ "\u4e00",
+ "\u4e8c",
+ "\u4e09",
+ "\u56db",
+ "\u4e94",
+ "\u516d",
+ }
+ },
{ "AmPmMarkers",
new String[] {
"\u4e0a\u5348", // am marker
--- a/jdk/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java Mon Dec 24 11:46:38 2012 -0800
@@ -89,11 +89,6 @@
}
@Override
- public TimeZoneNameProvider getTimeZoneNameProvider() {
- return null;
- }
-
- @Override
public Locale[] getAvailableLocales() {
Set<String> all = createLanguageTagSet("All");
Locale[] locs = new Locale[all.size()];
--- a/jdk/src/share/classes/sun/util/locale/provider/CalendarDataUtility.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/locale/provider/CalendarDataUtility.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,7 +25,6 @@
package sun.util.locale.provider;
-import java.util.Calendar;
import static java.util.Calendar.*;
import java.util.Locale;
import java.util.Map;
--- a/jdk/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -52,7 +52,7 @@
@Override
public String getDisplayName(String calendarType, int field, int value, int style, Locale locale) {
String name = null;
- String key = getKey(calendarType, field, style);
+ String key = getResourceKey(calendarType, field, style);
if (key != null) {
ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getDateFormatData(locale);
if (rb.containsKey(key)) {
@@ -64,9 +64,10 @@
name = strings[value];
// If name is empty in standalone, try its `format' style.
if (name.length() == 0
- && (style == SHORT_STANDALONE || style == LONG_STANDALONE)) {
+ && (style == SHORT_STANDALONE || style == LONG_STANDALONE
+ || style == NARROW_STANDALONE)) {
name = getDisplayName(calendarType, field, value,
- style == SHORT_STANDALONE ? SHORT_FORMAT : LONG_FORMAT,
+ getBaseStyle(style),
locale);
}
}
@@ -75,15 +76,17 @@
return name;
}
+ private static int[] REST_OF_STYLES = {
+ SHORT_STANDALONE, LONG_FORMAT, LONG_STANDALONE,
+ NARROW_FORMAT, NARROW_STANDALONE
+ };
@Override
public Map<String, Integer> getDisplayNames(String calendarType, int field, int style, Locale locale) {
Map<String, Integer> names;
if (style == ALL_STYLES) {
names = getDisplayNamesImpl(calendarType, field, SHORT_FORMAT, locale);
- if (field != AM_PM) {
- for (int st : new int[] { SHORT_STANDALONE, LONG_FORMAT, LONG_STANDALONE }) {
- names.putAll(getDisplayNamesImpl(calendarType, field, st, locale));
- }
+ for (int st : REST_OF_STYLES) {
+ names.putAll(getDisplayNamesImpl(calendarType, field, st, locale));
}
} else {
// specific style
@@ -94,26 +97,28 @@
private Map<String, Integer> getDisplayNamesImpl(String calendarType, int field,
int style, Locale locale) {
- String key = getKey(calendarType, field, style);
+ String key = getResourceKey(calendarType, field, style);
Map<String, Integer> map = new TreeMap<>(LengthBasedComparator.INSTANCE);
if (key != null) {
ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getDateFormatData(locale);
if (rb.containsKey(key)) {
String[] strings = rb.getStringArray(key);
- if (field == YEAR) {
- if (strings.length > 0) {
- map.put(strings[0], 1);
- }
- } else {
- int base = (field == DAY_OF_WEEK) ? 1 : 0;
- for (int i = 0; i < strings.length; i++) {
- String name = strings[i];
- // Ignore any empty string (some standalone month names
- // are not defined)
- if (name.length() == 0) {
- continue;
+ if (!hasDuplicates(strings)) {
+ if (field == YEAR) {
+ if (strings.length > 0) {
+ map.put(strings[0], 1);
}
- map.put(name, base + i);
+ } else {
+ int base = (field == DAY_OF_WEEK) ? 1 : 0;
+ for (int i = 0; i < strings.length; i++) {
+ String name = strings[i];
+ // Ignore any empty string (some standalone month names
+ // are not defined)
+ if (name.length() == 0) {
+ continue;
+ }
+ map.put(name, base + i);
+ }
}
}
}
@@ -121,6 +126,10 @@
return map;
}
+ private int getBaseStyle(int style) {
+ return style & ~(SHORT_STANDALONE - SHORT_FORMAT);
+ }
+
/**
* Comparator implementation for TreeMap which iterates keys from longest
* to shortest.
@@ -180,55 +189,92 @@
return langtags;
}
- private int getIntData(String key, Locale locale) {
- ResourceBundle rb = LocaleProviderAdapter.forType(type).getLocaleData().getCalendarData(locale);
- if (rb.containsKey(key)) {
- String firstday = rb.getString(key);
- return Integer.parseInt(firstday);
+ private boolean hasDuplicates(String[] strings) {
+ int len = strings.length;
+ for (int i = 0; i < len - 1; i++) {
+ String a = strings[i];
+ if (a != null) {
+ for (int j = i + 1; j < len; j++) {
+ if (a.equals(strings[j])) {
+ return true;
+ }
+ }
+ }
}
- // Note that the base bundle of CLDR doesn't have the Calendar week parameters.
- return 0;
+ return false;
}
- private String getKey(String type, int field, int style) {
- boolean standalone = (style & 0x8000) != 0;
- style &= ~0x8000;
+ private String getResourceKey(String type, int field, int style) {
+ int baseStyle = getBaseStyle(style);
+ boolean isStandalone = (style != baseStyle);
if ("gregory".equals(type)) {
type = null;
}
-
+ boolean isNarrow = (baseStyle == NARROW_FORMAT);
StringBuilder key = new StringBuilder();
switch (field) {
case ERA:
if (type != null) {
key.append(type).append('.');
}
- if (style == SHORT) {
- key.append("short.");
+ if (isNarrow) {
+ key.append("narrow.");
+ } else {
+ // JRE and CLDR use different resource key conventions
+ // due to historical reasons. (JRE DateFormatSymbols.getEras returns
+ // abbreviations while other getShort*() return abbreviations.)
+ if (this.type == LocaleProviderAdapter.Type.JRE) {
+ if (baseStyle == SHORT) {
+ key.append("short.");
+ }
+ } else { // CLDR
+ if (baseStyle == LONG) {
+ key.append("long.");
+ }
+ }
}
key.append("Eras");
break;
case YEAR:
- key.append(type).append(".FirstYear");
+ if (!isNarrow) {
+ key.append(type).append(".FirstYear");
+ }
break;
case MONTH:
- if (standalone) {
+ if (isStandalone) {
key.append("standalone.");
}
- key.append(style == SHORT ? "MonthAbbreviations" : "MonthNames");
+ key.append("Month").append(toStyleName(baseStyle));
break;
case DAY_OF_WEEK:
- key.append(style == SHORT ? "DayAbbreviations" : "DayNames");
+ // support standalone narrow day names
+ if (isStandalone && isNarrow) {
+ key.append("standalone.");
+ }
+ key.append("Day").append(toStyleName(baseStyle));
break;
case AM_PM:
+ if (isNarrow) {
+ key.append("narrow.");
+ }
key.append("AmPmMarkers");
break;
}
return key.length() > 0 ? key.toString() : null;
}
+
+ private String toStyleName(int baseStyle) {
+ switch (baseStyle) {
+ case SHORT:
+ return "Abbreviations";
+ case NARROW_FORMAT:
+ return "Narrows";
+ }
+ return "Names";
+ }
}
--- a/jdk/src/share/classes/sun/util/locale/provider/LocaleResources.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/locale/provider/LocaleResources.java Mon Dec 24 11:46:38 2012 -0800
@@ -46,7 +46,7 @@
import java.util.ResourceBundle;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
-import sun.util.resources.OpenListResourceBundle;
+import sun.util.resources.TimeZoneNamesBundle;
/**
* Central accessor to locale-dependent resources.
@@ -67,13 +67,13 @@
this.locale = locale;
}
- public OpenListResourceBundle getTimeZoneNames() {
- OpenListResourceBundle tznames = (OpenListResourceBundle) cache.get("TimeZoneNames");
+ public TimeZoneNamesBundle getTimeZoneNames() {
+ TimeZoneNamesBundle tznames = (TimeZoneNamesBundle) cache.get("TimeZoneNames");
if (tznames == null) {
tznames = adapter.getLocaleData().getTimeZoneNames(locale);
- OpenListResourceBundle olrb = (OpenListResourceBundle) cache.putIfAbsent("TimeZoneNames", tznames);
- if (olrb != null) {
- tznames = olrb;
+ TimeZoneNamesBundle tznb = (TimeZoneNamesBundle) cache.putIfAbsent("TimeZoneNames", tznames);
+ if (tznb != null) {
+ tznames = tznb;
}
}
return tznames;
--- a/jdk/src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/locale/provider/SPILocaleProviderAdapter.java Mon Dec 24 11:46:38 2012 -0800
@@ -604,5 +604,12 @@
assert tznp != null;
return tznp.getDisplayName(ID, daylight, style, locale);
}
+
+ @Override
+ public String getGenericDisplayName(String ID, int style, Locale locale) {
+ TimeZoneNameProvider tznp = getImpl(locale);
+ assert tznp != null;
+ return tznp.getGenericDisplayName(ID, style, locale);
+ }
}
}
--- a/jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameProviderImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,11 +25,14 @@
package sun.util.locale.provider;
+import java.util.LinkedHashSet;
import java.util.Locale;
-import java.util.ResourceBundle;
+import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.spi.TimeZoneNameProvider;
+import sun.util.calendar.ZoneInfo;
+import sun.util.resources.TimeZoneNamesBundle;
/**
* Concrete implementation of the
@@ -96,21 +99,67 @@
*/
@Override
public String getDisplayName(String id, boolean daylight, int style, Locale locale) {
+ String[] names = getDisplayNameArray(id, 5, locale);
+ if (names != null) {
+ int index = daylight ? 3 : 1;
+ if (style == TimeZone.SHORT) {
+ index++;
+ }
+ return names[index];
+ }
+ return null;
+ }
+
+ @Override
+ public String getGenericDisplayName(String id, int style, Locale locale) {
+ String[] names = getDisplayNameArray(id, 7, locale);
+ if (names != null && names.length >= 7) {
+ return names[(style == TimeZone.LONG) ? 5 : 6];
+ }
+ return null;
+ }
+
+ private String[] getDisplayNameArray(String id, int n, Locale locale) {
if (id == null || locale == null) {
throw new NullPointerException();
}
+ LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
+ TimeZoneNamesBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
+ return rb.containsKey(id) ? rb.getStringArray(id, n) : null;
+ }
+ /**
+ * Returns a String[][] as the DateFormatSymbols.getZoneStrings() value for
+ * the given locale. This method is package private.
+ *
+ * @param locale a Locale for time zone names
+ * @return an array of time zone names arrays
+ */
+ String[][] getZoneStrings(Locale locale) {
LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
- ResourceBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
- if (rb.containsKey(id)) {
- String[] names = rb.getStringArray(id);
- int index = daylight ? 3 : 1;
- if (style == TimeZone.SHORT) {
- index++;
+ TimeZoneNamesBundle rb = adapter.getLocaleResources(locale).getTimeZoneNames();
+ Set<String> keyset = rb.keySet();
+ // Use a LinkedHashSet to preseve the order
+ Set<String[]> value = new LinkedHashSet<>();
+ for (String key : keyset) {
+ value.add(rb.getStringArray(key));
+ }
+
+ // Add aliases data for CLDR
+ if (type == LocaleProviderAdapter.Type.CLDR) {
+ // Note: TimeZoneNamesBundle creates a String[] on each getStringArray call.
+ Map<String, String> aliases = ZoneInfo.getAliasTable();
+ for (String alias : aliases.keySet()) {
+ if (!keyset.contains(alias)) {
+ String tzid = aliases.get(alias);
+ if (keyset.contains(tzid)) {
+ String[] val = rb.getStringArray(tzid);
+ val[0] = alias;
+ value.add(val);
+ }
}
- return names[index];
}
-
- return null;
+ }
+ return value.toArray(new String[0][]);
}
}
--- a/jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/locale/provider/TimeZoneNameUtility.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,28 +26,28 @@
package sun.util.locale.provider;
import java.lang.ref.SoftReference;
-import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.spi.TimeZoneNameProvider;
import sun.util.calendar.ZoneInfo;
import sun.util.resources.OpenListResourceBundle;
+import sun.util.resources.TimeZoneNamesBundle;
/**
* Utility class that deals with the localized time zone names
*
* @author Naoto Sato
+ * @author Masayoshi Okutsu
*/
public final class TimeZoneNameUtility {
/**
* cache to hold time zone resource bundles. Keyed by Locale
*/
- private static ConcurrentHashMap<Locale, SoftReference<OpenListResourceBundle>> cachedBundles =
+ private static ConcurrentHashMap<Locale, SoftReference<TimeZoneNamesBundle>> cachedBundles =
new ConcurrentHashMap<>();
/**
@@ -73,15 +73,19 @@
}
private static String[][] loadZoneStrings(Locale locale) {
+ // If the provider is a TimeZoneNameProviderImpl, call its getZoneStrings
+ // in order to avoid per-ID retrieval.
+ LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(TimeZoneNameProvider.class, locale);
+ TimeZoneNameProvider provider = adapter.getTimeZoneNameProvider();
+ if (provider instanceof TimeZoneNameProviderImpl) {
+ return ((TimeZoneNameProviderImpl)provider).getZoneStrings(locale);
+ }
+
+ // Performs per-ID retrieval.
List<String[]> zones = new LinkedList<>();
OpenListResourceBundle rb = getBundle(locale);
- Enumeration<String> keys = rb.getKeys();
- String[] names;
-
- while(keys.hasMoreElements()) {
- String key = keys.nextElement();
-
- names = retrieveDisplayNames(rb, key, locale);
+ for (String key : rb.keySet()) {
+ String[] names = retrieveDisplayNamesImpl(key, locale);
if (names != null) {
zones.add(names);
}
@@ -95,24 +99,50 @@
* Retrieve display names for a time zone ID.
*/
public static String[] retrieveDisplayNames(String id, Locale locale) {
- OpenListResourceBundle rb = getBundle(locale);
- return retrieveDisplayNames(rb, id, locale);
- }
-
- private static String[] retrieveDisplayNames(OpenListResourceBundle rb,
- String id, Locale locale) {
if (id == null || locale == null) {
throw new NullPointerException();
}
+ return retrieveDisplayNamesImpl(id, locale);
+ }
+ /**
+ * Retrieves a generic time zone display name for a time zone ID.
+ *
+ * @param id time zone ID
+ * @param style TimeZone.LONG or TimeZone.SHORT
+ * @param locale desired Locale
+ * @return the requested generic time zone display name, or null if not found.
+ */
+ public static String retrieveGenericDisplayName(String id, int style, Locale locale) {
LocaleServiceProviderPool pool =
LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
- return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, id);
+ return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, "generic", style, id);
}
- private static OpenListResourceBundle getBundle(Locale locale) {
- OpenListResourceBundle rb;
- SoftReference<OpenListResourceBundle> data = cachedBundles.get(locale);
+ /**
+ * Retrieves a standard or daylight-saving time name for the given time zone ID.
+ *
+ * @param id time zone ID
+ * @param daylight true for a daylight saving time name, or false for a standard time name
+ * @param style TimeZone.LONG or TimeZone.SHORT
+ * @param locale desired Locale
+ * @return the requested time zone name, or null if not found.
+ */
+ public static String retrieveDisplayName(String id, boolean daylight, int style, Locale locale) {
+ LocaleServiceProviderPool pool =
+ LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+ return pool.getLocalizedObject(TimeZoneNameGetter.INSTANCE, locale, daylight ? "dst" : "std", style, id);
+ }
+
+ private static String[] retrieveDisplayNamesImpl(String id, Locale locale) {
+ LocaleServiceProviderPool pool =
+ LocaleServiceProviderPool.getPool(TimeZoneNameProvider.class);
+ return pool.getLocalizedObject(TimeZoneNameArrayGetter.INSTANCE, locale, id);
+ }
+
+ private static TimeZoneNamesBundle getBundle(Locale locale) {
+ TimeZoneNamesBundle rb;
+ SoftReference<TimeZoneNamesBundle> data = cachedBundles.get(locale);
if (data == null || ((rb = data.get()) == null)) {
rb = LocaleProviderAdapter.forJRE().getLocaleData().getTimeZoneNames(locale);
@@ -127,19 +157,18 @@
* Obtains a localized time zone strings from a TimeZoneNameProvider
* implementation.
*/
- private static class TimeZoneNameGetter
+ private static class TimeZoneNameArrayGetter
implements LocaleServiceProviderPool.LocalizedObjectGetter<TimeZoneNameProvider,
String[]>{
- private static final TimeZoneNameGetter INSTANCE =
- new TimeZoneNameGetter();
+ private static final TimeZoneNameArrayGetter INSTANCE =
+ new TimeZoneNameArrayGetter();
@Override
public String[] getObject(TimeZoneNameProvider timeZoneNameProvider,
- Locale locale,
- String requestID,
- Object... params) {
+ Locale locale,
+ String requestID,
+ Object... params) {
assert params.length == 0;
- String queryID = requestID;
// First, try to get names with the request ID
String[] names = buildZoneStrings(timeZoneNameProvider, locale, requestID);
@@ -150,21 +179,15 @@
if (aliases != null) {
// Check whether this id is an alias, if so,
// look for the standard id.
- if (aliases.containsKey(queryID)) {
- String prevID = queryID;
- while ((queryID = aliases.get(queryID)) != null) {
- prevID = queryID;
- }
- queryID = prevID;
+ String canonicalID = aliases.get(requestID);
+ if (canonicalID != null) {
+ names = buildZoneStrings(timeZoneNameProvider, locale, canonicalID);
}
-
- names = buildZoneStrings(timeZoneNameProvider, locale, queryID);
-
if (names == null) {
// There may be a case that a standard id has become an
// alias. so, check the aliases backward.
names = examineAliases(timeZoneNameProvider, locale,
- queryID, aliases, aliases.entrySet());
+ canonicalID == null ? requestID : canonicalID, aliases);
}
}
}
@@ -178,20 +201,18 @@
private static String[] examineAliases(TimeZoneNameProvider tznp, Locale locale,
String id,
- Map<String, String> aliases,
- Set<Map.Entry<String, String>> aliasesSet) {
+ Map<String, String> aliases) {
if (aliases.containsValue(id)) {
- for (Map.Entry<String, String> entry : aliasesSet) {
+ for (Map.Entry<String, String> entry : aliases.entrySet()) {
if (entry.getValue().equals(id)) {
String alias = entry.getKey();
String[] names = buildZoneStrings(tznp, locale, alias);
if (names != null) {
return names;
- } else {
- names = examineAliases(tznp, locale, alias, aliases, aliasesSet);
- if (names != null) {
- return names;
- }
+ }
+ names = examineAliases(tznp, locale, alias, aliases);
+ if (names != null) {
+ return names;
}
}
}
@@ -201,7 +222,7 @@
}
private static String[] buildZoneStrings(TimeZoneNameProvider tznp,
- Locale locale, String id) {
+ Locale locale, String id) {
String[] names = new String[5];
for (int i = 1; i <= 4; i ++) {
@@ -220,6 +241,77 @@
}
}
+ private static class TimeZoneNameGetter
+ implements LocaleServiceProviderPool.LocalizedObjectGetter<TimeZoneNameProvider,
+ String> {
+ private static final TimeZoneNameGetter INSTANCE =
+ new TimeZoneNameGetter();
+
+ @Override
+ public String getObject(TimeZoneNameProvider timeZoneNameProvider,
+ Locale locale,
+ String requestID,
+ Object... params) {
+ assert params.length == 2;
+ int style = (int) params[0];
+ String tzid = (String) params[1];
+ String value = getName(timeZoneNameProvider, locale, requestID, style, tzid);
+ if (value == null) {
+ Map<String, String> aliases = ZoneInfo.getAliasTable();
+ if (aliases != null) {
+ String canonicalID = aliases.get(tzid);
+ if (canonicalID != null) {
+ value = getName(timeZoneNameProvider, locale, requestID, style, canonicalID);
+ }
+ if (value == null) {
+ value = examineAliases(timeZoneNameProvider, locale, requestID,
+ canonicalID != null ? canonicalID : tzid, style, aliases);
+ }
+ }
+ }
+
+ return value;
+ }
+
+ private static String examineAliases(TimeZoneNameProvider tznp, Locale locale,
+ String requestID, String tzid, int style,
+ Map<String, String> aliases) {
+ if (aliases.containsValue(tzid)) {
+ for (Map.Entry<String, String> entry : aliases.entrySet()) {
+ if (entry.getValue().equals(tzid)) {
+ String alias = entry.getKey();
+ String name = getName(tznp, locale, requestID, style, alias);
+ if (name != null) {
+ return name;
+ }
+ name = examineAliases(tznp, locale, requestID, alias, style, aliases);
+ if (name != null) {
+ return name;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ private static String getName(TimeZoneNameProvider timeZoneNameProvider,
+ Locale locale, String requestID, int style, String tzid) {
+ String value = null;
+ switch (requestID) {
+ case "std":
+ value = timeZoneNameProvider.getDisplayName(tzid, false, style, locale);
+ break;
+ case "dst":
+ value = timeZoneNameProvider.getDisplayName(tzid, true, style, locale);
+ break;
+ case "generic":
+ value = timeZoneNameProvider.getGenericDisplayName(tzid, style, locale);
+ break;
+ }
+ return value;
+ }
+ }
+
// No instantiation
private TimeZoneNameUtility() {
}
--- a/jdk/src/share/classes/sun/util/resources/LocaleData.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/resources/LocaleData.java Mon Dec 24 11:46:38 2012 -0800
@@ -46,9 +46,9 @@
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
+import sun.util.locale.provider.LocaleDataMetaInfo;
import sun.util.locale.provider.LocaleProviderAdapter;
import static sun.util.locale.provider.LocaleProviderAdapter.Type.JRE;
-import sun.util.locale.provider.LocaleDataMetaInfo;
/**
* Provides information about and access to resource bundles in the
@@ -94,8 +94,8 @@
* Gets a time zone names resource bundle, using privileges
* to allow accessing a sun.* package.
*/
- public OpenListResourceBundle getTimeZoneNames(Locale locale) {
- return (OpenListResourceBundle) getBundle(type.getUtilResourcesPackage() + ".TimeZoneNames", locale);
+ public TimeZoneNamesBundle getTimeZoneNames(Locale locale) {
+ return (TimeZoneNamesBundle) getBundle(type.getUtilResourcesPackage() + ".TimeZoneNames", locale);
}
/**
@@ -158,30 +158,33 @@
/* Get the locale string list from LocaleDataMetaInfo class. */
String localeString = LocaleDataMetaInfo.getSupportedLocaleString(baseName);
- if (localeString == null || localeString.length() == 0) {
- return candidates;
- }
-
- for (Iterator<Locale> l = candidates.iterator(); l.hasNext(); ) {
- Locale loc = l.next();
- String lstr;
- if (loc.getScript().length() > 0) {
- lstr = loc.toLanguageTag().replace('-', '_');
- } else {
- lstr = loc.toString();
- int idx = lstr.indexOf("_#");
- if (idx >= 0) {
- lstr = lstr.substring(0, idx);
+ if (localeString != null && localeString.length() != 0) {
+ for (Iterator<Locale> l = candidates.iterator(); l.hasNext();) {
+ Locale loc = l.next();
+ String lstr;
+ if (loc.getScript().length() > 0) {
+ lstr = loc.toLanguageTag().replace('-', '_');
+ } else {
+ lstr = loc.toString();
+ int idx = lstr.indexOf("_#");
+ if (idx >= 0) {
+ lstr = lstr.substring(0, idx);
+ }
+ }
+ /* Every locale string in the locale string list returned from
+ the above getSupportedLocaleString is enclosed
+ within two white spaces so that we could check some locale
+ such as "en".
+ */
+ if (lstr.length() != 0 && localeString.indexOf(" " + lstr + " ") == -1) {
+ l.remove();
}
}
- /* Every locale string in the locale string list returned from
- the above getSupportedLocaleString is enclosed
- within two white spaces so that we could check some locale
- such as "en".
- */
- if (lstr.length() != 0 && localeString.indexOf(" " + lstr + " ") == -1) {
- l.remove();
- }
+ }
+ // Force fallback to Locale.ENGLISH for CLDR time zone names support
+ if (locale.getLanguage() != "en"
+ && baseName.contains(CLDR) && baseName.endsWith("TimeZoneNames")) {
+ candidates.add(candidates.size() - 1, Locale.ENGLISH);
}
return candidates;
}
--- a/jdk/src/share/classes/sun/util/resources/OpenListResourceBundle.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/resources/OpenListResourceBundle.java Mon Dec 24 11:46:38 2012 -0800
@@ -67,6 +67,7 @@
}
// Implements java.util.ResourceBundle.handleGetObject; inherits javadoc specification.
+ @Override
public Object handleGetObject(String key) {
if (key == null) {
throw new NullPointerException();
@@ -79,6 +80,7 @@
/**
* Implementation of ResourceBundle.getKeys.
*/
+ @Override
public Enumeration<String> getKeys() {
ResourceBundle parent = this.parent;
return new ResourceBundleEnumeration(handleGetKeys(),
@@ -86,7 +88,8 @@
}
/**
- * Returns a set of keys provided in this resource bundle
+ * Returns a set of keys provided in this resource bundle,
+ * including no parents.
*/
public Set<String> handleGetKeys() {
loadLookupTablesIfNecessary();
@@ -99,7 +102,7 @@
if (keyset != null) {
return keyset;
}
- Set<String> ks = new HashSet<>();
+ Set<String> ks = createSet();
ks.addAll(handleGetKeys());
if (parent != null) {
ks.addAll(parent.keySet());
@@ -113,13 +116,6 @@
}
/**
- * Returns the parent bundle
- */
- public OpenListResourceBundle getParent() {
- return (OpenListResourceBundle)parent;
- }
-
- /**
* See ListResourceBundle class description.
*/
abstract protected Object[][] getContents();
@@ -160,10 +156,14 @@
* Lets subclasses provide specialized Map implementations.
* Default uses HashMap.
*/
- protected Map<String, Object> createMap(int size) {
+ protected <K, V> Map<K, V> createMap(int size) {
return new HashMap<>(size);
}
+ protected <E> Set<E> createSet() {
+ return new HashSet<>();
+ }
+
private volatile Map<String, Object> lookup = null;
private volatile Set<String> keyset;
}
--- a/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNames.java Mon Dec 24 11:46:38 2012 -0800
@@ -43,160 +43,238 @@
public final class TimeZoneNames extends TimeZoneNamesBundle {
protected final Object[][] getContents() {
+ // Note: generic names came from CLDR with some adjustments.
String ACT[] = new String[] {"Acre Time", "ACT",
- "Acre Summer Time", "ACST"};
+ "Acre Summer Time", "ACST",
+ "Acre Time", "ACT"};
String ADELAIDE[] = new String[] {"Central Standard Time (South Australia)", "CST",
- "Central Summer Time (South Australia)", "CST"};
+ "Central Summer Time (South Australia)", "CST",
+ "Central Time (South Australia)", "CT"};
String AGT[] = new String[] {"Argentine Time", "ART",
- "Argentine Summer Time", "ARST"};
+ "Argentine Summer Time", "ARST",
+ "Argentine Time", "ART"};
String AKST[] = new String[] {"Alaska Standard Time", "AKST",
- "Alaska Daylight Time", "AKDT"};
+ "Alaska Daylight Time", "AKDT",
+ "Alaska Time", "AKT"};
String AMT[] = new String[] {"Amazon Time", "AMT",
- "Amazon Summer Time", "AMST"};
+ "Amazon Summer Time", "AMST",
+ "Amazon Time", "AMT"};
String ARAST[] = new String[] {"Arabia Standard Time", "AST",
- "Arabia Daylight Time", "ADT"};
+ "Arabia Daylight Time", "ADT",
+ "Arabia Time", "AT"};
String ARMT[] = new String[] {"Armenia Time", "AMT",
- "Armenia Summer Time", "AMST"};
+ "Armenia Summer Time", "AMST",
+ "Armenia Time", "AMT"};
String AST[] = new String[] {"Atlantic Standard Time", "AST",
- "Atlantic Daylight Time", "ADT"};
+ "Atlantic Daylight Time", "ADT",
+ "Atlantic Time", "AT"};
String BDT[] = new String[] {"Bangladesh Time", "BDT",
- "Bangladesh Summer Time", "BDST"};
+ "Bangladesh Summer Time", "BDST",
+ "Bangladesh Time", "BDT"};
String BRISBANE[] = new String[] {"Eastern Standard Time (Queensland)", "EST",
- "Eastern Summer Time (Queensland)", "EST"};
+ "Eastern Summer Time (Queensland)", "EST",
+ "Eastern Time (Queensland)", "ET"};
String BROKEN_HILL[] = new String[] {"Central Standard Time (South Australia/New South Wales)", "CST",
- "Central Summer Time (South Australia/New South Wales)", "CST"};
+ "Central Summer Time (South Australia/New South Wales)", "CST",
+ "Central Time (South Australia/New South Wales)", "CT"};
String BRT[] = new String[] {"Brasilia Time", "BRT",
- "Brasilia Summer Time", "BRST"};
+ "Brasilia Summer Time", "BRST",
+ "Brasilia Time", "BRT"};
String BTT[] = new String[] {"Bhutan Time", "BTT",
- "Bhutan Summer Time", "BTST"};
+ "Bhutan Summer Time", "BTST",
+ "Bhutan Time", "BTT"};
String CAT[] = new String[] {"Central African Time", "CAT",
- "Central African Summer Time", "CAST"};
+ "Central African Summer Time", "CAST",
+ "Central Africa Time", "CAT"};
String CET[] = new String[] {"Central European Time", "CET",
- "Central European Summer Time", "CEST"};
+ "Central European Summer Time", "CEST",
+ "Central European Time", "CET"};
String CHAST[] = new String[] {"Chatham Standard Time", "CHAST",
- "Chatham Daylight Time", "CHADT"};
+ "Chatham Daylight Time", "CHADT",
+ "Chatham Time", "CHAT"};
String CHUT[] = new String[] {"Chuuk Time", "CHUT",
- "Chuuk Summer Time", "CHUST"};
+ "Chuuk Summer Time", "CHUST",
+ "Chuuk Time", "CHUT"};
String CIT[] = new String[] {"Central Indonesia Time", "CIT",
- "Central Indonesia Summer Time", "CIST"};
+ "Central Indonesia Summer Time", "CIST",
+ "Central Indonesia Time", "CIT"};
String CLT[] = new String[] {"Chile Time", "CLT",
- "Chile Summer Time", "CLST"};
+ "Chile Summer Time", "CLST",
+ "Chile Time", "CLT"};
String CST[] = new String[] {"Central Standard Time", "CST",
- "Central Daylight Time", "CDT"};
+ "Central Daylight Time", "CDT",
+ "Central Time", "CT"};
String CTT[] = new String[] {"China Standard Time", "CST",
- "China Daylight Time", "CDT"};
+ "China Daylight Time", "CDT",
+ "China Time", "CT"};
String CUBA[] = new String[] {"Cuba Standard Time", "CST",
- "Cuba Daylight Time", "CDT"};
+ "Cuba Daylight Time", "CDT",
+ "Cuba Time", "CT"};
String DARWIN[] = new String[] {"Central Standard Time (Northern Territory)", "CST",
- "Central Summer Time (Northern Territory)", "CST"};
+ "Central Summer Time (Northern Territory)", "CST",
+ "Central Time (Northern Territory)", "CT"};
String DUBLIN[] = new String[] {"Greenwich Mean Time", "GMT",
- "Irish Summer Time", "IST"};
+ "Irish Summer Time", "IST",
+ "Irish Time", "IT"};
String EAT[] = new String[] {"Eastern African Time", "EAT",
- "Eastern African Summer Time", "EAST"};
+ "Eastern African Summer Time", "EAST",
+ "Eastern Africa Time", "EAT"};
String EASTER[] = new String[] {"Easter Is. Time", "EAST",
- "Easter Is. Summer Time", "EASST"};
+ "Easter Is. Summer Time", "EASST",
+ "Easter Is. Time", "EAST"};
String EET[] = new String[] {"Eastern European Time", "EET",
- "Eastern European Summer Time", "EEST"};
+ "Eastern European Summer Time", "EEST",
+ "Eastern European Time", "EET"};
String EGT[] = new String[] {"Eastern Greenland Time", "EGT",
- "Eastern Greenland Summer Time", "EGST"};
+ "Eastern Greenland Summer Time", "EGST",
+ "Eastern Greenland Time", "EGT"};
String EST[] = new String[] {"Eastern Standard Time", "EST",
- "Eastern Daylight Time", "EDT"};
+ "Eastern Daylight Time", "EDT",
+ "Eastern Time", "ET"};
String EST_NSW[] = new String[] {"Eastern Standard Time (New South Wales)", "EST",
- "Eastern Summer Time (New South Wales)", "EST"};
+ "Eastern Summer Time (New South Wales)", "EST",
+ "Eastern Time (New South Wales)", "ET"};
String FET[] = new String[] {"Further-eastern European Time", "FET",
- "Further-eastern European Summer Time", "FEST"};
+ "Further-eastern European Summer Time", "FEST",
+ "Further-eastern European Time", "FET"};
String GHMT[] = new String[] {"Ghana Mean Time", "GMT",
- "Ghana Summer Time", "GHST"};
+ "Ghana Summer Time", "GHST",
+ "Ghana Mean Time", "GMT"};
String GAMBIER[] = new String[] {"Gambier Time", "GAMT",
- "Gambier Summer Time", "GAMST"};
+ "Gambier Summer Time", "GAMST",
+ "Gambier Time", "GAMT"};
String GMT[] = new String[] {"Greenwich Mean Time", "GMT",
+ "Greenwich Mean Time", "GMT",
"Greenwich Mean Time", "GMT"};
String GMTBST[] = new String[] {"Greenwich Mean Time", "GMT",
- "British Summer Time", "BST"};
+ "British Summer Time", "BST",
+ "British Time", "BT"};
String GST[] = new String[] {"Gulf Standard Time", "GST",
- "Gulf Daylight Time", "GDT"};
+ "Gulf Daylight Time", "GDT",
+ "Gulf Time", "GT"};
String HAST[] = new String[] {"Hawaii-Aleutian Standard Time", "HAST",
- "Hawaii-Aleutian Daylight Time", "HADT"};
+ "Hawaii-Aleutian Daylight Time", "HADT",
+ "Hawaii-Aleutian Time", "HAT"};
String HKT[] = new String[] {"Hong Kong Time", "HKT",
- "Hong Kong Summer Time", "HKST"};
+ "Hong Kong Summer Time", "HKST",
+ "Hong Kong Time", "HKT"};
String HST[] = new String[] {"Hawaii Standard Time", "HST",
- "Hawaii Daylight Time", "HDT"};
+ "Hawaii Daylight Time", "HDT",
+ "Hawaii Time", "HT"};
String ICT[] = new String[] {"Indochina Time", "ICT",
- "Indochina Summer Time", "ICST"};
+ "Indochina Summer Time", "ICST",
+ "Indochina Time", "ICT"};
String IRT[] = new String[] {"Iran Standard Time", "IRST",
- "Iran Daylight Time", "IRDT"};
+ "Iran Daylight Time", "IRDT",
+ "Iran Time", "IRT"};
String ISRAEL[] = new String[] {"Israel Standard Time", "IST",
- "Israel Daylight Time", "IDT"};
+ "Israel Daylight Time", "IDT",
+ "Israel Time", "IT"};
String IST[] = new String[] {"India Standard Time", "IST",
- "India Daylight Time", "IDT"};
+ "India Daylight Time", "IDT",
+ "India Time", "IT"};
String JST[] = new String[] {"Japan Standard Time", "JST",
- "Japan Daylight Time", "JDT"};
+ "Japan Daylight Time", "JDT",
+ "Japan Time", "JT"};
String KST[] = new String[] {"Korea Standard Time", "KST",
- "Korea Daylight Time", "KDT"};
+ "Korea Daylight Time", "KDT",
+ "Korea Time", "KT"};
String LORD_HOWE[] = new String[] {"Lord Howe Standard Time", "LHST",
- "Lord Howe Summer Time", "LHST"};
+ "Lord Howe Summer Time", "LHST",
+ "Lord Howe Time", "LHT"};
String MHT[] = new String[] {"Marshall Islands Time", "MHT",
- "Marshall Islands Summer Time", "MHST"};
+ "Marshall Islands Summer Time", "MHST",
+ "Marshall Islands Time", "MHT"};
String MSK[] = new String[] {"Moscow Standard Time", "MSK",
- "Moscow Daylight Time", "MSD"};
+ "Moscow Daylight Time", "MSD",
+ "Moscow Time", "MT"};
String MST[] = new String[] {"Mountain Standard Time", "MST",
- "Mountain Daylight Time", "MDT"};
+ "Mountain Daylight Time", "MDT",
+ "Mountain Time", "MT"};
String MYT[] = new String[] {"Malaysia Time", "MYT",
- "Malaysia Summer Time", "MYST"};
+ "Malaysia Summer Time", "MYST",
+ "Malaysia Time", "MYT"};
String NORONHA[] = new String[] {"Fernando de Noronha Time", "FNT",
- "Fernando de Noronha Summer Time", "FNST"};
+ "Fernando de Noronha Summer Time", "FNST",
+ "Fernando de Noronha Time", "FNT"};
String NOVT[] = new String[] {"Novosibirsk Time", "NOVT",
- "Novosibirsk Summer Time", "NOVST"};
+ "Novosibirsk Summer Time", "NOVST",
+ "Novosibirsk Time", "NOVT"};
String NPT[] = new String[] {"Nepal Time", "NPT",
- "Nepal Summer Time", "NPST"};
+ "Nepal Summer Time", "NPST",
+ "Nepal Time", "NPT"};
String NST[] = new String[] {"Newfoundland Standard Time", "NST",
- "Newfoundland Daylight Time", "NDT"};
+ "Newfoundland Daylight Time", "NDT",
+ "Newfoundland Time", "NT"};
String NZST[] = new String[] {"New Zealand Standard Time", "NZST",
- "New Zealand Daylight Time", "NZDT"};
+ "New Zealand Daylight Time", "NZDT",
+ "New Zealand Time", "NZT"};
String PITCAIRN[] = new String[] {"Pitcairn Standard Time", "PST",
- "Pitcairn Daylight Time", "PDT"};
+ "Pitcairn Daylight Time", "PDT",
+ "Pitcairn Time", "PT"};
String PKT[] = new String[] {"Pakistan Time", "PKT",
- "Pakistan Summer Time", "PKST"};
+ "Pakistan Summer Time", "PKST",
+ "Pakistan Time", "PKT"};
String PONT[] = new String[] {"Pohnpei Time", "PONT",
- "Pohnpei Summer Time", "PONST"};
+ "Pohnpei Summer Time", "PONST",
+ "Ponape Time", "PONT"};
String PST[] = new String[] {"Pacific Standard Time", "PST",
- "Pacific Daylight Time", "PDT"};
+ "Pacific Daylight Time", "PDT",
+ "Pacific Time", "PT"};
String SAST[] = new String[] {"South Africa Standard Time", "SAST",
- "South Africa Summer Time", "SAST"};
+ "South Africa Summer Time", "SAST",
+ "South Africa Time", "SAT"};
String SBT[] = new String[] {"Solomon Is. Time", "SBT",
- "Solomon Is. Summer Time", "SBST"};
+ "Solomon Is. Summer Time", "SBST",
+ "Solomon Is. Time", "SBT"};
String SGT[] = new String[] {"Singapore Time", "SGT",
- "Singapore Summer Time", "SGST"};
+ "Singapore Summer Time", "SGST",
+ "Singapore Time", "SGT"};
String SLST[] = new String[] {"Greenwich Mean Time", "GMT",
- "Sierra Leone Summer Time", "SLST"};
+ "Sierra Leone Summer Time", "SLST",
+ "Sierra Leone Time", "SLT"};
String TASMANIA[] = new String[] {"Eastern Standard Time (Tasmania)", "EST",
- "Eastern Summer Time (Tasmania)", "EST"};
+ "Eastern Summer Time (Tasmania)", "EST",
+ "Eastern Time (Tasmania)", "ET"};
String TMT[] = new String[] {"Turkmenistan Time", "TMT",
- "Turkmenistan Summer Time", "TMST"};
+ "Turkmenistan Summer Time", "TMST",
+ "Turkmenistan Time", "TMT"};
String ULAT[]= new String[] {"Ulaanbaatar Time", "ULAT",
- "Ulaanbaatar Summer Time", "ULAST"};
+ "Ulaanbaatar Summer Time", "ULAST",
+ "Ulaanbaatar Time", "ULAT"};
String WART[] = new String[] {"Western Argentine Time", "WART",
- "Western Argentine Summer Time", "WARST"};
+ "Western Argentine Summer Time", "WARST",
+ "Western Argentine Time", "WART"};
String WAT[] = new String[] {"Western African Time", "WAT",
- "Western African Summer Time", "WAST"};
+ "Western African Summer Time", "WAST",
+ "Western African Time", "WAT"};
String WET[] = new String[] {"Western European Time", "WET",
- "Western European Summer Time", "WEST"};
+ "Western European Summer Time", "WEST",
+ "Western European Time", "WET"};
String WIT[] = new String[] {"West Indonesia Time", "WIT",
- "West Indonesia Summer Time", "WIST"};
+ "West Indonesia Summer Time", "WIST",
+ "West Indonesia Time", "WIT"};
String WST_AUS[] = new String[] {"Western Standard Time (Australia)", "WST",
- "Western Summer Time (Australia)", "WST"};
+ "Western Summer Time (Australia)", "WST",
+ "Western Time (Australia)", "WT"};
String SAMOA[] = new String[] {"Samoa Standard Time", "SST",
- "Samoa Daylight Time", "SDT"};
+ "Samoa Daylight Time", "SDT",
+ "Samoa Time", "ST"};
String WST_SAMOA[] = new String[] {"West Samoa Time", "WST",
- "West Samoa Daylight Time", "WSDT"};
+ "West Samoa Daylight Time", "WSDT",
+ "West Samoa Time", "WST"};
String ChST[] = new String[] {"Chamorro Standard Time", "ChST",
- "Chamorro Daylight Time", "ChDT"};
+ "Chamorro Daylight Time", "ChDT",
+ "Chamorro Time", "ChT"};
String VICTORIA[] = new String[] {"Eastern Standard Time (Victoria)", "EST",
- "Eastern Summer Time (Victoria)", "EST"};
+ "Eastern Summer Time (Victoria)", "EST",
+ "Eastern Time (Victoria)", "ET"};
String UTC[] = new String[] {"Coordinated Universal Time", "UTC",
+ "Coordinated Universal Time", "UTC",
"Coordinated Universal Time", "UTC"};
String UZT[] = new String[] {"Uzbekistan Time", "UZT",
- "Uzbekistan Summer Time", "UZST"};
+ "Uzbekistan Summer Time", "UZST",
+ "Uzbekistan Time", "UZT"};
return new Object[][] {
{"America/Los_Angeles", PST},
@@ -309,7 +387,8 @@
{"America/Argentina/Ushuaia", AGT},
{"America/Aruba", AST},
{"America/Asuncion", new String[] {"Paraguay Time", "PYT",
- "Paraguay Summer Time", "PYST"}},
+ "Paraguay Summer Time", "PYST",
+ "Paraguay Time", "PYT"}},
{"America/Atikokan", EST},
{"America/Atka", HAST},
{"America/Bahia", BRT},
@@ -320,17 +399,20 @@
{"America/Blanc-Sablon", AST},
{"America/Boa_Vista", AMT},
{"America/Bogota", new String[] {"Colombia Time", "COT",
- "Colombia Summer Time", "COST"}},
+ "Colombia Summer Time", "COST",
+ "Colombia Time", "COT"}},
{"America/Boise", MST},
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
{"America/Cancun", CST},
{"America/Caracas", new String[] {"Venezuela Time", "VET",
- "Venezuela Summer Time", "VEST"}},
+ "Venezuela Summer Time", "VEST",
+ "Venezuela Time", "VET"}},
{"America/Catamarca", AGT},
{"America/Cayenne", new String[] {"French Guiana Time", "GFT",
- "French Guiana Summer Time", "GFST"}},
+ "French Guiana Summer Time", "GFST",
+ "French Guiana Time", "GFT"}},
{"America/Cayman", EST},
{"America/Chihuahua", MST},
{"America/Creston", MST},
@@ -352,16 +434,19 @@
{"America/Fortaleza", BRT},
{"America/Glace_Bay", AST},
{"America/Godthab", new String[] {"Western Greenland Time", "WGT",
- "Western Greenland Summer Time", "WGST"}},
+ "Western Greenland Summer Time", "WGST",
+ "Western Greenland Time", "WGT"}},
{"America/Goose_Bay", AST},
{"America/Grand_Turk", EST},
{"America/Grenada", AST},
{"America/Guadeloupe", AST},
{"America/Guatemala", CST},
{"America/Guayaquil", new String[] {"Ecuador Time", "ECT",
- "Ecuador Summer Time", "ECST"}},
+ "Ecuador Summer Time", "ECST",
+ "Ecuador Time", "ECT"}},
{"America/Guyana", new String[] {"Guyana Time", "GYT",
- "Guyana Summer Time", "GYST"}},
+ "Guyana Summer Time", "GYST",
+ "Guyana Time", "GYT"}},
{"America/Havana", CUBA},
{"America/Hermosillo", MST},
{"America/Indiana/Indianapolis", EST},
@@ -382,9 +467,11 @@
{"America/Knox_IN", CST},
{"America/Kralendijk", AST},
{"America/La_Paz", new String[] {"Bolivia Time", "BOT",
- "Bolivia Summer Time", "BOST"}},
+ "Bolivia Summer Time", "BOST",
+ "Bolivia Time", "BOT"}},
{"America/Lima", new String[] {"Peru Time", "PET",
- "Peru Summer Time", "PEST"}},
+ "Peru Summer Time", "PEST",
+ "Peru Time", "PET"}},
{"America/Louisville", EST},
{"America/Lower_Princes", AST},
{"America/Maceio", BRT},
@@ -398,13 +485,16 @@
{"America/Menominee", CST},
{"America/Merida", CST},
{"America/Metlakatla", new String[] {"Metlakatla Standard Time", "MeST",
- "Metlakatla Daylight Time", "MeDT"}},
+ "Metlakatla Daylight Time", "MeDT",
+ "Metlakatla Time", "MeT"}},
{"America/Mexico_City", CST},
{"America/Miquelon", new String[] {"Pierre & Miquelon Standard Time", "PMST",
- "Pierre & Miquelon Daylight Time", "PMDT"}},
+ "Pierre & Miquelon Daylight Time", "PMDT",
+ "Pierre & Miquelon Time", "PMT"}},
{"America/Moncton", AST},
{"America/Montevideo", new String[] {"Uruguay Time", "UYT",
- "Uruguay Summer Time", "UYST"}},
+ "Uruguay Summer Time", "UYST",
+ "Uruguay Time", "UYT"}},
{"America/Monterrey", CST},
{"America/Montreal", EST},
{"America/Montserrat", AST},
@@ -419,7 +509,8 @@
{"America/Panama", EST},
{"America/Pangnirtung", EST},
{"America/Paramaribo", new String[] {"Suriname Time", "SRT",
- "Suriname Summer Time", "SRST"}},
+ "Suriname Summer Time", "SRST",
+ "Suriname Time", "SRT"}},
{"America/Port-au-Prince", EST},
{"America/Port_of_Spain", AST},
{"America/Porto_Acre", AMT},
@@ -459,113 +550,143 @@
{"America/Yellowknife", MST},
{"Antarctica/Casey", WST_AUS},
{"Antarctica/Davis", new String[] {"Davis Time", "DAVT",
- "Davis Summer Time", "DAVST"}},
+ "Davis Summer Time", "DAVST",
+ "Davis Time", "DAVT"}},
{"Antarctica/DumontDUrville", new String[] {"Dumont-d'Urville Time", "DDUT",
- "Dumont-d'Urville Summer Time", "DDUST"}},
+ "Dumont-d'Urville Summer Time", "DDUST",
+ "Dumont-d'Urville Time", "DDUT"}},
{"Antarctica/Macquarie", new String[] {"Macquarie Island Time", "MIST",
- "Macquarie Island Summer Time", "MIST"}},
+ "Macquarie Island Summer Time", "MIST",
+ "Macquarie Island Time", "MIST"}},
{"Antarctica/Mawson", new String[] {"Mawson Time", "MAWT",
- "Mawson Summer Time", "MAWST"}},
+ "Mawson Summer Time", "MAWST",
+ "Mawson Time", "MAWT"}},
{"Antarctica/McMurdo", NZST},
{"Antarctica/Palmer", CLT},
{"Antarctica/Rothera", new String[] {"Rothera Time", "ROTT",
- "Rothera Summer Time", "ROTST"}},
+ "Rothera Summer Time", "ROTST",
+ "Rothera Time", "ROTT"}},
{"Antarctica/South_Pole", NZST},
{"Antarctica/Syowa", new String[] {"Syowa Time", "SYOT",
- "Syowa Summer Time", "SYOST"}},
+ "Syowa Summer Time", "SYOST",
+ "Syowa Time", "SYOT"}},
{"Antarctica/Vostok", new String[] {"Vostok Time", "VOST",
- "Vostok Summer Time", "VOSST"}},
+ "Vostok Summer Time", "VOSST",
+ "Vostok Time", "VOST"}},
{"Arctic/Longyearbyen", CET},
{"Asia/Aden", ARAST},
{"Asia/Almaty", new String[] {"Alma-Ata Time", "ALMT",
- "Alma-Ata Summer Time", "ALMST"}},
+ "Alma-Ata Summer Time", "ALMST",
+ "Alma-Ata Time", "ALMT"}},
{"Asia/Amman", EET},
{"Asia/Anadyr", new String[] {"Anadyr Time", "ANAT",
- "Anadyr Summer Time", "ANAST"}},
+ "Anadyr Summer Time", "ANAST",
+ "Anadyr Time", "ANAT"}},
{"Asia/Aqtau", new String[] {"Aqtau Time", "AQTT",
- "Aqtau Summer Time", "AQTST"}},
+ "Aqtau Summer Time", "AQTST",
+ "Aqtau Time", "AQTT"}},
{"Asia/Aqtobe", new String[] {"Aqtobe Time", "AQTT",
- "Aqtobe Summer Time", "AQTST"}},
+ "Aqtobe Summer Time", "AQTST",
+ "Aqtobe Time", "AQTT"}},
{"Asia/Ashgabat", TMT},
{"Asia/Ashkhabad", TMT},
{"Asia/Baghdad", ARAST},
{"Asia/Bahrain", ARAST},
{"Asia/Baku", new String[] {"Azerbaijan Time", "AZT",
- "Azerbaijan Summer Time", "AZST"}},
+ "Azerbaijan Summer Time", "AZST",
+ "Azerbaijan Time", "AZT"}},
{"Asia/Bangkok", ICT},
{"Asia/Beirut", EET},
{"Asia/Bishkek", new String[] {"Kirgizstan Time", "KGT",
- "Kirgizstan Summer Time", "KGST"}},
+ "Kirgizstan Summer Time", "KGST",
+ "Kirgizstan Time", "KGT"}},
{"Asia/Brunei", new String[] {"Brunei Time", "BNT",
- "Brunei Summer Time", "BNST"}},
+ "Brunei Summer Time", "BNST",
+ "Brunei Time", "BNT"}},
{"Asia/Calcutta", IST},
{"Asia/Choibalsan", new String[] {"Choibalsan Time", "CHOT",
- "Choibalsan Summer Time", "CHOST"}},
+ "Choibalsan Summer Time", "CHOST",
+ "Choibalsan Time", "CHOT"}},
{"Asia/Chongqing", CTT},
{"Asia/Chungking", CTT},
{"Asia/Colombo", IST},
{"Asia/Dacca", BDT},
{"Asia/Dhaka", BDT},
{"Asia/Dili", new String[] {"Timor-Leste Time", "TLT",
- "Timor-Leste Summer Time", "TLST"}},
+ "Timor-Leste Summer Time", "TLST",
+ "Timor-Leste Time", "TLT"}},
{"Asia/Damascus", EET},
{"Asia/Dubai", GST},
{"Asia/Dushanbe", new String[] {"Tajikistan Time", "TJT",
- "Tajikistan Summer Time", "TJST"}},
+ "Tajikistan Summer Time", "TJST",
+ "Tajikistan Time", "TJT"}},
{"Asia/Gaza", EET},
{"Asia/Harbin", CTT},
{"Asia/Hebron", EET},
{"Asia/Ho_Chi_Minh", ICT},
{"Asia/Hong_Kong", HKT},
{"Asia/Hovd", new String[] {"Hovd Time", "HOVT",
- "Hovd Summer Time", "HOVST"}},
+ "Hovd Summer Time", "HOVST",
+ "Hovd Time", "HOVT"}},
{"Asia/Irkutsk", new String[] {"Irkutsk Time", "IRKT",
- "Irkutsk Summer Time", "IRKST"}},
+ "Irkutsk Summer Time", "IRKST",
+ "Irkutsk Time", "IRKT"}},
{"Asia/Istanbul", EET},
{"Asia/Jakarta", WIT},
{"Asia/Jayapura", new String[] {"East Indonesia Time", "EIT",
- "East Indonesia Summer Time", "EIST"}},
+ "East Indonesia Summer Time", "EIST",
+ "East Indonesia Time", "EIT"}},
{"Asia/Kabul", new String[] {"Afghanistan Time", "AFT",
- "Afghanistan Summer Time", "AFST"}},
+ "Afghanistan Summer Time", "AFST",
+ "Afghanistan Time", "AFT"}},
{"Asia/Kamchatka", new String[] {"Petropavlovsk-Kamchatski Time", "PETT",
- "Petropavlovsk-Kamchatski Summer Time", "PETST"}},
+ "Petropavlovsk-Kamchatski Summer Time", "PETST",
+ "Petropavlovsk-Kamchatski Time", "PETT"}},
{"Asia/Karachi", PKT},
{"Asia/Kashgar", CTT},
{"Asia/Kathmandu", NPT},
{"Asia/Katmandu", NPT},
{"Asia/Kolkata", IST},
{"Asia/Krasnoyarsk", new String[] {"Krasnoyarsk Time", "KRAT",
- "Krasnoyarsk Summer Time", "KRAST"}},
+ "Krasnoyarsk Summer Time", "KRAST",
+ "Krasnoyarsk Time", "KRAT"}},
{"Asia/Kuala_Lumpur", MYT},
{"Asia/Kuching", MYT},
{"Asia/Kuwait", ARAST},
{"Asia/Macao", CTT},
{"Asia/Macau", CTT},
{"Asia/Magadan", new String[] {"Magadan Time", "MAGT",
- "Magadan Summer Time", "MAGST"}},
+ "Magadan Summer Time", "MAGST",
+ "Magadan Time", "MAGT"}},
{"Asia/Makassar", CIT},
{"Asia/Manila", new String[] {"Philippines Time", "PHT",
- "Philippines Summer Time", "PHST"}},
+ "Philippines Summer Time", "PHST",
+ "Philippines Time", "PHT"}},
{"Asia/Muscat", GST},
{"Asia/Nicosia", EET},
{"Asia/Novokuznetsk", NOVT},
{"Asia/Novosibirsk", NOVT},
{"Asia/Oral", new String[] {"Oral Time", "ORAT",
- "Oral Summer Time", "ORAST"}},
+ "Oral Summer Time", "ORAST",
+ "Oral Time", "ORAT"}},
{"Asia/Omsk", new String[] {"Omsk Time", "OMST",
- "Omsk Summer Time", "OMSST"}},
+ "Omsk Summer Time", "OMSST",
+ "Omsk Time", "OMST"}},
{"Asia/Phnom_Penh", ICT},
{"Asia/Pontianak", WIT},
{"Asia/Pyongyang", KST},
{"Asia/Qatar", ARAST},
{"Asia/Qyzylorda", new String[] {"Qyzylorda Time", "QYZT",
- "Qyzylorda Summer Time", "QYZST"}},
+ "Qyzylorda Summer Time", "QYZST",
+ "Qyzylorda Time", "QYZT"}},
{"Asia/Rangoon", new String[] {"Myanmar Time", "MMT",
- "Myanmar Summer Time", "MMST"}},
+ "Myanmar Summer Time", "MMST",
+ "Myanmar Time", "MMT"}},
{"Asia/Riyadh", ARAST},
{"Asia/Saigon", ICT},
{"Asia/Sakhalin", new String[] {"Sakhalin Time", "SAKT",
- "Sakhalin Summer Time", "SAKST"}},
+ "Sakhalin Summer Time", "SAKST",
+ "Sakhalin Time", "SAKT"}},
{"Asia/Samarkand", UZT},
{"Asia/Seoul", KST},
{"Asia/Singapore", SGT},
@@ -573,7 +694,8 @@
{"Asia/Tel_Aviv", ISRAEL},
{"Asia/Tashkent", UZT},
{"Asia/Tbilisi", new String[] {"Georgia Time", "GET",
- "Georgia Summer Time", "GEST"}},
+ "Georgia Summer Time", "GEST",
+ "Georgia Time", "GET"}},
{"Asia/Tehran", IRT},
{"Asia/Thimbu", BTT},
{"Asia/Thimphu", BTT},
@@ -583,28 +705,35 @@
{"Asia/Urumqi", CTT},
{"Asia/Vientiane", ICT},
{"Asia/Vladivostok", new String[] {"Vladivostok Time", "VLAT",
- "Vladivostok Summer Time", "VLAST"}},
+ "Vladivostok Summer Time", "VLAST",
+ "Vladivostok Time", "VLAT"}},
{"Asia/Yakutsk", new String[] {"Yakutsk Time", "YAKT",
- "Yakutsk Summer Time", "YAKST"}},
+ "Yakutsk Summer Time", "YAKST",
+ "Yakutsk Time", "YAKT"}},
{"Asia/Yekaterinburg", new String[] {"Yekaterinburg Time", "YEKT",
- "Yekaterinburg Summer Time", "YEKST"}},
+ "Yekaterinburg Summer Time", "YEKST",
+ "Yekaterinburg Time", "YEKT"}},
{"Asia/Yerevan", ARMT},
{"Atlantic/Azores", new String[] {"Azores Time", "AZOT",
- "Azores Summer Time", "AZOST"}},
+ "Azores Summer Time", "AZOST",
+ "Azores Time", "AZOT"}},
{"Atlantic/Bermuda", AST},
{"Atlantic/Canary", WET},
{"Atlantic/Cape_Verde", new String[] {"Cape Verde Time", "CVT",
- "Cape Verde Summer Time", "CVST"}},
+ "Cape Verde Summer Time", "CVST",
+ "Cape Verde Time", "CVT"}},
{"Atlantic/Faeroe", WET},
{"Atlantic/Faroe", WET},
{"Atlantic/Jan_Mayen", CET},
{"Atlantic/Madeira", WET},
{"Atlantic/Reykjavik", GMT},
{"Atlantic/South_Georgia", new String[] {"South Georgia Standard Time", "GST",
- "South Georgia Daylight Time", "GDT"}},
+ "South Georgia Daylight Time", "GDT",
+ "South Georgia Time", "GT"}},
{"Atlantic/St_Helena", GMT},
{"Atlantic/Stanley", new String[] {"Falkland Is. Time", "FKT",
- "Falkland Is. Summer Time", "FKST"}},
+ "Falkland Is. Summer Time", "FKST",
+ "Falkland Is. Time", "FKT"}},
{"Australia/ACT", EST_NSW},
{"Australia/Adelaide", ADELAIDE},
{"Australia/Brisbane", BRISBANE},
@@ -613,7 +742,8 @@
{"Australia/Currie", EST_NSW},
{"Australia/Darwin", DARWIN},
{"Australia/Eucla", new String[] {"Central Western Standard Time (Australia)", "CWST",
- "Central Western Summer Time (Australia)", "CWST"}},
+ "Central Western Summer Time (Australia)", "CWST",
+ "Central Western Time (Australia)", "CWT"}},
{"Australia/Hobart", TASMANIA},
{"Australia/LHI", LORD_HOWE},
{"Australia/Lindeman", BRISBANE},
@@ -697,7 +827,8 @@
{"Europe/Riga", EET},
{"Europe/Rome", CET},
{"Europe/Samara", new String[] {"Samara Time", "SAMT",
- "Samara Summer Time", "SAMST"}},
+ "Samara Summer Time", "SAMST",
+ "Samara Time", "SAMT"}},
{"Europe/San_Marino", CET},
{"Europe/Sarajevo", CET},
{"Europe/Simferopol", EET},
@@ -713,7 +844,8 @@
{"Europe/Vienna", CET},
{"Europe/Vilnius", EET},
{"Europe/Volgograd", new String[] {"Volgograd Time", "VOLT",
- "Volgograd Summer Time", "VOLST"}},
+ "Volgograd Summer Time", "VOLST",
+ "Volgograd Time", "VOLT"}},
{"Europe/Warsaw", CET},
{"Europe/Zagreb", CET},
{"Europe/Zaporozhye", EET},
@@ -727,30 +859,39 @@
{"IST", IST},
{"Indian/Antananarivo", EAT},
{"Indian/Chagos", new String[] {"Indian Ocean Territory Time", "IOT",
- "Indian Ocean Territory Summer Time", "IOST"}},
+ "Indian Ocean Territory Summer Time", "IOST",
+ "Indian Ocean Territory Time", "IOT"}},
{"Indian/Christmas", new String[] {"Christmas Island Time", "CXT",
- "Christmas Island Summer Time", "CXST"}},
+ "Christmas Island Summer Time", "CXST",
+ "Christmas Island Time", "CIT"}},
{"Indian/Cocos", new String[] {"Cocos Islands Time", "CCT",
- "Cocos Islands Summer Time", "CCST"}},
+ "Cocos Islands Summer Time", "CCST",
+ "Cocos Islands Time", "CCT"}},
{"Indian/Comoro", EAT},
{"Indian/Kerguelen", new String[] {"French Southern & Antarctic Lands Time", "TFT",
- "French Southern & Antarctic Lands Summer Time", "TFST"}},
+ "French Southern & Antarctic Lands Summer Time", "TFST",
+ "French Southern & Antarctic Lands Time", "TFT"}},
{"Indian/Mahe", new String[] {"Seychelles Time", "SCT",
- "Seychelles Summer Time", "SCST"}},
+ "Seychelles Summer Time", "SCST",
+ "Seychelles Time", "SCT"}},
{"Indian/Maldives", new String[] {"Maldives Time", "MVT",
- "Maldives Summer Time", "MVST"}},
+ "Maldives Summer Time", "MVST",
+ "Maldives Time", "MVT"}},
{"Indian/Mauritius", new String[] {"Mauritius Time", "MUT",
- "Mauritius Summer Time", "MUST"}},
+ "Mauritius Summer Time", "MUST",
+ "Mauritius Time", "MUT"}},
{"Indian/Mayotte", EAT},
{"Indian/Reunion", new String[] {"Reunion Time", "RET",
- "Reunion Summer Time", "REST"}},
+ "Reunion Summer Time", "REST",
+ "Reunion Time", "RET"}},
{"Israel", ISRAEL},
{"Jamaica", EST},
{"Japan", JST},
{"Kwajalein", MHT},
{"Libya", EET},
{"MET", new String[] {"Middle Europe Time", "MET",
- "Middle Europe Summer Time", "MEST"}},
+ "Middle Europe Summer Time", "MEST",
+ "Middle Europe Time", "MET"}},
{"Mexico/BajaNorte", PST},
{"Mexico/BajaSur", MST},
{"Mexico/General", CST},
@@ -770,61 +911,82 @@
{"Pacific/Chuuk", CHUT},
{"Pacific/Easter", EASTER},
{"Pacific/Efate", new String[] {"Vanuatu Time", "VUT",
- "Vanuatu Summer Time", "VUST"}},
+ "Vanuatu Summer Time", "VUST",
+ "Vanuatu Time", "VUT"}},
{"Pacific/Enderbury", new String[] {"Phoenix Is. Time", "PHOT",
- "Phoenix Is. Summer Time", "PHOST"}},
+ "Phoenix Is. Summer Time", "PHOST",
+ "Phoenix Is. Time", "PHOT"}},
{"Pacific/Fakaofo", new String[] {"Tokelau Time", "TKT",
- "Tokelau Summer Time", "TKST"}},
+ "Tokelau Summer Time", "TKST",
+ "Tokelau Time", "TKT"}},
{"Pacific/Fiji", new String[] {"Fiji Time", "FJT",
- "Fiji Summer Time", "FJST"}},
+ "Fiji Summer Time", "FJST",
+ "Fiji Time", "FJT"}},
{"Pacific/Funafuti", new String[] {"Tuvalu Time", "TVT",
- "Tuvalu Summer Time", "TVST"}},
+ "Tuvalu Summer Time", "TVST",
+ "Tuvalu Time", "TVT"}},
{"Pacific/Galapagos", new String[] {"Galapagos Time", "GALT",
- "Galapagos Summer Time", "GALST"}},
+ "Galapagos Summer Time", "GALST",
+ "Galapagos Time", "GALT"}},
{"Pacific/Gambier", GAMBIER},
{"Pacific/Guadalcanal", SBT},
{"Pacific/Guam", ChST},
{"Pacific/Johnston", HST},
{"Pacific/Kiritimati", new String[] {"Line Is. Time", "LINT",
- "Line Is. Summer Time", "LINST"}},
+ "Line Is. Summer Time", "LINST",
+ "Line Is. Time", "LINT"}},
{"Pacific/Kosrae", new String[] {"Kosrae Time", "KOST",
- "Kosrae Summer Time", "KOSST"}},
+ "Kosrae Summer Time", "KOSST",
+ "Kosrae Time", "KOST"}},
{"Pacific/Kwajalein", MHT},
{"Pacific/Majuro", MHT},
{"Pacific/Marquesas", new String[] {"Marquesas Time", "MART",
- "Marquesas Summer Time", "MARST"}},
+ "Marquesas Summer Time", "MARST",
+ "Marquesas Time", "MART"}},
{"Pacific/Midway", SAMOA},
{"Pacific/Nauru", new String[] {"Nauru Time", "NRT",
- "Nauru Summer Time", "NRST"}},
+ "Nauru Summer Time", "NRST",
+ "Nauru Time", "NRT"}},
{"Pacific/Niue", new String[] {"Niue Time", "NUT",
- "Niue Summer Time", "NUST"}},
+ "Niue Summer Time", "NUST",
+ "Niue Time", "NUT"}},
{"Pacific/Norfolk", new String[] {"Norfolk Time", "NFT",
- "Norfolk Summer Time", "NFST"}},
+ "Norfolk Summer Time", "NFST",
+ "Norfolk Time", "NFT"}},
{"Pacific/Noumea", new String[] {"New Caledonia Time", "NCT",
- "New Caledonia Summer Time", "NCST"}},
+ "New Caledonia Summer Time", "NCST",
+ "New Caledonia Time", "NCT"}},
{"Pacific/Pago_Pago", SAMOA},
{"Pacific/Palau", new String[] {"Palau Time", "PWT",
- "Palau Summer Time", "PWST"}},
+ "Palau Summer Time", "PWST",
+ "Palau Time", "PWT"}},
{"Pacific/Pitcairn", PITCAIRN},
{"Pacific/Pohnpei", PONT},
{"Pacific/Ponape", PONT},
{"Pacific/Port_Moresby", new String[] {"Papua New Guinea Time", "PGT",
- "Papua New Guinea Summer Time", "PGST"}},
+ "Papua New Guinea Summer Time", "PGST",
+ "Papua New Guinea Time", "PGT"}},
{"Pacific/Rarotonga", new String[] {"Cook Is. Time", "CKT",
- "Cook Is. Summer Time", "CKHST"}},
+ "Cook Is. Summer Time", "CKHST",
+ "Cook Is. Time", "CKT"}},
{"Pacific/Saipan", ChST},
{"Pacific/Samoa", SAMOA},
{"Pacific/Tahiti", new String[] {"Tahiti Time", "TAHT",
- "Tahiti Summer Time", "TAHST"}},
+ "Tahiti Summer Time", "TAHST",
+ "Tahiti Time", "TAHT"}},
{"Pacific/Tarawa", new String[] {"Gilbert Is. Time", "GILT",
- "Gilbert Is. Summer Time", "GILST"}},
+ "Gilbert Is. Summer Time", "GILST",
+ "Gilbert Is. Time", "GILT"}},
{"Pacific/Tongatapu", new String[] {"Tonga Time", "TOT",
- "Tonga Summer Time", "TOST"}},
+ "Tonga Summer Time", "TOST",
+ "Tonga Time", "TOT"}},
{"Pacific/Truk", CHUT},
{"Pacific/Wake", new String[] {"Wake Time", "WAKT",
- "Wake Summer Time", "WAKST"}},
+ "Wake Summer Time", "WAKST",
+ "Wake Time", "WAKT"}},
{"Pacific/Wallis", new String[] {"Wallis & Futuna Time", "WFT",
- "Wallis & Futuna Summer Time", "WFST"}},
+ "Wallis & Futuna Summer Time", "WFST",
+ "Wallis & Futuna Time", "WFT"}},
{"Pacific/Yap", CHUT},
{"Poland", CET},
{"PRC", CTT},
--- a/jdk/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/classes/sun/util/resources/TimeZoneNamesBundle.java Mon Dec 24 11:46:38 2012 -0800
@@ -42,6 +42,9 @@
import java.util.Map;
import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.MissingResourceException;
+import java.util.Set;
/**
* Subclass of <code>ResourceBundle</code> with special
@@ -58,6 +61,26 @@
public abstract class TimeZoneNamesBundle extends OpenListResourceBundle {
/**
+ * Returns a String array containing time zone names. The String array has
+ * at most size elements.
+ *
+ * @param key the time zone ID for which names are obtained
+ * @param size the requested size of array for names
+ * @return a String array containing names
+ */
+ public String[] getStringArray(String key, int size) {
+ String[] names = handleGetObject(key, size);
+ if ((names == null || names.length != size) && parent != null) {
+ names = ((TimeZoneNamesBundle)parent).getStringArray(key, size);
+ }
+ if (names == null) {
+ throw new MissingResourceException("no time zone names", getClass().getName(), key);
+ }
+ return names;
+
+ }
+
+ /**
* Maps time zone IDs to locale-specific names.
* The value returned is an array of five strings:
* <ul>
@@ -71,13 +94,17 @@
* <code>getContents</code> implementations, while the time zone
* ID is inserted into the returned array by this method.
*/
+ @Override
public Object handleGetObject(String key) {
+ return handleGetObject(key, 5);
+ }
+
+ private String[] handleGetObject(String key, int n) {
String[] contents = (String[]) super.handleGetObject(key);
if (contents == null) {
return null;
}
-
- int clen = contents.length;
+ int clen = Math.min(n, contents.length);
String[] tmpobj = new String[clen+1];
tmpobj[0] = key;
System.arraycopy(contents, 0, tmpobj, 1, clen);
@@ -85,14 +112,24 @@
}
/**
- * Use LinkedHashMap to preserve order of bundle entries.
+ * Use LinkedHashMap to preserve the order of bundle entries.
*/
@Override
- protected Map<String, Object> createMap(int size) {
+ protected <K, V> Map<K, V> createMap(int size) {
return new LinkedHashMap<>(size);
}
/**
+ * Use LinkedHashSet to preserve the key order.
+ * @param <E> the type of elements
+ * @return a Set
+ */
+ @Override
+ protected <E> Set<E> createSet() {
+ return new LinkedHashSet<>();
+ }
+
+ /**
* Provides key/value mappings for a specific
* resource bundle. Each entry of the array
* returned must be an array with two elements:
--- a/jdk/src/share/javavm/export/classfile_constants.h Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/javavm/export/classfile_constants.h Mon Dec 24 11:46:38 2012 -0800
@@ -31,7 +31,7 @@
#endif
/* Classfile version number for this information */
-#define JVM_CLASSFILE_MAJOR_VERSION 51
+#define JVM_CLASSFILE_MAJOR_VERSION 52
#define JVM_CLASSFILE_MINOR_VERSION 0
/* Flags */
--- a/jdk/src/share/lib/security/java.security Thu Dec 20 10:22:19 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,398 +0,0 @@
-#
-# This is the "master security properties file".
-#
-# An alternate java.security properties file may be specified
-# from the command line via the system property
-#
-# -Djava.security.properties=<URL>
-#
-# This properties file appends to the master security properties file.
-# If both properties files specify values for the same key, the value
-# from the command-line properties file is selected, as it is the last
-# one loaded.
-#
-# Also, if you specify
-#
-# -Djava.security.properties==<URL> (2 equals),
-#
-# then that properties file completely overrides the master security
-# properties file.
-#
-# To disable the ability to specify an additional properties file from
-# the command line, set the key security.overridePropertiesFile
-# to false in the master security properties file. It is set to true
-# by default.
-
-# In this file, various security properties are set for use by
-# java.security classes. This is where users can statically register
-# Cryptography Package Providers ("providers" for short). The term
-# "provider" refers to a package or set of packages that supply a
-# concrete implementation of a subset of the cryptography aspects of
-# the Java Security API. A provider may, for example, implement one or
-# more digital signature algorithms or message digest algorithms.
-#
-# Each provider must implement a subclass of the Provider class.
-# To register a provider in this master security properties file,
-# specify the Provider subclass name and priority in the format
-#
-# security.provider.<n>=<className>
-#
-# This declares a provider, and specifies its preference
-# order n. The preference order is the order in which providers are
-# searched for requested algorithms (when no specific provider is
-# requested). The order is 1-based; 1 is the most preferred, followed
-# by 2, and so on.
-#
-# <className> must specify the subclass of the Provider class whose
-# constructor sets the values of various properties that are required
-# for the Java Security API to look up the algorithms or other
-# facilities implemented by the provider.
-#
-# There must be at least one provider specification in java.security.
-# There is a default provider that comes standard with the JDK. It
-# is called the "SUN" provider, and its Provider subclass
-# named Sun appears in the sun.security.provider package. Thus, the
-# "SUN" provider is registered via the following:
-#
-# security.provider.1=sun.security.provider.Sun
-#
-# (The number 1 is used for the default provider.)
-#
-# Note: Providers can be dynamically registered instead by calls to
-# either the addProvider or insertProviderAt method in the Security
-# class.
-
-#
-# List of providers and their preference orders (see above):
-#
-security.provider.1=sun.security.provider.Sun
-security.provider.2=sun.security.rsa.SunRsaSign
-security.provider.3=sun.security.ec.SunEC
-security.provider.4=com.sun.net.ssl.internal.ssl.Provider
-security.provider.5=com.sun.crypto.provider.SunJCE
-security.provider.6=sun.security.jgss.SunProvider
-security.provider.7=com.sun.security.sasl.Provider
-security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
-security.provider.9=sun.security.smartcardio.SunPCSC
-
-#
-# Select the source of seed data for SecureRandom. By default an
-# attempt is made to use the entropy gathering device specified by
-# the securerandom.source property. If an exception occurs when
-# accessing the URL then the traditional system/thread activity
-# algorithm is used.
-#
-# On Solaris and Linux systems, if file:/dev/urandom is specified and it
-# exists, a special SecureRandom implementation is activated by default.
-# This "NativePRNG" reads random bytes directly from /dev/urandom.
-#
-# On Windows systems, the URLs file:/dev/random and file:/dev/urandom
-# enables use of the Microsoft CryptoAPI seed functionality.
-#
-securerandom.source=file:/dev/urandom
-#
-# The entropy gathering device is described as a URL and can also
-# be specified with the system property "java.security.egd". For example,
-# -Djava.security.egd=file:/dev/urandom
-# Specifying this system property will override the securerandom.source
-# setting.
-
-#
-# Class to instantiate as the javax.security.auth.login.Configuration
-# provider.
-#
-login.configuration.provider=com.sun.security.auth.login.ConfigFile
-
-#
-# Default login configuration file
-#
-#login.config.url.1=file:${user.home}/.java.login.config
-
-#
-# Class to instantiate as the system Policy. This is the name of the class
-# that will be used as the Policy object.
-#
-policy.provider=sun.security.provider.PolicyFile
-
-# The default is to have a single system-wide policy file,
-# and a policy file in the user's home directory.
-policy.url.1=file:${java.home}/lib/security/java.policy
-policy.url.2=file:${user.home}/.java.policy
-
-# whether or not we expand properties in the policy file
-# if this is set to false, properties (${...}) will not be expanded in policy
-# files.
-policy.expandProperties=true
-
-# whether or not we allow an extra policy to be passed on the command line
-# with -Djava.security.policy=somefile. Comment out this line to disable
-# this feature.
-policy.allowSystemProperty=true
-
-# whether or not we look into the IdentityScope for trusted Identities
-# when encountering a 1.1 signed JAR file. If the identity is found
-# and is trusted, we grant it AllPermission.
-policy.ignoreIdentityScope=false
-
-#
-# Default keystore type.
-#
-keystore.type=jks
-
-#
-# List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageAccess unless the
-# corresponding RuntimePermission ("accessClassInPackage."+package) has
-# been granted.
-package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,jdk.internal.
-
-#
-# List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageDefinition unless the
-# corresponding RuntimePermission ("defineClassInPackage."+package) has
-# been granted.
-#
-# by default, none of the class loaders supplied with the JDK call
-# checkPackageDefinition.
-#
-package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,jdk.internal.
-
-#
-# Determines whether this properties file can be appended to
-# or overridden on the command line via -Djava.security.properties
-#
-security.overridePropertiesFile=true
-
-#
-# Determines the default key and trust manager factory algorithms for
-# the javax.net.ssl package.
-#
-ssl.KeyManagerFactory.algorithm=SunX509
-ssl.TrustManagerFactory.algorithm=PKIX
-
-#
-# The Java-level namelookup cache policy for successful lookups:
-#
-# any negative value: caching forever
-# any positive value: the number of seconds to cache an address for
-# zero: do not cache
-#
-# default value is forever (FOREVER). For security reasons, this
-# caching is made forever when a security manager is set. When a security
-# manager is not set, the default behavior in this implementation
-# is to cache for 30 seconds.
-#
-# NOTE: setting this to anything other than the default value can have
-# serious security implications. Do not set it unless
-# you are sure you are not exposed to DNS spoofing attack.
-#
-#networkaddress.cache.ttl=-1
-
-# The Java-level namelookup cache policy for failed lookups:
-#
-# any negative value: cache forever
-# any positive value: the number of seconds to cache negative lookup results
-# zero: do not cache
-#
-# In some Microsoft Windows networking environments that employ
-# the WINS name service in addition to DNS, name service lookups
-# that fail may take a noticeably long time to return (approx. 5 seconds).
-# For this reason the default caching policy is to maintain these
-# results for 10 seconds.
-#
-#
-networkaddress.cache.negative.ttl=10
-
-#
-# Properties to configure OCSP for certificate revocation checking
-#
-
-# Enable OCSP
-#
-# By default, OCSP is not used for certificate revocation checking.
-# This property enables the use of OCSP when set to the value "true".
-#
-# NOTE: SocketPermission is required to connect to an OCSP responder.
-#
-# Example,
-# ocsp.enable=true
-
-#
-# Location of the OCSP responder
-#
-# By default, the location of the OCSP responder is determined implicitly
-# from the certificate being validated. This property explicitly specifies
-# the location of the OCSP responder. The property is used when the
-# Authority Information Access extension (defined in RFC 3280) is absent
-# from the certificate or when it requires overriding.
-#
-# Example,
-# ocsp.responderURL=http://ocsp.example.net:80
-
-#
-# Subject name of the OCSP responder's certificate
-#
-# By default, the certificate of the OCSP responder is that of the issuer
-# of the certificate being validated. This property identifies the certificate
-# of the OCSP responder when the default does not apply. Its value is a string
-# distinguished name (defined in RFC 2253) which identifies a certificate in
-# the set of certificates supplied during cert path validation. In cases where
-# the subject name alone is not sufficient to uniquely identify the certificate
-# then both the "ocsp.responderCertIssuerName" and
-# "ocsp.responderCertSerialNumber" properties must be used instead. When this
-# property is set then those two properties are ignored.
-#
-# Example,
-# ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp"
-
-#
-# Issuer name of the OCSP responder's certificate
-#
-# By default, the certificate of the OCSP responder is that of the issuer
-# of the certificate being validated. This property identifies the certificate
-# of the OCSP responder when the default does not apply. Its value is a string
-# distinguished name (defined in RFC 2253) which identifies a certificate in
-# the set of certificates supplied during cert path validation. When this
-# property is set then the "ocsp.responderCertSerialNumber" property must also
-# be set. When the "ocsp.responderCertSubjectName" property is set then this
-# property is ignored.
-#
-# Example,
-# ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp"
-
-#
-# Serial number of the OCSP responder's certificate
-#
-# By default, the certificate of the OCSP responder is that of the issuer
-# of the certificate being validated. This property identifies the certificate
-# of the OCSP responder when the default does not apply. Its value is a string
-# of hexadecimal digits (colon or space separators may be present) which
-# identifies a certificate in the set of certificates supplied during cert path
-# validation. When this property is set then the "ocsp.responderCertIssuerName"
-# property must also be set. When the "ocsp.responderCertSubjectName" property
-# is set then this property is ignored.
-#
-# Example,
-# ocsp.responderCertSerialNumber=2A:FF:00
-
-#
-# Policy for failed Kerberos KDC lookups:
-#
-# When a KDC is unavailable (network error, service failure, etc), it is
-# put inside a blacklist and accessed less often for future requests. The
-# value (case-insensitive) for this policy can be:
-#
-# tryLast
-# KDCs in the blacklist are always tried after those not on the list.
-#
-# tryLess[:max_retries,timeout]
-# KDCs in the blacklist are still tried by their order in the configuration,
-# but with smaller max_retries and timeout values. max_retries and timeout
-# are optional numerical parameters (default 1 and 5000, which means once
-# and 5 seconds). Please notes that if any of the values defined here is
-# more than what is defined in krb5.conf, it will be ignored.
-#
-# Whenever a KDC is detected as available, it is removed from the blacklist.
-# The blacklist is reset when krb5.conf is reloaded. You can add
-# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is
-# reloaded whenever a JAAS authentication is attempted.
-#
-# Example,
-# krb5.kdc.bad.policy = tryLast
-# krb5.kdc.bad.policy = tryLess:2,2000
-krb5.kdc.bad.policy = tryLast
-
-# Algorithm restrictions for certification path (CertPath) processing
-#
-# In some environments, certain algorithms or key lengths may be undesirable
-# for certification path building and validation. For example, "MD2" is
-# generally no longer considered to be a secure hash algorithm. This section
-# describes the mechanism for disabling algorithms based on algorithm name
-# and/or key length. This includes algorithms used in certificates, as well
-# as revocation information such as CRLs and signed OCSP Responses.
-#
-# The syntax of the disabled algorithm string is described as this Java
-# BNF-style:
-# DisabledAlgorithms:
-# " DisabledAlgorithm { , DisabledAlgorithm } "
-#
-# DisabledAlgorithm:
-# AlgorithmName [Constraint]
-#
-# AlgorithmName:
-# (see below)
-#
-# Constraint:
-# KeySizeConstraint
-#
-# KeySizeConstraint:
-# keySize Operator DecimalInteger
-#
-# Operator:
-# <= | < | == | != | >= | >
-#
-# DecimalInteger:
-# DecimalDigits
-#
-# DecimalDigits:
-# DecimalDigit {DecimalDigit}
-#
-# DecimalDigit: one of
-# 1 2 3 4 5 6 7 8 9 0
-#
-# The "AlgorithmName" is the standard algorithm name of the disabled
-# algorithm. See "Java Cryptography Architecture Standard Algorithm Name
-# Documentation" for information about Standard Algorithm Names. Matching
-# is performed using a case-insensitive sub-element matching rule. (For
-# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and
-# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a
-# sub-element of the certificate algorithm name, the algorithm will be
-# rejected during certification path building and validation. For example,
-# the assertion algorithm name "DSA" will disable all certificate algorithms
-# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion
-# will not disable algorithms related to "ECDSA".
-#
-# A "Constraint" provides further guidance for the algorithm being specified.
-# The "KeySizeConstraint" requires a key of a valid size range if the
-# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the
-# key size specified in number of bits. For example, "RSA keySize <= 1024"
-# indicates that any RSA key with key size less than or equal to 1024 bits
-# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates
-# that any RSA key with key size less than 1024 or greater than 2048 should
-# be disabled. Note that the "KeySizeConstraint" only makes sense to key
-# algorithms.
-#
-# Note: This property is currently used by Oracle's PKIX implementation. It
-# is not guaranteed to be examined and used by other implementations.
-#
-# Example:
-# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
-#
-#
-jdk.certpath.disabledAlgorithms=MD2
-
-# Algorithm restrictions for Secure Socket Layer/Transport Layer Security
-# (SSL/TLS) processing
-#
-# In some environments, certain algorithms or key lengths may be undesirable
-# when using SSL/TLS. This section describes the mechanism for disabling
-# algorithms during SSL/TLS security parameters negotiation, including cipher
-# suites selection, peer authentication and key exchange mechanisms.
-#
-# For PKI-based peer authentication and key exchange mechanisms, this list
-# of disabled algorithms will also be checked during certification path
-# building and validation, including algorithms used in certificates, as
-# well as revocation information such as CRLs and signed OCSP Responses.
-# This is in addition to the jdk.certpath.disabledAlgorithms property above.
-#
-# See the specification of "jdk.certpath.disabledAlgorithms" for the
-# syntax of the disabled algorithm string.
-#
-# Note: This property is currently used by Oracle's JSSE implementation.
-# It is not guaranteed to be examined and used by other implementations.
-#
-# Example:
-# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/lib/security/java.security-linux Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,398 @@
+#
+# This is the "master security properties file".
+#
+# An alternate java.security properties file may be specified
+# from the command line via the system property
+#
+# -Djava.security.properties=<URL>
+#
+# This properties file appends to the master security properties file.
+# If both properties files specify values for the same key, the value
+# from the command-line properties file is selected, as it is the last
+# one loaded.
+#
+# Also, if you specify
+#
+# -Djava.security.properties==<URL> (2 equals),
+#
+# then that properties file completely overrides the master security
+# properties file.
+#
+# To disable the ability to specify an additional properties file from
+# the command line, set the key security.overridePropertiesFile
+# to false in the master security properties file. It is set to true
+# by default.
+
+# In this file, various security properties are set for use by
+# java.security classes. This is where users can statically register
+# Cryptography Package Providers ("providers" for short). The term
+# "provider" refers to a package or set of packages that supply a
+# concrete implementation of a subset of the cryptography aspects of
+# the Java Security API. A provider may, for example, implement one or
+# more digital signature algorithms or message digest algorithms.
+#
+# Each provider must implement a subclass of the Provider class.
+# To register a provider in this master security properties file,
+# specify the Provider subclass name and priority in the format
+#
+# security.provider.<n>=<className>
+#
+# This declares a provider, and specifies its preference
+# order n. The preference order is the order in which providers are
+# searched for requested algorithms (when no specific provider is
+# requested). The order is 1-based; 1 is the most preferred, followed
+# by 2, and so on.
+#
+# <className> must specify the subclass of the Provider class whose
+# constructor sets the values of various properties that are required
+# for the Java Security API to look up the algorithms or other
+# facilities implemented by the provider.
+#
+# There must be at least one provider specification in java.security.
+# There is a default provider that comes standard with the JDK. It
+# is called the "SUN" provider, and its Provider subclass
+# named Sun appears in the sun.security.provider package. Thus, the
+# "SUN" provider is registered via the following:
+#
+# security.provider.1=sun.security.provider.Sun
+#
+# (The number 1 is used for the default provider.)
+#
+# Note: Providers can be dynamically registered instead by calls to
+# either the addProvider or insertProviderAt method in the Security
+# class.
+
+#
+# List of providers and their preference orders (see above):
+#
+security.provider.1=sun.security.provider.Sun
+security.provider.2=sun.security.rsa.SunRsaSign
+security.provider.3=sun.security.ec.SunEC
+security.provider.4=com.sun.net.ssl.internal.ssl.Provider
+security.provider.5=com.sun.crypto.provider.SunJCE
+security.provider.6=sun.security.jgss.SunProvider
+security.provider.7=com.sun.security.sasl.Provider
+security.provider.8=org.jcp.xml.dsig.internal.dom.XMLDSigRI
+security.provider.9=sun.security.smartcardio.SunPCSC
+
+#
+# Select the source of seed data for SecureRandom. By default an
+# attempt is made to use the entropy gathering device specified by
+# the securerandom.source property. If an exception occurs when
+# accessing the URL then the traditional system/thread activity
+# algorithm is used.
+#
+# On Solaris and Linux systems, if file:/dev/urandom is specified and it
+# exists, a special SecureRandom implementation is activated by default.
+# This "NativePRNG" reads random bytes directly from /dev/urandom.
+#
+# On Windows systems, the URLs file:/dev/random and file:/dev/urandom
+# enables use of the Microsoft CryptoAPI seed functionality.
+#
+securerandom.source=file:/dev/urandom
+#
+# The entropy gathering device is described as a URL and can also
+# be specified with the system property "java.security.egd". For example,
+# -Djava.security.egd=file:/dev/urandom
+# Specifying this system property will override the securerandom.source
+# setting.
+
+#
+# Class to instantiate as the javax.security.auth.login.Configuration
+# provider.
+#
+login.configuration.provider=com.sun.security.auth.login.ConfigFile
+
+#
+# Default login configuration file
+#
+#login.config.url.1=file:${user.home}/.java.login.config
+
+#
+# Class to instantiate as the system Policy. This is the name of the class
+# that will be used as the Policy object.
+#
+policy.provider=sun.security.provider.PolicyFile
+
+# The default is to have a single system-wide policy file,
+# and a policy file in the user's home directory.
+policy.url.1=file:${java.home}/lib/security/java.policy
+policy.url.2=file:${user.home}/.java.policy
+
+# whether or not we expand properties in the policy file
+# if this is set to false, properties (${...}) will not be expanded in policy
+# files.
+policy.expandProperties=true
+
+# whether or not we allow an extra policy to be passed on the command line
+# with -Djava.security.policy=somefile. Comment out this line to disable
+# this feature.
+policy.allowSystemProperty=true
+
+# whether or not we look into the IdentityScope for trusted Identities
+# when encountering a 1.1 signed JAR file. If the identity is found
+# and is trusted, we grant it AllPermission.
+policy.ignoreIdentityScope=false
+
+#
+# Default keystore type.
+#
+keystore.type=jks
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageAccess unless the
+# corresponding RuntimePermission ("accessClassInPackage."+package) has
+# been granted.
+package.access=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,jdk.internal.
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageDefinition unless the
+# corresponding RuntimePermission ("defineClassInPackage."+package) has
+# been granted.
+#
+# by default, none of the class loaders supplied with the JDK call
+# checkPackageDefinition.
+#
+package.definition=sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.org.glassfish.external.,com.sun.org.glassfish.gmbal.,jdk.internal.
+
+#
+# Determines whether this properties file can be appended to
+# or overridden on the command line via -Djava.security.properties
+#
+security.overridePropertiesFile=true
+
+#
+# Determines the default key and trust manager factory algorithms for
+# the javax.net.ssl package.
+#
+ssl.KeyManagerFactory.algorithm=SunX509
+ssl.TrustManagerFactory.algorithm=PKIX
+
+#
+# The Java-level namelookup cache policy for successful lookups:
+#
+# any negative value: caching forever
+# any positive value: the number of seconds to cache an address for
+# zero: do not cache
+#
+# default value is forever (FOREVER). For security reasons, this
+# caching is made forever when a security manager is set. When a security
+# manager is not set, the default behavior in this implementation
+# is to cache for 30 seconds.
+#
+# NOTE: setting this to anything other than the default value can have
+# serious security implications. Do not set it unless
+# you are sure you are not exposed to DNS spoofing attack.
+#
+#networkaddress.cache.ttl=-1
+
+# The Java-level namelookup cache policy for failed lookups:
+#
+# any negative value: cache forever
+# any positive value: the number of seconds to cache negative lookup results
+# zero: do not cache
+#
+# In some Microsoft Windows networking environments that employ
+# the WINS name service in addition to DNS, name service lookups
+# that fail may take a noticeably long time to return (approx. 5 seconds).
+# For this reason the default caching policy is to maintain these
+# results for 10 seconds.
+#
+#
+networkaddress.cache.negative.ttl=10
+
+#
+# Properties to configure OCSP for certificate revocation checking
+#
+
+# Enable OCSP
+#
+# By default, OCSP is not used for certificate revocation checking.
+# This property enables the use of OCSP when set to the value "true".
+#
+# NOTE: SocketPermission is required to connect to an OCSP responder.
+#
+# Example,
+# ocsp.enable=true
+
+#
+# Location of the OCSP responder
+#
+# By default, the location of the OCSP responder is determined implicitly
+# from the certificate being validated. This property explicitly specifies
+# the location of the OCSP responder. The property is used when the
+# Authority Information Access extension (defined in RFC 3280) is absent
+# from the certificate or when it requires overriding.
+#
+# Example,
+# ocsp.responderURL=http://ocsp.example.net:80
+
+#
+# Subject name of the OCSP responder's certificate
+#
+# By default, the certificate of the OCSP responder is that of the issuer
+# of the certificate being validated. This property identifies the certificate
+# of the OCSP responder when the default does not apply. Its value is a string
+# distinguished name (defined in RFC 2253) which identifies a certificate in
+# the set of certificates supplied during cert path validation. In cases where
+# the subject name alone is not sufficient to uniquely identify the certificate
+# then both the "ocsp.responderCertIssuerName" and
+# "ocsp.responderCertSerialNumber" properties must be used instead. When this
+# property is set then those two properties are ignored.
+#
+# Example,
+# ocsp.responderCertSubjectName="CN=OCSP Responder, O=XYZ Corp"
+
+#
+# Issuer name of the OCSP responder's certificate
+#
+# By default, the certificate of the OCSP responder is that of the issuer
+# of the certificate being validated. This property identifies the certificate
+# of the OCSP responder when the default does not apply. Its value is a string
+# distinguished name (defined in RFC 2253) which identifies a certificate in
+# the set of certificates supplied during cert path validation. When this
+# property is set then the "ocsp.responderCertSerialNumber" property must also
+# be set. When the "ocsp.responderCertSubjectName" property is set then this
+# property is ignored.
+#
+# Example,
+# ocsp.responderCertIssuerName="CN=Enterprise CA, O=XYZ Corp"
+
+#
+# Serial number of the OCSP responder's certificate
+#
+# By default, the certificate of the OCSP responder is that of the issuer
+# of the certificate being validated. This property identifies the certificate
+# of the OCSP responder when the default does not apply. Its value is a string
+# of hexadecimal digits (colon or space separators may be present) which
+# identifies a certificate in the set of certificates supplied during cert path
+# validation. When this property is set then the "ocsp.responderCertIssuerName"
+# property must also be set. When the "ocsp.responderCertSubjectName" property
+# is set then this property is ignored.
+#
+# Example,
+# ocsp.responderCertSerialNumber=2A:FF:00
+
+#
+# Policy for failed Kerberos KDC lookups:
+#
+# When a KDC is unavailable (network error, service failure, etc), it is
+# put inside a blacklist and accessed less often for future requests. The
+# value (case-insensitive) for this policy can be:
+#
+# tryLast
+# KDCs in the blacklist are always tried after those not on the list.
+#
+# tryLess[:max_retries,timeout]
+# KDCs in the blacklist are still tried by their order in the configuration,
+# but with smaller max_retries and timeout values. max_retries and timeout
+# are optional numerical parameters (default 1 and 5000, which means once
+# and 5 seconds). Please notes that if any of the values defined here is
+# more than what is defined in krb5.conf, it will be ignored.
+#
+# Whenever a KDC is detected as available, it is removed from the blacklist.
+# The blacklist is reset when krb5.conf is reloaded. You can add
+# refreshKrb5Config=true to a JAAS configuration file so that krb5.conf is
+# reloaded whenever a JAAS authentication is attempted.
+#
+# Example,
+# krb5.kdc.bad.policy = tryLast
+# krb5.kdc.bad.policy = tryLess:2,2000
+krb5.kdc.bad.policy = tryLast
+
+# Algorithm restrictions for certification path (CertPath) processing
+#
+# In some environments, certain algorithms or key lengths may be undesirable
+# for certification path building and validation. For example, "MD2" is
+# generally no longer considered to be a secure hash algorithm. This section
+# describes the mechanism for disabling algorithms based on algorithm name
+# and/or key length. This includes algorithms used in certificates, as well
+# as revocation information such as CRLs and signed OCSP Responses.
+#
+# The syntax of the disabled algorithm string is described as this Java
+# BNF-style:
+# DisabledAlgorithms:
+# " DisabledAlgorithm { , DisabledAlgorithm } "
+#
+# DisabledAlgorithm:
+# AlgorithmName [Constraint]
+#
+# AlgorithmName:
+# (see below)
+#
+# Constraint:
+# KeySizeConstraint
+#
+# KeySizeConstraint:
+# keySize Operator DecimalInteger
+#
+# Operator:
+# <= | < | == | != | >= | >
+#
+# DecimalInteger:
+# DecimalDigits
+#
+# DecimalDigits:
+# DecimalDigit {DecimalDigit}
+#
+# DecimalDigit: one of
+# 1 2 3 4 5 6 7 8 9 0
+#
+# The "AlgorithmName" is the standard algorithm name of the disabled
+# algorithm. See "Java Cryptography Architecture Standard Algorithm Name
+# Documentation" for information about Standard Algorithm Names. Matching
+# is performed using a case-insensitive sub-element matching rule. (For
+# example, in "SHA1withECDSA" the sub-elements are "SHA1" for hashing and
+# "ECDSA" for signatures.) If the assertion "AlgorithmName" is a
+# sub-element of the certificate algorithm name, the algorithm will be
+# rejected during certification path building and validation. For example,
+# the assertion algorithm name "DSA" will disable all certificate algorithms
+# that rely on DSA, such as NONEwithDSA, SHA1withDSA. However, the assertion
+# will not disable algorithms related to "ECDSA".
+#
+# A "Constraint" provides further guidance for the algorithm being specified.
+# The "KeySizeConstraint" requires a key of a valid size range if the
+# "AlgorithmName" is of a key algorithm. The "DecimalInteger" indicates the
+# key size specified in number of bits. For example, "RSA keySize <= 1024"
+# indicates that any RSA key with key size less than or equal to 1024 bits
+# should be disabled, and "RSA keySize < 1024, RSA keySize > 2048" indicates
+# that any RSA key with key size less than 1024 or greater than 2048 should
+# be disabled. Note that the "KeySizeConstraint" only makes sense to key
+# algorithms.
+#
+# Note: This property is currently used by Oracle's PKIX implementation. It
+# is not guaranteed to be examined and used by other implementations.
+#
+# Example:
+# jdk.certpath.disabledAlgorithms=MD2, DSA, RSA keySize < 2048
+#
+#
+jdk.certpath.disabledAlgorithms=MD2
+
+# Algorithm restrictions for Secure Socket Layer/Transport Layer Security
+# (SSL/TLS) processing
+#
+# In some environments, certain algorithms or key lengths may be undesirable
+# when using SSL/TLS. This section describes the mechanism for disabling
+# algorithms during SSL/TLS security parameters negotiation, including cipher
+# suites selection, peer authentication and key exchange mechanisms.
+#
+# For PKI-based peer authentication and key exchange mechanisms, this list
+# of disabled algorithms will also be checked during certification path
+# building and validation, including algorithms used in certificates, as
+# well as revocation information such as CRLs and signed OCSP Responses.
+# This is in addition to the jdk.certpath.disabledAlgorithms property above.
+#
+# See the specification of "jdk.certpath.disabledAlgorithms" for the
+# syntax of the disabled algorithm string.
+#
+# Note: This property is currently used by Oracle's JSSE implementation.
+# It is not guaranteed to be examined and used by other implementations.
+#
+# Example:
+# jdk.tls.disabledAlgorithms=MD5, SHA1, DSA, RSA keySize < 2048
+
--- a/jdk/src/share/native/java/net/Inet6Address.c Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/share/native/java/net/Inet6Address.c Mon Dec 24 11:46:38 2012 -0800
@@ -38,7 +38,6 @@
jfieldID ia6_cachedscopeidID;
jfieldID ia6_scopeidsetID;
jfieldID ia6_scopeifnameID;
-jfieldID ia6_scopeifnamesetID;
jmethodID ia6_ctrID;
/*
@@ -62,8 +61,6 @@
CHECK_NULL(ia6_scopeidID);
ia6_scopeifnameID = (*env)->GetFieldID(env, ia6_class, "scope_ifname", "Ljava/net/NetworkInterface;");
CHECK_NULL(ia6_scopeifnameID);
- ia6_scopeifnamesetID = (*env)->GetFieldID(env, ia6_class, "scope_ifname_set", "Z");
- CHECK_NULL(ia6_scopeifnamesetID);
ia6_ctrID = (*env)->GetMethodID(env, ia6_class, "<init>", "()V");
CHECK_NULL(ia6_ctrID);
}
--- a/jdk/src/solaris/classes/sun/print/UnixPrintJob.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/solaris/classes/sun/print/UnixPrintJob.java Mon Dec 24 11:46:38 2012 -0800
@@ -939,7 +939,7 @@
* is not removed for some reason, request that it is
* removed when the VM exits.
*/
- spoolFile = Files.createTempFile("javaprint", ".ps").toFile();
+ spoolFile = Files.createTempFile("javaprint", "").toFile();
spoolFile.deleteOnExit();
}
result = new FileOutputStream(spoolFile);
--- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributes.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributes.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -383,20 +383,14 @@
}
int volSerialNumber() {
- if (volSerialNumber == 0)
- throw new AssertionError("Should not get here");
return volSerialNumber;
}
int fileIndexHigh() {
- if (volSerialNumber == 0)
- throw new AssertionError("Should not get here");
return fileIndexHigh;
}
int fileIndexLow() {
- if (volSerialNumber == 0)
- throw new AssertionError("Should not get here");
return fileIndexLow;
}
--- a/jdk/src/windows/native/java/net/NetworkInterface.c Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/src/windows/native/java/net/NetworkInterface.c Mon Dec 24 11:46:38 2012 -0800
@@ -178,7 +178,7 @@
int count;
netif *netifP;
DWORD i;
- int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, wlan=0, net=0;
+ int lo=0, eth=0, tr=0, fddi=0, ppp=0, sl=0, wlan=0, net=0, wlen=0;
/*
* Ask the IP Helper library to enumerate the adapters
@@ -260,8 +260,17 @@
*/
curr = (netif *)calloc(1, sizeof(netif));
if (curr != NULL) {
+ wlen = MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr,
+ ifrowP->dwDescrLen, NULL, 0);
+ if(wlen == 0) {
+ // MultiByteToWideChar should not fail
+ // But in rare case it fails, we allow 'char' to be displayed
+ curr->displayName = (char *)malloc(ifrowP->dwDescrLen + 1);
+ } else {
+ curr->displayName = (wchar_t *)malloc(wlen*(sizeof(wchar_t))+1);
+ }
+
curr->name = (char *)malloc(strlen(dev_name) + 1);
- curr->displayName = (char *)malloc(ifrowP->dwDescrLen + 1);
if (curr->name == NULL || curr->displayName == NULL) {
if (curr->name) free(curr->name);
@@ -282,8 +291,29 @@
* 32-bit numbers as index values.
*/
strcpy(curr->name, dev_name);
- strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
- curr->displayName[ifrowP->dwDescrLen] = '\0';
+ if (wlen == 0) {
+ // display char type in case of MultiByteToWideChar failure
+ strncpy(curr->displayName, ifrowP->bDescr, ifrowP->dwDescrLen);
+ curr->displayName[ifrowP->dwDescrLen] = '\0';
+ } else {
+ // call MultiByteToWideChar again to fill curr->displayName
+ // it should not fail, because we have called it once before
+ if (MultiByteToWideChar(CP_OEMCP, 0, ifrowP->bDescr,
+ ifrowP->dwDescrLen, curr->displayName, wlen) == 0) {
+ JNU_ThrowByName(env, "java/lang/Error",
+ "Cannot get multibyte char for interface display name");
+ free_netif(netifP);
+ free(tableP);
+ free(curr->name);
+ free(curr->displayName);
+ free(curr);
+ return -1;
+ } else {
+ curr->displayName[wlen*(sizeof(wchar_t))] = '\0';
+ curr->dNameIsUnicode = TRUE;
+ }
+ }
+
curr->dwIndex = ifrowP->dwIndex;
curr->ifType = ifrowP->dwType;
curr->index = GetFriendlyIfIndex(ifrowP->dwIndex);
--- a/jdk/test/Makefile Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/Makefile Mon Dec 24 11:46:38 2012 -0800
@@ -505,7 +505,7 @@
demo/jvmti demo/zipfs sample \
javax/naming com/sun/jndi \
javax/script \
- javax/sql \
+ java/sql javax/sql \
javax/smartcardio \
javax/xml/ws com/sun/internal/ws \
jdk/asm \
--- a/jdk/test/ProblemList.txt Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/ProblemList.txt Mon Dec 24 11:46:38 2012 -0800
@@ -263,10 +263,6 @@
# 7164518: no PortUnreachableException on Mac
sun/security/krb5/auto/Unreachable.java macosx-all
-# 7193792
-sun/security/pkcs11/ec/TestECDSA.java solaris-all
-sun/security/pkcs11/ec/TestECDSA.java linux-all
-
# 7193793
sun/security/pkcs11/ec/TestECDH.java linux-all
@@ -363,9 +359,6 @@
# Filed 6772009
java/util/concurrent/locks/ReentrantLock/CancelledLockLoops.java generic-all
-# 8003596
-java/util/logging/CheckLockLocationTest.java windows-all
-
# 7041639, Solaris DSA keypair generation bug
java/util/TimeZone/TimeZoneDatePermissionCheck.sh solaris-all
--- a/jdk/test/com/oracle/net/sanity.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/oracle/net/sanity.sh Mon Dec 24 11:46:38 2012 -0800
@@ -63,4 +63,4 @@
export CLASSPATH
# Run sanity test (IPv4-only for now)
-$JAVA -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}
+$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true Sanity ${IB_LINKS}
--- a/jdk/test/com/sun/corba/cachedSocket/7056731.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/corba/cachedSocket/7056731.sh Mon Dec 24 11:46:38 2012 -0800
@@ -64,12 +64,12 @@
sleep 2 #give orbd time to start
echo "started orb"
echo "starting server"
-${TESTJAVA}${FS}bin${FS}java -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . HelloServer -ORBInitialPort $PORT -ORBInitialHost localhost &
SERVER_PROC=$!
sleep 2 #give server time to start
echo "started server"
echo "starting client (debug mode)"
-${TESTJAVA}${FS}bin${FS}java -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 &
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp . -agentlib:jdwp=transport=dt_socket,server=y,address=8000 HelloClient -ORBInitialPort $PORT -ORBInitialHost localhost > client.$$ 2>&1 &
JVM_PROC=$!
sleep 2 #give jvm/debugger/client time to start
--- a/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/management/OperatingSystemMXBean/TestTotalSwap.sh Mon Dec 24 11:46:38 2012 -0800
@@ -59,7 +59,7 @@
runOne()
{
echo "runOne $@"
- $TESTJAVA/bin/java -classpath $TESTCLASSES $@ || exit 3
+ $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 3
}
solaris_swap_size()
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh Mon Dec 24 11:46:38 2012 -0800
@@ -43,7 +43,7 @@
{
echo "runOne $@"
$TESTJAVA/bin/javac -d $TESTCLASSES $TESTSRC/$@.java || exit 2
- $TESTJAVA/bin/java -classpath $TESTCLASSES $@ || exit 3
+ $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 3
}
# Test GetMaxFileDescriptorCount if we are running on Unix
--- a/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh Mon Dec 24 11:46:38 2012 -0800
@@ -43,7 +43,7 @@
{
echo "runOne $@"
$TESTJAVA/bin/javac -d $TESTCLASSES $TESTSRC/$@.java || exit 2
- $TESTJAVA/bin/java -classpath $TESTCLASSES $@ || exit 3
+ $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ || exit 3
}
# Test GetOpenFileDescriptorCount if we are running on Unix
--- a/jdk/test/com/sun/tools/attach/ApplicationSetup.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/tools/attach/ApplicationSetup.sh Mon Dec 24 11:46:38 2012 -0800
@@ -41,7 +41,7 @@
startApplication()
{
# put all output from the app into ${OUTPUTFILE}
- ${JAVA} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
+ ${JAVA} ${TESTVMOPTS} $1 $2 $3 -jar "${TESTCLASSES}"/Application.jar > ${OUTPUTFILE} 2>&1 &
pid="$!"
# MKS creates an intermediate shell to launch ${JAVA} so
@@ -78,6 +78,6 @@
stopApplication()
{
- $JAVA -classpath "${TESTCLASSES}" Shutdown $1
+ $JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}" Shutdown $1
}
--- a/jdk/test/com/sun/tools/attach/BasicTests.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/tools/attach/BasicTests.sh Mon Dec 24 11:46:38 2012 -0800
@@ -61,7 +61,7 @@
echo "Running tests ..."
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
BasicTests $pid $agent $badagent $redefineagent 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
--- a/jdk/test/com/sun/tools/attach/PermissionTests.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/tools/attach/PermissionTests.sh Mon Dec 24 11:46:38 2012 -0800
@@ -48,7 +48,7 @@
echo "Deny test"
# deny
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-Djava.security.manager \
-Djava.security.policy=${TESTSRC}/java.policy.deny \
PermissionTest $pid true 2>&1
@@ -56,7 +56,7 @@
# allow
echo "Allow test"
-$JAVA -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
+$JAVA ${TESTVMOPTS} -classpath "${TESTCLASSES}${PS}${TESTJAVA}/lib/tools.jar" \
-Djava.security.manager \
-Djava.security.policy=${TESTSRC}/java.policy.allow \
PermissionTest $pid false 2>&1
--- a/jdk/test/com/sun/tools/attach/ProviderTests.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/tools/attach/ProviderTests.sh Mon Dec 24 11:46:38 2012 -0800
@@ -45,7 +45,7 @@
echo "Running test ..."
-$JAVA -classpath \
+$JAVA ${TESTVMOPTS} -classpath \
"${TESTCLASSES}${PS}${TESTCLASSES}/SimpleProvider.jar${PS}${TESTJAVA}/lib/tools.jar" \
ProviderTest
--- a/jdk/test/com/sun/tools/extcheck/TestExtcheckArgs.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/com/sun/tools/extcheck/TestExtcheckArgs.sh Mon Dec 24 11:46:38 2012 -0800
@@ -39,7 +39,7 @@
exit $rc
fi
-${TESTJAVA}/bin/java -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} TestExtcheckArgs
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTJAVA}/lib/tools.jar${PS}${TESTCLASSES} TestExtcheckArgs
rc=$?
if [ $rc != 0 ]; then
echo Execution failure with exit status $rc
--- a/jdk/test/demo/zipfs/basic.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/demo/zipfs/basic.sh Mon Dec 24 11:46:38 2012 -0800
@@ -53,7 +53,7 @@
go() {
echo ""
- ${TESTJAVA}/bin/java $1 $2 $3 2>&1
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} $1 $2 $3 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
--- a/jdk/test/java/io/File/GetXSpace.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/File/GetXSpace.sh Mon Dec 24 11:46:38 2012 -0800
@@ -53,7 +53,7 @@
}
runTest() {
- ${TESTJAVA}/bin/java -cp ${TESTCLASSES} GetXSpace $*
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} GetXSpace $*
if [ $? -eq 0 ]
then echo "Passed"
else
--- a/jdk/test/java/io/File/MacPathTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/File/MacPathTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -36,4 +36,4 @@
TESTCLASSES=.
fi
-export LC_ALL=en_US.UTF-8 ;${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
+export LC_ALL=en_US.UTF-8 ;${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} MacPathTest
--- a/jdk/test/java/io/File/basic.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/File/basic.sh Mon Dec 24 11:46:38 2012 -0800
@@ -44,7 +44,7 @@
;;
esac
mkdir x.Basic.dir
-if $TESTJAVA/bin/java $* -classpath "$TESTCLASSES" Basic; then
+if $TESTJAVA/bin/java ${TESTVMOPTS} $* -classpath "$TESTCLASSES" Basic; then
[ -f x.Basic.rw ] && (echo "x.Basic.rw not deleted"; exit 1)
([ -d x.Basic.dir ] || [ \! -d x.Basic.dir2 ]) \
&& (echo "x.Basic.dir not renamed"; exit 1)
--- a/jdk/test/java/io/FileOutputStream/FileOpen.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/FileOutputStream/FileOpen.sh Mon Dec 24 11:46:38 2012 -0800
@@ -50,20 +50,20 @@
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\FileOpenNeg.java
echo "Opening Writable Normal File.."
- ${TESTJAVA}/bin/java FileOpenPos ${hfile}
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenPos ${hfile}
echo "Opening Writable Hidden File.."
${ATTRIB} +h ${hfile}
- ${TESTJAVA}/bin/java FileOpenNeg ${hfile}
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
echo "Opening Read-Only Normal File.."
${ATTRIB} -h ${hfile}
${ATTRIB} +r ${hfile}
- ${TESTJAVA}/bin/java FileOpenNeg ${hfile}
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
echo "Opening Read-Only Hidden File.."
${ATTRIB} +h ${hfile}
- ${TESTJAVA}/bin/java FileOpenNeg ${hfile}
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} FileOpenNeg ${hfile}
rm -f ${hfile}
exit
--- a/jdk/test/java/io/Serializable/class/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/class/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -45,85 +45,85 @@
rm -f A.java
cp ${TESTSRC}/NonSerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
echo
echo Write NonSerial1, Read NonSerial2
rm -f A.java
cp ${TESTSRC}/NonSerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/NonSerialA_2.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
echo
echo Write NonSerial1, Read Serial1
rm -f A.java
cp ${TESTSRC}/NonSerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/SerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
echo
echo Write Serial1, Read NonSerial1
rm -f A.java
cp ${TESTSRC}/SerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/NonSerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -doe
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -doe
echo
echo Write Serial1, Read Serial2
rm -f A.java
cp ${TESTSRC}/SerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/SerialA_2.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
echo
echo Write Serial2, Read Serial1
rm -f A.java
cp ${TESTSRC}/SerialA_2.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/SerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -d
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -d
echo
echo Write Serial1, Read Serial3
rm -f A.java
cp ${TESTSRC}/SerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/SerialA_3.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -de
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -de
echo
echo Write Serial3, Read Serial1
rm -f A.java
cp ${TESTSRC}/SerialA_3.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -s A
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -s A
rm -f A.java
cp ${TESTSRC}/SerialA_1.java A.java
${TESTJAVA}/bin/javac A.java
-${TESTJAVA}/bin/java Test -de
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test -de
echo
echo Passed
--- a/jdk/test/java/io/Serializable/evolution/AddedExternField/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/evolution/AddedExternField/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,7 @@
rm *.class tmp.ser
javac WriteAddedField.java
-java WriteAddedField
+java ${TESTVMOPTS} WriteAddedField
rm *.class
javac ReadAddedField.java
-java ReadAddedField
+java ${TESTVMOPTS} ReadAddedField
--- a/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/evolution/RenamePackage/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -86,13 +86,13 @@
# Run Case 1. Map test.SerialDriver within stream to install.SerialDriver.
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} test.SerialDriver -s
+${JAVA} ${TESTVMOPTS} test.SerialDriver -s
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} install.SerialDriver -d
+${JAVA} ${TESTVMOPTS} install.SerialDriver -d
rm stream.ser
# Run Case 2. Map install.SerialDriver within stream to test.SerialDriver.
CLASSPATH="${TESTCLASSES}/nclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} install.SerialDriver -s
+${JAVA} ${TESTVMOPTS} install.SerialDriver -s
CLASSPATH="${TESTCLASSES}/oclasses${PS}${TESTCLASSES}/share"; export CLASSPATH;
-${JAVA} test.SerialDriver -d
+${JAVA} ${TESTVMOPTS} test.SerialDriver -d
--- a/jdk/test/java/io/Serializable/maskSyntheticModifier/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/maskSyntheticModifier/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -41,5 +41,5 @@
set -ex
cp ${TESTSRC}/Foo.class .
${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class
--- a/jdk/test/java/io/Serializable/packageAccess/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/packageAccess/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -45,5 +45,5 @@
${TESTJAVA}/bin/jar cf foo.jar B.class D.class
rm -f B.class D.class
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/resolveClass/consTest/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/resolveClass/consTest/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -44,5 +44,5 @@
${TESTJAVA}/bin/jar cf boot.jar *.class
rm -f *.class
${TESTJAVA}/bin/javac -classpath boot.jar -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java -Xbootclasspath/a:boot.jar Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Xbootclasspath/a:boot.jar Test
rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/resolveClass/deserializeButton/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/resolveClass/deserializeButton/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -46,5 +46,5 @@
${TESTJAVA}/bin/jar cf cb.jar *.class
rm -f *.class
${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/subclass/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/subclass/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,6 @@
# @bug 4100915
mkdir classes
javac -d classes *.java
-java -classpath classes -Djava.policy=Allow.policy Test
+java ${TESTVMOPTS} -classpath classes -Djava.policy=Allow.policy Test
# ENABLE next line when new method for invoking a main with a SecureClassLoader is known
#java -classpath classes -Djava.policy=NotAllow.policy Test -expectSecurityException
--- a/jdk/test/java/io/Serializable/superclassDataLoss/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/superclassDataLoss/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -46,5 +46,5 @@
rm -f A.class B.class
${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
rm -f *.class *.jar
--- a/jdk/test/java/io/Serializable/unnamedPackageSwitch/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/io/Serializable/unnamedPackageSwitch/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -41,4 +41,4 @@
set -ex
${TESTJAVA}/bin/javac -d . ${TESTSRC}/A.java ${TESTSRC}/Test.java
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
--- a/jdk/test/java/lang/Class/forName/NonJavaNames.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/Class/forName/NonJavaNames.sh Mon Dec 24 11:46:38 2012 -0800
@@ -94,7 +94,7 @@
COPYSEMICOLON="cp ${TESTSRC}/classes/semicolon.class ${TESTCLASSES}/;.class"
$COPYSEMICOLON
-JAVA="$TESTJAVA/bin/java -classpath ${TESTSRC}/classes${SEP}${TESTCLASSES}"
+JAVA="$TESTJAVA/bin/java ${TESTVMOPTS} -classpath ${TESTSRC}/classes${SEP}${TESTCLASSES}"
$JAVA NonJavaNames
RESULT=$?
--- a/jdk/test/java/lang/ClassLoader/Assert.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/ClassLoader/Assert.sh Mon Dec 24 11:46:38 2012 -0800
@@ -49,7 +49,7 @@
${TESTJAVA}/bin/javac Assert.java
-${TESTJAVA}/bin/java Assert
+${TESTJAVA}/bin/java ${TESTVMOPTS} Assert
result=$?
if [ $result -eq 0 ]
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestCrossDelegate.sh Mon Dec 24 11:46:38 2012 -0800
@@ -98,6 +98,7 @@
# run test
${TESTJAVA}${FS}bin${FS}java \
+ ${TESTVMOPTS} \
-verbose:class -XX:+TraceClassLoading -cp . \
-Dtest.classes=${TESTCLASSES} \
Starter cross
--- a/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/ClassLoader/deadlock/TestOneWayDelegate.sh Mon Dec 24 11:46:38 2012 -0800
@@ -93,6 +93,7 @@
# run test
${TESTJAVA}${FS}bin${FS}java \
+ ${TESTVMOPTS} \
-verbose:class -XX:+TraceClassLoading -cp . \
-Dtest.classes=${TESTCLASSES} \
Starter one-way
--- a/jdk/test/java/lang/ClassLoader/getdotresource.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/ClassLoader/getdotresource.sh Mon Dec 24 11:46:38 2012 -0800
@@ -33,5 +33,5 @@
if [ x"$TESTSRC" = x ]; then TESTSRC=.; fi
# now start the test
-${TESTJAVA}/bin/java -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetDotResource
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetDotResource
--- a/jdk/test/java/lang/Runtime/exec/setcwd.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/Runtime/exec/setcwd.sh Mon Dec 24 11:46:38 2012 -0800
@@ -37,5 +37,5 @@
cp ${TESTCLASSES}/SetCwd.class foo
# now start the test
-${TESTJAVA}/bin/java SetCwd
+${TESTJAVA}/bin/java ${TESTVMOPTS} SetCwd
--- a/jdk/test/java/lang/StringCoding/CheckEncodings.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/StringCoding/CheckEncodings.sh Mon Dec 24 11:46:38 2012 -0800
@@ -49,7 +49,7 @@
echo "Testing:" ${1}
set LC_ALL="${1}"; export LC_ALL
locale
- ${TESTJAVA}/bin/java -version 2>&1
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} -version 2>&1
expectPass $?
}
--- a/jdk/test/java/lang/System/finalization/FinExit.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/System/finalization/FinExit.sh Mon Dec 24 11:46:38 2012 -0800
@@ -26,7 +26,7 @@
#
# We only want the first character, Windows might add CRLF
-x=`$TESTJAVA/bin/java -cp "$TESTCLASSES" FinExit | cut -c1`
+x=`$TESTJAVA/bin/java ${TESTVMOPTS} -cp "$TESTCLASSES" FinExit | cut -c1`
echo $x
if [ "x$x" != "x1" ]; then
echo On-exit finalizer invoked twice
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/ThreadLocal/ThreadLocalSupplierTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ * @test
+ * @run testng ThreadLocalSupplierTest
+ * @summary tests ThreadLocal.withInitial(<Supplier>).
+ * Adapted from java.lang.Basic functional test of ThreadLocal
+ *
+ * @author Jim Gish <jim.gish@oracle.com>
+ */
+@Test
+public class ThreadLocalSupplierTest {
+
+ static final class IntegerSupplier implements Supplier<Integer> {
+
+ private final AtomicInteger supply = new AtomicInteger(0);
+
+ @Override
+ public Integer get() {
+ return supply.getAndIncrement();
+ }
+
+ public int numCalls() {
+ return supply.intValue();
+ }
+ }
+
+ static IntegerSupplier theSupply = new IntegerSupplier();
+
+ static final class MyThreadLocal extends ThreadLocal<Integer> {
+
+ private final ThreadLocal<Integer> delegate;
+
+ public volatile boolean everCalled;
+
+ public MyThreadLocal(Supplier<Integer> supplier) {
+ delegate = ThreadLocal.<Integer>withInitial(supplier);
+ }
+
+ @Override
+ public Integer get() {
+ return delegate.get();
+ }
+
+ @Override
+ protected synchronized Integer initialValue() {
+ // this should never be called since we are using the factory instead
+ everCalled = true;
+ return null;
+ }
+ }
+
+ /**
+ * Our one and only ThreadLocal from which we get thread ids using a
+ * supplier which simply increments a counter on each call of get().
+ */
+ static MyThreadLocal threadLocal = new MyThreadLocal(theSupply);
+
+ public void testMultiThread() throws Exception {
+ final int threadCount = 500;
+ final Thread th[] = new Thread[threadCount];
+ final boolean visited[] = new boolean[threadCount];
+
+ // Create and start the threads
+ for (int i = 0; i < threadCount; i++) {
+ th[i] = new Thread() {
+ @Override
+ public void run() {
+ final int threadId = threadLocal.get();
+ assertFalse(visited[threadId], "visited[" + threadId + "]=" + visited[threadId]);
+ visited[threadId] = true;
+ // check the get() again
+ final int secondCheckThreadId = threadLocal.get();
+ assertEquals(secondCheckThreadId, threadId);
+ }
+ };
+ th[i].start();
+ }
+
+ // Wait for the threads to finish
+ for (int i = 0; i < threadCount; i++) {
+ th[i].join();
+ }
+
+ assertEquals(theSupply.numCalls(), threadCount);
+ // make sure the provided initialValue() has not been called
+ assertFalse(threadLocal.everCalled);
+ // Check results
+ for (int i = 0; i < threadCount; i++) {
+ assertTrue(visited[i], "visited[" + i + "]=" + visited[i]);
+ }
+ }
+
+ public void testSimple() {
+ final String expected = "OneWithEverything";
+ final ThreadLocal<String> threadLocal = ThreadLocal.<String>withInitial(() -> expected);
+ assertEquals(expected, threadLocal.get());
+ }
+}
--- a/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/annotation/loaderLeak/LoaderLeak.sh Mon Dec 24 11:46:38 2012 -0800
@@ -69,7 +69,7 @@
cp ${TESTSRC}${FS}*.java .
${TESTJAVA}${FS}bin${FS}javac -d classes A.java B.java C.java
${TESTJAVA}${FS}bin${FS}javac Main.java
-${TESTJAVA}${FS}bin${FS}java Main
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main
result=$?
if [ $result -eq 0 ]
then
@@ -78,7 +78,7 @@
echo "Failed 1 of 2"
exit $result
fi
-${TESTJAVA}${FS}bin${FS}java Main foo
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Main foo
result=$?
if [ $result -eq 0 ]
then
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/lambda/LambdaAccessControlDoPrivilegedTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8003881
+ * @summary tests DoPrivileged action (implemented as lambda expressions) by
+ * inserting them into the BootClassPath.
+ * @compile -XDignore.symbol.file LambdaAccessControlDoPrivilegedTest.java
+ * @run main/othervm LambdaAccessControlDoPrivilegedTest
+ */
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.nio.charset.Charset;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class LambdaAccessControlDoPrivilegedTest extends LUtils {
+ public static void main(String... args) {
+ final List<String> scratch = new ArrayList();
+ scratch.clear();
+ scratch.add("import java.security.*;");
+ scratch.add("public class DoPriv {");
+ scratch.add("public static void main(String... args) {");
+ scratch.add("String prop = AccessController.doPrivileged((PrivilegedAction<String>) () -> {");
+ scratch.add("return System.getProperty(\"user.home\");");
+ scratch.add("});");
+ scratch.add("}");
+ scratch.add("}");
+ File doprivJava = new File("DoPriv.java");
+ File doprivClass = getClassFile(doprivJava);
+ createFile(doprivJava, scratch);
+
+ scratch.clear();
+ scratch.add("public class Bar {");
+ scratch.add("public static void main(String... args) {");
+ scratch.add("System.out.println(\"sun.boot.class.path\" + \"=\" +");
+ scratch.add(" System.getProperty(\"sun.boot.class.path\", \"\"));");
+ scratch.add("System.setSecurityManager(new SecurityManager());");
+ scratch.add("DoPriv.main();");
+ scratch.add("}");
+ scratch.add("}");
+
+ File barJava = new File("Bar.java");
+ File barClass = getClassFile(barJava);
+ createFile(barJava, scratch);
+
+ String[] javacArgs = {barJava.getName(), doprivJava.getName()};
+ compile(javacArgs);
+ File jarFile = new File("foo.jar");
+ String[] jargs = {"cvf", jarFile.getName(), doprivClass.getName()};
+ jarTool.run(jargs);
+ doprivJava.delete();
+ doprivClass.delete();
+ TestResult tr = doExec(JAVA_CMD.getAbsolutePath(),
+ "-Xbootclasspath/p:foo.jar",
+ "-cp", ".", "Bar");
+ tr.assertZero("testDoPrivileged fails");
+ barJava.delete();
+ barClass.delete();
+ jarFile.delete();
+ }
+}
+
+/*
+ * support infrastructure to invoke a java class from the command line
+ */
+class LUtils {
+ static final sun.tools.jar.Main jarTool =
+ new sun.tools.jar.Main(System.out, System.err, "jar-tool");
+ static final com.sun.tools.javac.Main javac =
+ new com.sun.tools.javac.Main();
+ static final File cwd = new File(".").getAbsoluteFile();
+ static final String JAVAHOME = System.getProperty("java.home");
+ static final boolean isWindows =
+ System.getProperty("os.name", "unknown").startsWith("Windows");
+ //static final boolean isSDK = JAVAHOME.endsWith("jre");
+ static final File JAVA_BIN_FILE = new File(JAVAHOME, "bin");
+ static final File JAVA_CMD = new File(JAVA_BIN_FILE,
+ isWindows ? "java.exe" : "java");
+
+ protected LUtils() {
+ }
+
+ public static void compile(String... args) {
+ if (javac.compile(args) != 0) {
+ throw new RuntimeException("compilation fails");
+ }
+ }
+
+ static void createFile(File outFile, List<String> content) {
+ try {
+ Files.write(outFile.getAbsoluteFile().toPath(), content,
+ Charset.defaultCharset());
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+
+ static File getClassFile(File javaFile) {
+ return javaFile.getName().endsWith(".java")
+ ? new File(javaFile.getName().replace(".java", ".class"))
+ : null;
+ }
+
+ static String getSimpleName(File inFile) {
+ String fname = inFile.getName();
+ return fname.substring(0, fname.indexOf("."));
+ }
+
+ static TestResult doExec(String... cmds) {
+ return doExec(null, null, cmds);
+ }
+
+ /*
+ * A method which executes a java cmd and returns the results in a container
+ */
+ static TestResult doExec(Map<String, String> envToSet,
+ java.util.Set<String> envToRemove, String... cmds) {
+ String cmdStr = "";
+ for (String x : cmds) {
+ cmdStr = cmdStr.concat(x + " ");
+ }
+ ProcessBuilder pb = new ProcessBuilder(cmds);
+ Map<String, String> env = pb.environment();
+ if (envToRemove != null) {
+ for (String key : envToRemove) {
+ env.remove(key);
+ }
+ }
+ if (envToSet != null) {
+ env.putAll(envToSet);
+ }
+ BufferedReader rdr = null;
+ try {
+ List<String> outputList = new ArrayList<>();
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ rdr = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String in = rdr.readLine();
+ while (in != null) {
+ outputList.add(in);
+ in = rdr.readLine();
+ }
+ p.waitFor();
+ p.destroy();
+
+ return new TestResult(cmdStr, p.exitValue(), outputList,
+ env, new Throwable("current stack of the test"));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ throw new RuntimeException(ex.getMessage());
+ }
+ }
+
+ static class TestResult {
+ String cmd;
+ int exitValue;
+ List<String> testOutput;
+ Map<String, String> env;
+ Throwable t;
+
+ public TestResult(String str, int rv, List<String> oList,
+ Map<String, String> env, Throwable t) {
+ cmd = str;
+ exitValue = rv;
+ testOutput = oList;
+ this.env = env;
+ this.t = t;
+ }
+
+ void assertZero(String message) {
+ if (exitValue != 0) {
+ System.err.println(this);
+ throw new RuntimeException(message);
+ }
+ }
+
+ @Override
+ public String toString() {
+ StringWriter sw = new StringWriter();
+ PrintWriter status = new PrintWriter(sw);
+ status.println("Cmd: " + cmd);
+ status.println("Return code: " + exitValue);
+ status.println("Environment variable:");
+ for (String x : env.keySet()) {
+ status.println("\t" + x + "=" + env.get(x));
+ }
+ status.println("Output:");
+ for (String x : testOutput) {
+ status.println("\t" + x);
+ }
+ status.println("Exception:");
+ status.println(t.getMessage());
+ t.printStackTrace(status);
+
+ return sw.getBuffer().toString();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/lang/invoke/lambda/LambdaAccessControlTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8003881
+ * @summary tests Lambda expression with a a security manager at top level
+ * @compile -XDignore.symbol.file LambdaAccessControlTest.java
+ *
+ * @run main/othervm LambdaAccessControlTest
+ */
+
+public class LambdaAccessControlTest extends LUtils {
+ public static void main(String... args) {
+ System.setSecurityManager(new SecurityManager());
+ JJ<Integer> iii = (new CC())::impl;
+ System.out.printf(">>> %s\n", iii.foo(44));
+ iii = DD::impl;
+ System.out.printf(">>> %s\n", iii.foo(44));
+ return;
+ }
+}
+/*
+ * support classes for the test
+ */
+interface II<T> { Object foo(T x); }
+interface JJ<R extends Number> extends II<R> { }
+class CC { String impl(int i) { return "impl:"+i; }}
+class DD { static String impl(int i) { return "impl:"+i; }}
--- a/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/lang/management/OperatingSystemMXBean/TestSystemLoadAvg.sh Mon Dec 24 11:46:38 2012 -0800
@@ -52,7 +52,7 @@
runOne()
{
echo "$TESTJAVA/bin/java -classpath $TESTCLASSES $@"
- $TESTJAVA/bin/java -classpath $TESTCLASSES $@
+ $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@
}
# Retry 5 times to be more resilent to system load fluctation.
--- a/jdk/test/java/net/Authenticator/B4933582.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/Authenticator/B4933582.sh Mon Dec 24 11:46:38 2012 -0800
@@ -45,5 +45,5 @@
esac
${TESTJAVA}${FS}bin${FS}javac -d . -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest" ${TESTSRC}${FS}B4933582.java
rm -f cache.ser auth.save
-${TESTJAVA}${FS}bin${FS}java -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 first
-${TESTJAVA}${FS}bin${FS}java -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 second
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 first
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTSRC}${FS}..${FS}..${FS}..${FS}sun${FS}net${FS}www${FS}httptest${PS}." B4933582 second
--- a/jdk/test/java/net/CookieHandler/B6791927.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/CookieHandler/B6791927.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@
try {
// Forces a non US locale
Locale.setDefault(Locale.FRANCE);
- List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Wednesday, 09-Nov-2019 23:12:40 GMT");
+ List<HttpCookie> cookies = HttpCookie.parse("set-cookie: CUSTOMER=WILE_E_COYOTE; expires=Sat, 09-Nov-2019 23:12:40 GMT");
if (cookies == null || cookies.isEmpty()) {
throw new RuntimeException("No cookie found");
}
--- a/jdk/test/java/net/CookieHandler/CookieManagerTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/CookieHandler/CookieManagerTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -126,7 +126,7 @@
testPolicies[count] = CookiePolicy.ACCEPT_ORIGINAL_SERVER;
testCases[count++] = new CookieTestCase[]{
new CookieTestCase("Set-Cookie",
- "CUSTOMER=WILE:BOB; path=/; expires=Wednesday, 09-Nov-2030 23:12:40 GMT;" + "domain=." + localHostAddr,
+ "CUSTOMER=WILE:BOB; path=/; expires=Sat, 09-Nov-2030 23:12:40 GMT;" + "domain=." + localHostAddr,
"CUSTOMER=WILE:BOB",
"/"
),
--- a/jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/DatagramSocket/SetDatagramSocketImplFactory/ADatagramSocket.sh Mon Dec 24 11:46:38 2012 -0800
@@ -49,4 +49,4 @@
;;
esac
-${TESTJAVA}${FILESEP}bin${FILESEP}java -Xbootclasspath/p:${TESTCLASSES} ADatagramSocket true
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} -Xbootclasspath/p:${TESTCLASSES} ADatagramSocket true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/HttpCookie/ExpiredCookieTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8000525
+ */
+
+import java.net.*;
+import java.util.*;
+import java.io.*;
+import java.text.*;
+
+public class ExpiredCookieTest {
+ // lifted from HttpCookie.java
+ private final static String[] COOKIE_DATE_FORMATS = {
+ "EEE',' dd-MMM-yy HH:mm:ss 'GMT'",
+ "EEE',' dd MMM yy HH:mm:ss 'GMT'",
+ "EEE MMM dd yy HH:mm:ss 'GMT'Z",
+ "EEE',' dd-MMM-yyyy HH:mm:ss 'GMT'",
+ "EEE',' dd MMM yyyy HH:mm:ss 'GMT'",
+ "EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
+ };
+ static final TimeZone GMT = TimeZone.getTimeZone("GMT");
+
+ public static void main(String[] args) throws Exception {
+ Calendar cal = Calendar.getInstance(GMT);
+
+ for (int i = 0; i < COOKIE_DATE_FORMATS.length; i++) {
+ SimpleDateFormat df = new SimpleDateFormat(COOKIE_DATE_FORMATS[i],
+ Locale.US);
+ cal.set(1970, 0, 1, 0, 0, 0);
+ df.setTimeZone(GMT);
+ df.setLenient(false);
+ df.set2DigitYearStart(cal.getTime());
+ CookieManager cm = new CookieManager(
+ null, CookiePolicy.ACCEPT_ALL);
+ CookieHandler.setDefault(cm);
+ Map<String,List<String>> header = new HashMap<>();
+ List<String> values = new ArrayList<>();
+
+ cal.set(1970, 6, 9, 10, 10, 1);
+ StringBuilder datestring =
+ new StringBuilder(df.format(cal.getTime()));
+ values.add(
+ "TEST1=TEST1; Path=/; Expires=" + datestring.toString());
+
+ cal.set(1969, 6, 9, 10, 10, 2);
+ datestring = new StringBuilder(df.format(cal.getTime()));
+ values.add(
+ "TEST2=TEST2; Path=/; Expires=" + datestring.toString());
+
+ cal.set(2070, 6, 9, 10, 10, 3);
+ datestring = new StringBuilder(df.format(cal.getTime()));
+ values.add(
+ "TEST3=TEST3; Path=/; Expires=" + datestring.toString());
+
+ cal.set(2069, 6, 9, 10, 10, 4);
+ datestring = new StringBuilder(df.format(cal.getTime()));
+ values.add(
+ "TEST4=TEST4; Path=/; Expires=" + datestring.toString());
+
+ header.put("Set-Cookie", values);
+ cm.put(new URI("http://127.0.0.1/"), header);
+
+ CookieStore cookieJar = cm.getCookieStore();
+ List <HttpCookie> cookies = cookieJar.getCookies();
+ if (COOKIE_DATE_FORMATS[i].contains("yyyy")) {
+ if (cookies.size() != 2)
+ throw new RuntimeException(
+ "Incorrectly parsing a bad date");
+ } else if (cookies.size() != 1) {
+ throw new RuntimeException(
+ "Incorrectly parsing a bad date");
+ }
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/net/Inet6Address/StringScope.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8004675
+ * @summary Inet6Address.getHostAddress should use string scope
+ * identifier where available
+ */
+
+import java.net.*;
+import java.util.Enumeration;
+
+public class StringScope {
+
+ public static void main(String args[]) throws Exception {
+ Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
+ while (e.hasMoreElements()) {
+ NetworkInterface iface = e.nextElement();
+ Enumeration<InetAddress> iadrs = iface.getInetAddresses();
+ while (iadrs.hasMoreElements()) {
+ InetAddress iadr = iadrs.nextElement();
+ if (iadr instanceof Inet6Address) {
+ Inet6Address i6adr = (Inet6Address) iadr;
+ NetworkInterface nif = i6adr.getScopedInterface();
+ if (nif == null)
+ continue;
+
+ String nifName = nif.getName();
+ String i6adrHostAddress = i6adr.getHostAddress();
+ int index = i6adrHostAddress.indexOf('%');
+ String i6adrScopeName = i6adrHostAddress.substring(index+1);
+
+ if (!nifName.equals(i6adrScopeName))
+ throw new RuntimeException("Expected nifName ["
+ + nifName + "], to equal i6adrScopeName ["
+ + i6adrScopeName + "] ");
+ }
+ }
+ }
+ }
+}
+
--- a/jdk/test/java/net/InetAddress/ptr/lookup.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/InetAddress/ptr/lookup.sh Mon Dec 24 11:46:38 2012 -0800
@@ -53,13 +53,13 @@
# IPv4 reverse lookup
echo ''
-OUT1=`$JAVA -Djava.net.preferIPv4Stack=true Lookup -q=PTR $ADDR`
+OUT1=`$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true Lookup -q=PTR $ADDR`
echo "(IPv4) $ADDR --> $OUT1"
# reverse lookup (default)
echo ''
-OUT2=`$JAVA Lookup -q=PTR $ADDR`
+OUT2=`$JAVA ${TESTVMOPTS} Lookup -q=PTR $ADDR`
echo "(default) $ADDR --> $OUT2"
--- a/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/ServerSocket/AcceptCauseFileDescriptorLeak.sh Mon Dec 24 11:46:38 2012 -0800
@@ -45,4 +45,4 @@
ulimit -n 1024
fi
-${TESTJAVA}/bin/java AcceptCauseFileDescriptorLeak
+${TESTJAVA}/bin/java ${TESTVMOPTS} AcceptCauseFileDescriptorLeak
--- a/jdk/test/java/net/Socket/OldSocketImpl.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/Socket/OldSocketImpl.sh Mon Dec 24 11:46:38 2012 -0800
@@ -50,7 +50,7 @@
# with 1.3 and in OldStyleImpl.jar
# run
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTSRC}${FS}OldSocketImpl.jar OldSocketImpl
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTSRC}${FS}OldSocketImpl.jar OldSocketImpl
result=$?
if [ "$result" -ne "0" ]; then
exit 1
--- a/jdk/test/java/net/Socks/SocksV4Test.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/Socks/SocksV4Test.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,20 +26,26 @@
* @bug 4727547
* @summary SocksSocketImpl throws NullPointerException
* @build SocksServer
- * @run main SocksV4Test
*/
import java.net.*;
public class SocksV4Test {
+
+ // An unresolvable host
+ static final String HOSTNAME = "doesnot.exist.invalid";
+
public static void main(String[] args) throws Exception {
+ // sanity before running the test
+ assertUnresolvableHost(HOSTNAME);
+
// Create a SOCKS V4 proxy
SocksServer srvr = new SocksServer(0, true);
srvr.start();
Proxy sp = new Proxy(Proxy.Type.SOCKS,
new InetSocketAddress("localhost", srvr.getPort()));
// Let's create an unresolved address
- InetSocketAddress ad = new InetSocketAddress("doesnt.exist.name", 1234);
+ InetSocketAddress ad = new InetSocketAddress(HOSTNAME, 1234);
try (Socket s = new Socket(sp)) {
s.connect(ad, 10000);
} catch (UnknownHostException ex) {
@@ -51,4 +57,15 @@
srvr.terminate();
}
}
+
+ static void assertUnresolvableHost(String host) {
+ InetAddress addr = null;
+ try {
+ addr = InetAddress.getByName(host);
+ } catch (UnknownHostException x) {
+ // OK, expected
+ }
+ if (addr != null)
+ throw new RuntimeException("Test cannot run. resolvable address:" + addr);
+ }
}
--- a/jdk/test/java/net/URL/B5086147.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URL/B5086147.sh Mon Dec 24 11:46:38 2012 -0800
@@ -47,7 +47,7 @@
failures=0
echo ''
-${TESTJAVA}${FS}bin${FS}java B5086147
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5086147
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
if [ "$failures" != "0" ]; then
--- a/jdk/test/java/net/URL/runconstructor.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URL/runconstructor.sh Mon Dec 24 11:46:38 2012 -0800
@@ -50,7 +50,7 @@
go() {
echo ''
- ${TESTJAVA}${FS}bin${FS}java Constructor $1
+ ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Constructor $1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
--- a/jdk/test/java/net/URLClassLoader/B5077773.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URLClassLoader/B5077773.sh Mon Dec 24 11:46:38 2012 -0800
@@ -61,5 +61,5 @@
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5077773.java
WD=`pwd`
-${TESTJAVA}${FS}bin${FS}java B5077773
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5077773
--- a/jdk/test/java/net/URLClassLoader/getresourceasstream/test.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URLClassLoader/getresourceasstream/test.sh Mon Dec 24 11:46:38 2012 -0800
@@ -46,11 +46,11 @@
${TESTJAVA}/bin/javac -d . ${TESTSRC}/Test.java
cp ${TESTSRC}/test.jar .
-${TESTJAVA}/bin/java Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} Test
checkExit
# try with security manager
-${TESTJAVA}/bin/java -Djava.security.policy=file:./policy -Djava.security.manager Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.security.policy=file:./policy -Djava.security.manager Test
checkExit
exit 0
--- a/jdk/test/java/net/URLClassLoader/sealing/checksealed.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URLClassLoader/sealing/checksealed.sh Mon Dec 24 11:46:38 2012 -0800
@@ -56,7 +56,7 @@
CLASSPATH=".${PS}${TESTSRC}${FS}a${PS}${TESTSRC}${FS}b.jar"
${TESTJAVA}${FS}bin${FS}javac -classpath "${CLASSPATH}" -d . ${TESTSRC}${FS}CheckSealed.java
-${TESTJAVA}${FS}bin${FS}java -cp "${CLASSPATH}" CheckSealed 1
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp "${CLASSPATH}" CheckSealed 1
if [ $? != 0 ]; then exit 1; fi
-${TESTJAVA}${FS}bin${FS}java -cp "${CLASSPATH}" CheckSealed 2
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp "${CLASSPATH}" CheckSealed 2
if [ $? != 0 ]; then exit 1; fi
--- a/jdk/test/java/net/URLConnection/6212146/test.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URLConnection/6212146/test.sh Mon Dec 24 11:46:38 2012 -0800
@@ -67,7 +67,7 @@
WD=`pwd`
ulimit -H -n 300
-${TESTJAVA}${FS}bin${FS}java Test ${WD}/jars/ test.jar
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} Test ${WD}/jars/ test.jar
result=$?
rm -rf jars
exit $?
--- a/jdk/test/java/net/URLConnection/UNCTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/net/URLConnection/UNCTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -36,7 +36,7 @@
case "$OS" in
Windows_95 | Windows_98 | Windows_NT )
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\UNCTest.java
- ${TESTJAVA}/bin/java UNCTest ${UNC}
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} UNCTest ${UNC}
exit
;;
--- a/jdk/test/java/nio/Buffer/LimitDirectMemory.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/Buffer/LimitDirectMemory.sh Mon Dec 24 11:46:38 2012 -0800
@@ -34,7 +34,7 @@
runTest() {
echo "Testing: $*"
- ${TESTJAVA}/bin/java $*
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} $*
if [ $? -eq 0 ]
then echo "--- passed as expected"
else
@@ -43,10 +43,11 @@
fi
}
+
launchFail() {
echo "Testing: -XX:MaxDirectMemorySize=$* -cp ${TESTCLASSES} \
LimitDirectMemory true DEFAULT DEFAULT+1M"
- ${TESTJAVA}/bin/java -XX:MaxDirectMemorySize=$* -cp ${TESTCLASSES} \
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} -XX:MaxDirectMemorySize=$* -cp ${TESTCLASSES} \
LimitDirectMemory true DEFAULT DEFAULT+1M > ${TMP1} 2>&1
cat ${TMP1}
cat ${TMP1} | grep -s "Unrecognized VM option: \'MaxDirectMemorySize="
--- a/jdk/test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/channels/AsynchronousChannelGroup/run_any_task.sh Mon Dec 24 11:46:38 2012 -0800
@@ -46,7 +46,7 @@
-C "${TESTCLASSES}" Attack.class
echo "Running test ..."
-$JAVA -XX:-UseVMInterruptibleIO \
- -Xbootclasspath/a:"${TESTCLASSES}/Privileged.jar" \
- -classpath "${TESTCLASSES}" \
- AsExecutor
+$JAVA ${TESTVMOPTS} \
+ -Xbootclasspath/a:"${TESTCLASSES}/Privileged.jar" \
+ -classpath "${TESTCLASSES}" \
+ AsExecutor
--- a/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/channels/spi/AsynchronousChannelProvider/custom_provider.sh Mon Dec 24 11:46:38 2012 -0800
@@ -51,7 +51,7 @@
go() {
echo ''
- $JAVA $1 $2 $3 2>&1
+ $JAVA ${TESTVMOPTS} $1 $2 $3 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
--- a/jdk/test/java/nio/charset/Charset/default.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/charset/Charset/default.sh Mon Dec 24 11:46:38 2012 -0800
@@ -64,7 +64,7 @@
ecs="$1"; shift
echo -n "$L: "
- cs="`LC_ALL=$L $JAVA -cp $TESTCLASSES Default`"
+ cs="`LC_ALL=$L $JAVA ${TESTVMOPTS} -cp $TESTCLASSES Default`"
if [ $? != 0 ]; then
exit 1
elif [ "`tolower $cs`" != "`tolower $ecs`" ]; then
--- a/jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/charset/coders/CheckSJISMappingProp.sh Mon Dec 24 11:46:38 2012 -0800
@@ -51,7 +51,7 @@
}
-JAVA="${TESTJAVA}/bin/java -cp ${TESTCLASSES}"
+JAVA="${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES}"
runTest() {
echo "Testing:" ${1}
LC_ALL="$1" ; export LC_ALL
--- a/jdk/test/java/nio/charset/spi/basic.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/charset/spi/basic.sh Mon Dec 24 11:46:38 2012 -0800
@@ -116,7 +116,7 @@
av="$av -Djava.security.manager
-Djava.security.policy==$TESTSRC/charsetProvider.sp";;
esac
- if (set -x; $JAVA $av Test $css) 2>&1; then
+ if (set -x; $JAVA ${TESTVMOPTS} $av Test $css) 2>&1; then
continue;
else
failures=`expr $failures + 1`
--- a/jdk/test/java/nio/file/Files/delete_on_close.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/file/Files/delete_on_close.sh Mon Dec 24 11:46:38 2012 -0800
@@ -51,7 +51,7 @@
TMPFILE="$$.tmp"
touch $TMPFILE
-$JAVA DeleteOnClose $TMPFILE 2>&1
+$JAVA ${TESTVMOPTS} DeleteOnClose $TMPFILE 2>&1
if [ $? != 0 ]; then exit 1; fi
if [ -f $TMPFILE ]; then
echo "$TMPFILE was not deleted"
--- a/jdk/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh Mon Dec 24 11:46:38 2012 -0800
@@ -56,7 +56,7 @@
failures=0
# print the file tree and compare output with find(1)
-$JAVA PrintFileTree "$ROOT" > out1
+$JAVA ${TESTVMOPTS} PrintFileTree "$ROOT" > out1
find "$ROOT" > out2
diff out1 out2
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
@@ -66,26 +66,26 @@
# not. For that reason we run PrintFileTree with the -printCycles
# option when the output without this option differs to find(1).
find "$ROOT" -follow > out1
-$JAVA PrintFileTree -follow "$ROOT" > out2
+$JAVA ${TESTVMOPTS} PrintFileTree -follow "$ROOT" > out2
diff out1 out2
if [ $? != 0 ];
then
# re-run printing cycles to stdout
- $JAVA PrintFileTree -follow -printCycles "$ROOT" > out2
+ $JAVA ${TESTVMOPTS} PrintFileTree -follow -printCycles "$ROOT" > out2
diff out1 out2
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
fi
# test SKIP_SIBLINGS
-$JAVA SkipSiblings "$ROOT"
+$JAVA ${TESTVMOPTS} SkipSiblings "$ROOT"
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# test TERMINATE
-$JAVA TerminateWalk "$ROOT"
+$JAVA ${TESTVMOPTS} TerminateWalk "$ROOT"
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# test maxDepth
-$JAVA MaxDepth "$ROOT"
+$JAVA ${TESTVMOPTS} MaxDepth "$ROOT"
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# clean-up
--- a/jdk/test/java/nio/file/Path/MacPathTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/nio/file/Path/MacPathTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -36,4 +36,4 @@
TESTCLASSES=.
fi
-export LC_ALL=en_US.UTF-8; ${TESTJAVA}/bin/java -cp ${TESTCLASSES} MacPathTest
+export LC_ALL=en_US.UTF-8; ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} MacPathTest
--- a/jdk/test/java/rmi/MarshalledObject/compare/Compare.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/MarshalledObject/compare/Compare.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,7 +29,6 @@
* not involved in location should be compared.
* @author Ken Arnold
*
- * @build Compare
* @run main Compare 11 annotatedRef
*/
--- a/jdk/test/java/rmi/MarshalledObject/compare/HashCode.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/MarshalledObject/compare/HashCode.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,6 @@
* @summary MarshalledObject with null throws NullPointerException
* @author Ken Arnold
*
- * @build HashCode
* @run main HashCode 11 annotatedRef
*/
--- a/jdk/test/java/rmi/MarshalledObject/compare/NullReference.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/MarshalledObject/compare/NullReference.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,6 @@
* @summary MarshalledObject with null throws NullPointerException
* @author Ken Arnold
*
- * @build NullReference
* @run main NullReference
*/
--- a/jdk/test/java/rmi/Naming/DefaultRegistryPort.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/Naming/DefaultRegistryPort.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,7 +28,6 @@
* @author Dana Burns
* @library ../testlibrary
* @build TestLibrary
- * @build DefaultRegistryPort
* @run main DefaultRegistryPort
*/
--- a/jdk/test/java/rmi/Naming/LookupIPv6.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/Naming/LookupIPv6.java Mon Dec 24 11:46:38 2012 -0800
@@ -22,12 +22,11 @@
*/
/* @test
+ * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
+ * IPv6 addresses.
* @bug 4402708
*
* @run main/othervm -Djava.net.preferIPv6Addresses=true LookupIPv6
- *
- * @summary Ensure that java.rmi.Naming.lookup can handle URLs containing
- * IPv6 addresses.
*/
import java.net.InetAddress;
--- a/jdk/test/java/rmi/Naming/RmiIsNoScheme.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/Naming/RmiIsNoScheme.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,6 @@
*
* @library ../testlibrary
* @build TestLibrary
- * @build RmiIsNoScheme
* @run main/othervm RmiIsNoScheme
*/
--- a/jdk/test/java/rmi/Naming/UnderscoreHost.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/Naming/UnderscoreHost.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,8 +29,7 @@
* @author Vinod Johnson
*
* @library ../testlibrary
- * @build TestLibrary
- * @build UnderscoreHost UnderscoreHost_Stub
+ * @build TestLibrary UnderscoreHost_Stub
* @run main/othervm UnderscoreHost
*/
--- a/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java Mon Dec 24 11:46:38 2012 -0800
@@ -21,14 +21,13 @@
* questions.
*/
-/**
+/*
* @test
* @bug 4254808
* @summary Naming assumes '/' is present in relative URL; change in URL causes regression
* @author Dana Burns
* @library ../../testlibrary
- * @build TestLibrary
- * @build Legal LegalRegistryNames LegalRegistryNames_Stub
+ * @build TestLibrary Legal LegalRegistryNames_Stub
* @run main LegalRegistryNames
*/
--- a/jdk/test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/RMISecurityManager/checkPackageAccess/CheckPackageAccess.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,10 +28,9 @@
* as when the default java.lang.SecurityManager is set, which with the
* default "java.security" file in the JDK means that access to packages in
* the sun.* package hierarchy is denied (without explicit runtime permission
- * "accessClassInPackge.*").
+ * "accessClassInPackage.*").
* @author Peter Jones
*
- * @build CheckPackageAccess
* @run main/othervm CheckPackageAccess
*/
--- a/jdk/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/checkActivateRef/CheckActivateRef.java Mon Dec 24 11:46:38 2012 -0800
@@ -36,8 +36,7 @@
* functionality is in place
*
* @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build ActivateMe CheckActivateRef_Stub CheckActivateRef
+ * @build TestLibrary RMID ActivateMe CheckActivateRef_Stub
* @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=true CheckActivateRef
* @run main/othervm/policy=security.policy/timeout=240 -Djava.rmi.server.ignoreStubClasses=false CheckActivateRef
*/
--- a/jdk/test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/checkAnnotations/CheckAnnotations.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,10 +28,7 @@
* @author Laird Dornin; code borrowed from Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build MyRMI
- * @build CheckAnnotations
- * @build CheckAnnotations_Stub
+ * @build TestLibrary RMID MyRMI CheckAnnotations_Stub
* @run main/othervm/policy=security.policy/timeout=480 CheckAnnotations
*/
--- a/jdk/test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/checkImplClassLoader/CheckImplClassLoader.java Mon Dec 24 11:46:38 2012 -0800
@@ -24,14 +24,11 @@
/* @test
* @bug 4289544
* @summary ActivationGroupImpl.newInstance does not set context classloader for impl
- *
* @author Laird Dornin; code borrowed from Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build MyRMI
- * @build CheckImplClassLoader ActivatableImpl
- * @build ActivatableImpl ActivatableImpl_Stub
+ * @build TestLibrary RMID
+ * MyRMI ActivatableImpl ActivatableImpl ActivatableImpl_Stub
* @run main/othervm/policy=security.policy/timeout=150 CheckImplClassLoader
*/
--- a/jdk/test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/checkRegisterInLog/CheckRegisterInLog.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,8 +27,8 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build RMID ActivationLibrary TestLibrary
- * @build ActivateMe CheckRegisterInLog CheckRegisterInLog_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ * ActivateMe CheckRegisterInLog_Stub
* @run main/othervm/policy=security.policy/timeout=240 CheckRegisterInLog
*/
--- a/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/createPrivateActivable/CreatePrivateActivatable.java Mon Dec 24 11:46:38 2012 -0800
@@ -22,14 +22,12 @@
*/
/* @test
- * @author Laird Dornin
* @bug 4164971
* @summary allow non-public activatable class and/or constructor
+ * @author Laird Dornin
*
* @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build ActivateMe
- * @build CreatePrivateActivatable
+ * @build TestLibrary RMID ActivateMe
* @run main/othervm/policy=security.policy/timeout=240 CreatePrivateActivatable
*/
--- a/jdk/test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/downloadParameterClass/DownloadParameterClass.java Mon Dec 24 11:46:38 2012 -0800
@@ -32,11 +32,7 @@
*
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
- * @build DownloadParameterClass
- * @build Foo
- * @build FooReceiverImpl
- * @build FooReceiverImpl_Stub
- * @build Bar
+ * Foo FooReceiverImpl FooReceiverImpl_Stub Bar
* @run main/othervm/policy=security.policy/timeout=240 DownloadParameterClass
*/
--- a/jdk/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/elucidateNoSuchMethod/ElucidateNoSuchMethod.java Mon Dec 24 11:46:38 2012 -0800
@@ -23,14 +23,11 @@
/* @test
* @bug 4128620
- *
* @summary synopsis: NoSuchMethodError should be elucidated
- *
* @author Laird Dornin
*
* @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build ActivateMe ElucidateNoSuchMethod ElucidateNoSuchMethod_Stub
+ * @build TestLibrary RMID ActivateMe ElucidateNoSuchMethod_Stub
* @run main/othervm/policy=security.policy/timeout=240 ElucidateNoSuchMethod
*/
--- a/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/extLoadedImpl/ext.sh Mon Dec 24 11:46:38 2012 -0800
@@ -51,5 +51,5 @@
mkdir -p ext
$TESTJAVA/bin/jar cf ext/ext.jar -C $TESTCLASSES ExtLoadedImpl.class -C $TESTCLASSES ExtLoadedImpl_Stub.class -C $TESTCLASSES CheckLoader.class
-$TESTJAVA/bin/java -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest
+$TESTJAVA/bin/java ${TESTVMOPTS} -cp classes -Dtest.src=$TESTSRC -Dtest.classes=$TESTCLASSES -Djava.security.policy=$TESTSRC/security.policy -Djava.ext.dirs=ext ExtLoadedImplTest
--- a/jdk/test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/forceLogSnapshot/ForceLogSnapshot.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,9 +27,8 @@
* @author Laird Dornin
*
* @library ../../../testlibrary
- * @build ActivateMe
- * @build ForceLogSnapshot
- * @build ForceLogSnapshot_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ * ActivateMe ForceLogSnapshot_Stub
* @run main/othervm/policy=security.policy/timeout=640 ForceLogSnapshot
*/
--- a/jdk/test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/inactiveGroup/InactiveGroup.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,10 +29,7 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build InactiveGroup
- * @build InactiveGroup_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe InactiveGroup_Stub
* @run main/othervm/policy=security.policy/timeout=240 InactiveGroup
*/
--- a/jdk/test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/lookupActivationSystem/LookupActivationSystem.java Mon Dec 24 11:46:38 2012 -0800
@@ -24,14 +24,12 @@
/*
* @test
* @bug 6245733
- *
* @summary synopsis: rmid's registry's list operation doesn't include
* activation system
* @author Ann Wollrath
*
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
- * @build LookupActivationSystem
* @run main/othervm/timeout=240 LookupActivationSystem
*/
--- a/jdk/test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/nestedActivate/NestedActivate.java Mon Dec 24 11:46:38 2012 -0800
@@ -23,15 +23,11 @@
/* @test
* @bug 4138056
- *
* @summary synopsis: Activating objects from an Activatable constructor causes deadlock
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build NestedActivate
- * @build NestedActivate_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe NestedActivate_Stub
* @run main/othervm/policy=security.policy/timeout=240 NestedActivate
*/
--- a/jdk/test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/nonExistentActivatable/NonExistentActivatable.java Mon Dec 24 11:46:38 2012 -0800
@@ -23,16 +23,13 @@
/* @test
* @bug 4115296
- *
* @summary synopsis: NoSuchObjectException not thrown for non-existent
* activatable objects
* @author Ann Wollrath
*
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build NonExistentActivatable
- * @build NonExistentActivatable_Stub
+ * ActivateMe NonExistentActivatable_Stub
* @run main/othervm/policy=security.policy/timeout=240 NonExistentActivatable
*/
--- a/jdk/test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/restartCrashedService/RestartCrashedService.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,10 +28,7 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build ActivateMe
- * @build RestartCrashedService
- * @build RestartCrashedService_Stub
+ * @build TestLibrary RMID ActivateMe RestartCrashedService_Stub
* @run main/othervm/policy=security.policy/timeout=240 RestartCrashedService
*/
--- a/jdk/test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/restartLatecomer/RestartLatecomer.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,8 +28,7 @@
*
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
- * @build RestartLatecomer
- * @build RestartLatecomer_Stub
+ * RestartLatecomer RestartLatecomer_Stub
* @run main/othervm/policy=security.policy/timeout=240 RestartLatecomer
*/
--- a/jdk/test/java/rmi/activation/Activatable/restartService/RestartService.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/restartService/RestartService.java Mon Dec 24 11:46:38 2012 -0800
@@ -23,15 +23,11 @@
/* @test
* @bug 4095165 4321151
-
* @summary synopsis: activator should restart daemon services
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build RestartService
- * @build RestartService_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe RestartService_Stub
* @run main/othervm/policy=security.policy/timeout=240 RestartService
*/
--- a/jdk/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/shutdownGracefully/ShutdownGracefully.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,11 +28,8 @@
* @author Laird Dornin; code borrowed from Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build TestSecurityManager
- * @build RegisteringActivatable
- * @build ShutdownGracefully
- * @build ShutdownGracefully_Stub
+ * @build TestLibrary RMID
+ * TestSecurityManager RegisteringActivatable ShutdownGracefully_Stub
* @run main/othervm/policy=security.policy/timeout=700 ShutdownGracefully
*/
--- a/jdk/test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/Activatable/unregisterInactive/UnregisterInactive.java Mon Dec 24 11:46:38 2012 -0800
@@ -23,16 +23,12 @@
/* @test
* @bug 4115331
-
* @summary synopsis: activatable object fails to go inactive after
* unregister/inactive sequence.
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID ActivationLibrary
- * @build ActivateMe
- * @build UnregisterInactive
- * @build UnregisterInactive_Stub
+ * @build TestLibrary RMID ActivationLibrary ActivateMe UnregisterInactive_Stub
* @run main/othervm/policy=security.policy/timeout=240 UnregisterInactive
*/
--- a/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivateFailedException/activateFails/ActivateFails.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,11 +31,8 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build ActivateMe
- * @build ActivateFails
- * @build ActivateFails_Stub
- * @build ShutdownThread
+ * @build TestLibrary RMID ActivationLibrary
+ * ActivateMe ActivateFails_Stub ShutdownThread
* @run main/othervm/policy=security.policy/timeout=240 ActivateFails
*/
--- a/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivationGroup/downloadActivationGroup/DownloadActivationGroup.java Mon Dec 24 11:46:38 2012 -0800
@@ -33,9 +33,7 @@
*
* @library ../../../testlibrary
* @build TestLibrary RMID ActivationLibrary
- * @build MyActivationGroupImpl
- * @build DownloadActivationGroup
- * @build DownloadActivationGroup_Stub
+ * DownloadActivationGroup MyActivationGroupImpl DownloadActivationGroup_Stub
* @run main/othervm/policy=security.policy/timeout=240 DownloadActivationGroup
*/
--- a/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivationGroupDesc/checkDefaultGroupName/CheckDefaultGroupName.java Mon Dec 24 11:46:38 2012 -0800
@@ -21,16 +21,15 @@
* questions.
*/
-/**
+/*
* @test
* @bug 4252236
* @summary ActivationGroupDesc should not do early binding of default classname
- * @library ../../../testlibrary
+ * @author Laird Dornin
*
- * @build CheckDefaultGroupName
- *
+ * @library ../../../testlibrary
+ * @build TestLibrary
* @run main CheckDefaultGroupName
- * @author Laird Dornin
*/
import java.rmi.activation.*;
--- a/jdk/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivationSystem/activeGroup/IdempotentActiveGroup.java Mon Dec 24 11:46:38 2012 -0800
@@ -23,15 +23,13 @@
/* @test
* @bug 4720528
- *
* @summary synopsis: (spec) ActivationSystem.activeGroup spec should be
* relaxed (duplicate call to activeGroup with same instantiator and
* incarnation should not throw ActivationException; it should succeed)
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID
- * @build IdempotentActiveGroup
+ * @build TestLibrary RMID ActivationLibrary
* @run main/othervm/policy=security.policy/timeout=480 IdempotentActiveGroup
*/
--- a/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivationSystem/modifyDescriptor/ModifyDescriptor.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,9 +29,8 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build ActivateMe
- * @build ModifyDescriptor
- * @build ModifyDescriptor_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ * ActivateMe ModifyDescriptor_Stub
* @run main/othervm/policy=security.policy/timeout=240 ModifyDescriptor
*/
--- a/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivationSystem/stubClassesPermitted/StubClassesPermitted.java Mon Dec 24 11:46:38 2012 -0800
@@ -24,14 +24,11 @@
/* @test
* @bug 4179055
* @summary Some java apps need to have access to read "accessClassInPackage.sun.rmi.server"
- *
* @author Laird Dornin
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe ActivationLibrary
- * @build CanCreateStubs
- * @build StubClassesPermitted
- * @build StubClassesPermitted_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ * CanCreateStubs StubClassesPermitted_Stub
* @run main/othervm/policy=security.policy/secure=java.lang.SecurityManager/timeout=240 StubClassesPermitted
*/
--- a/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java Mon Dec 24 11:46:38 2012 -0800
@@ -24,16 +24,12 @@
/* @test
* @bug 4134233
* @bug 4213186
- *
* @summary synopsis: ActivationSystem.unregisterGroup should unregister objects in group
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build ActivateMe CallbackInterface
- * @build UnregisterGroup
- * @build UnregisterGroup_Stub
- * @build Callback_Stub
+ * @build TestLibrary RMID ActivationLibrary
+ * ActivateMe CallbackInterface UnregisterGroup_Stub Callback_Stub
* @run main/othervm/policy=security.policy/timeout=480 UnregisterGroup
*/
--- a/jdk/test/java/rmi/activation/CommandEnvironment/NullOptions.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/CommandEnvironment/NullOptions.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,6 @@
* ActivationGroupDesc.CommandEnvironment
* @author Ann Wollrath
*
- * @build NullOptions
* @run main/othervm/timeout=240 NullOptions
*/
--- a/jdk/test/java/rmi/activation/CommandEnvironment/SetChildEnv.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/CommandEnvironment/SetChildEnv.java Mon Dec 24 11:46:38 2012 -0800
@@ -35,9 +35,10 @@
* @author Adrian Colley
*
* @library ../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build Eliza Retireable Doctor Doctor_Stub SetChildEnv
- * @run main/othervm/timeout=240/policy=security.policy -Djava.compiler=NONE SetChildEnv
+ * @build TestLibrary RMID ActivationLibrary
+ * Eliza Retireable Doctor Doctor_Stub
+ * @run main/othervm/timeout=240/policy=security.policy
+ * -Djava.compiler=NONE SetChildEnv
*/
import java.rmi.*;
import java.util.Properties;
--- a/jdk/test/java/rmi/activation/checkusage/CheckUsage.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/checkusage/CheckUsage.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,7 +25,7 @@
* @bug 4259564
*
* @library ../../testlibrary
- * @build TestLibrary JavaVM CheckUsage
+ * @build TestLibrary JavaVM
* @run main/othervm CheckUsage
*/
--- a/jdk/test/java/rmi/activation/log/LogTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/log/LogTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,7 +29,6 @@
* boundaries
* @author Ann Wollrath
*
- * @build LogTest
* @run main/othervm/timeout=240 LogTest
*/
--- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/InheritedChannelNotServerSocket.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,8 +29,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build RMID ActivationLibrary
- * @build InheritedChannelNotServerSocket
+ * @build TestLibrary RMID ActivationLibrary
* @run main/othervm/timeout=240 InheritedChannelNotServerSocket
*/
--- a/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/activation/rmidViaInheritedChannel/RmidViaInheritedChannel.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,9 +27,7 @@
* @author Ann Wollrath
*
* @library ../../testlibrary
- * @build RMID ActivationLibrary
- * @build RmidViaInheritedChannel
- * @build TestLibrary
+ * @build TestLibrary RMID ActivationLibrary
* @run main/othervm/timeout=240 RmidViaInheritedChannel
*/
--- a/jdk/test/java/rmi/dgc/VMID/CheckVMID.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/dgc/VMID/CheckVMID.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,7 @@
* @author Ann Wollrath
*
* @library ../../testlibrary
- * @build CheckVMID
+ * @build TestLibrary
* @run main/othervm/policy=security.policy CheckVMID
*/
--- a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,8 +30,7 @@
* rather than pinning it indefinitely.
* @author Peter Jones
*
- * @build DGCAckFailure
- * @build DGCAckFailure_Stub
+ * @build DGCAckFailure DGCAckFailure_Stub
* @run main/othervm DGCAckFailure
*/
--- a/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/dgc/dgcImplInsulation/DGCImplInsulation.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,9 +31,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build TestLibrary
- * @build DGCImplInsulation
- * @build DGCImplInsulation_Stub
+ * @build TestLibrary DGCImplInsulation_Stub
* @run main/othervm/policy=security.policy DGCImplInsulation
*/
--- a/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/dgc/retryDirtyCalls/RetryDirtyCalls.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,8 +29,7 @@
* renewing that lease at all after the first failure.
* @author Peter Jones (inspired by Adrian Colley's test case in 4268258)
*
- * @build RetryDirtyCalls
- * @build RetryDirtyCalls_Stub
+ * @build RetryDirtyCalls RetryDirtyCalls_Stub
* @run main/othervm RetryDirtyCalls
*/
--- a/jdk/test/java/rmi/invalidName/InvalidName.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/invalidName/InvalidName.java Mon Dec 24 11:46:38 2012 -0800
@@ -32,7 +32,7 @@
* @author Laird Dornin
*
* @library ../testlibrary
- * @build InvalidName
+ * @build TestLibrary
* @run main/othervm InvalidName
*/
--- a/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/altSecurityManager/AltSecurityManager.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,8 +27,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build StreamPipe TestParams TestLibrary JavaVM RMID
- * @build AltSecurityManager TestSecurityManager
+ * @build TestLibrary JavaVM RMID TestSecurityManager
* @run main/othervm AltSecurityManager
*/
--- a/jdk/test/java/rmi/registry/checkusage/CheckUsage.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/checkusage/CheckUsage.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build TestLibrary JavaVM CheckUsage
+ * @build TestLibrary JavaVM
* @run main/othervm CheckUsage
*/
--- a/jdk/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/classPathCodebase/ClassPathCodebase.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build ClassPathCodebase Dummy TestLibrary
+ * @build TestLibrary Dummy
* @run main/othervm/policy=security.policy ClassPathCodebase
*/
--- a/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/interfaceHash/InterfaceHash.java Mon Dec 24 11:46:38 2012 -0800
@@ -36,9 +36,7 @@
*
* @author Peter Jones
* @library ../../testlibrary
- * @build InterfaceHash
- * @build ReferenceRegistryStub
- * @build TestLibrary
+ * @build TestLibrary ReferenceRegistryStub
* @run main/othervm InterfaceHash
*/
--- a/jdk/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/multipleRegistries/MultipleRegistries.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,7 +28,6 @@
*
* @library ../../testlibrary
* @build TestLibrary
- * @build MultipleRegistries
* @run main/othervm/timeout=240 MultipleRegistries
*/
--- a/jdk/test/java/rmi/registry/readTest/readTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/readTest/readTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -76,7 +76,7 @@
;;
esac
# trailing / after code base is important for rmi codebase property.
-${TESTJAVA}${FS}bin${FS}java -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 &
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp $TEST_CLASSPATH -Djava.rmi.server.codebase=${FILEURL}$CODEBASE/ readTest > OUT.TXT 2>&1 &
TEST_PID=$!
#bulk of testcase - let it run for a while
sleep 5
--- a/jdk/test/java/rmi/registry/reexport/Reexport.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/registry/reexport/Reexport.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,9 +25,7 @@
* @bug 4120329
* @summary RMI registry creation is impossible if first attempt fails.
* @library ../../testlibrary
- * @build StreamPipe TestParams TestLibrary JavaVM
- * @build RegistryRunner RegistryRunner_Stub
- * @build Reexport
+ * @build TestLibrary JavaVM RegistryRunner RegistryRunner_Stub
* @run main/othervm Reexport
*/
--- a/jdk/test/java/rmi/reliability/benchmark/runRmiBench.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/reliability/benchmark/runRmiBench.sh Mon Dec 24 11:46:38 2012 -0800
@@ -27,20 +27,20 @@
# used to run the test under JTREG.
#
# @build bench.BenchInfo bench.HtmlReporter bench.Util bench.Benchmark
-# @build bench.Reporter bench.XmlReporter bench.ConfigFormatException
-# @build bench.Harness bench.TextReporter bench.rmi.BenchServer
-# @build bench.rmi.DoubleArrayCalls bench.rmi.LongCalls bench.rmi.ShortCalls
-# @build bench.rmi.BenchServerImpl bench.rmi.DoubleCalls
-# @build bench.rmi.Main bench.rmi.SmallObjTreeCalls
-# @build bench.rmi.BooleanArrayCalls bench.rmi.ExceptionCalls
-# @build bench.rmi.NullCalls bench.rmi.BooleanCalls bench.rmi.ExportObjs
-# @build bench.rmi.ObjArrayCalls bench.rmi.ByteArrayCalls
-# @build bench.rmi.FloatArrayCalls bench.rmi.ObjTreeCalls
-# @build bench.rmi.ByteCalls bench.rmi.FloatCalls bench.rmi.ProxyArrayCalls
-# @build bench.rmi.CharArrayCalls bench.rmi.IntArrayCalls
-# @build bench.rmi.RemoteObjArrayCalls bench.rmi.CharCalls bench.rmi.IntCalls
-# @build bench.rmi.ClassLoading bench.rmi.LongArrayCalls
-# @build bench.rmi.ShortArrayCalls bench.rmi.altroot.Node
+# bench.Reporter bench.XmlReporter bench.ConfigFormatException
+# bench.Harness bench.TextReporter bench.rmi.BenchServer
+# bench.rmi.DoubleArrayCalls bench.rmi.LongCalls bench.rmi.ShortCalls
+# bench.rmi.BenchServerImpl bench.rmi.DoubleCalls
+# bench.rmi.Main bench.rmi.SmallObjTreeCalls
+# bench.rmi.BooleanArrayCalls bench.rmi.ExceptionCalls
+# bench.rmi.NullCalls bench.rmi.BooleanCalls bench.rmi.ExportObjs
+# bench.rmi.ObjArrayCalls bench.rmi.ByteArrayCalls
+# bench.rmi.FloatArrayCalls bench.rmi.ObjTreeCalls
+# bench.rmi.ByteCalls bench.rmi.FloatCalls bench.rmi.ProxyArrayCalls
+# bench.rmi.CharArrayCalls bench.rmi.IntArrayCalls
+# bench.rmi.RemoteObjArrayCalls bench.rmi.CharCalls bench.rmi.IntCalls
+# bench.rmi.ClassLoading bench.rmi.LongArrayCalls
+# bench.rmi.ShortArrayCalls bench.rmi.altroot.Node
#
# @run shell/timeout=1800 runRmiBench.sh
#
--- a/jdk/test/java/rmi/reliability/benchmark/runSerialBench.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/reliability/benchmark/runSerialBench.sh Mon Dec 24 11:46:38 2012 -0800
@@ -51,7 +51,7 @@
echo "Starting serialization benchmark "
$TESTJAVA/bin/java \
- -server \
+ ${TESTVMOPTS} \
-cp $TESTCLASSES \
bench.serial.Main \
-c $TESTSRC/bench/serial/jtreg-config &
--- a/jdk/test/java/rmi/reliability/juicer/AppleUserImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/reliability/juicer/AppleUserImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -55,11 +55,10 @@
* has been reached.
*
* @library ../../testlibrary
- *
- * @build Apple AppleEvent AppleImpl AppleUserImpl
- * @build Orange OrangeEcho OrangeEchoImpl OrangeImpl
- * @build ApplicationServer
* @build TestLibrary
+ * Apple AppleEvent AppleImpl
+ * Orange OrangeEcho OrangeEchoImpl OrangeImpl
+ * ApplicationServer
*
* @run main/othervm/policy=security.policy AppleUserImpl -seconds 30
*
--- a/jdk/test/java/rmi/server/ObjID/randomIDs/RandomIDs.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/ObjID/randomIDs/RandomIDs.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,6 @@
* ObjID() should still generate sequential object numbers.
* @author Peter Jones
*
- * @build RandomIDs
* @run main/othervm RandomIDs random
* @run main/othervm -Djava.rmi.server.randomIDs=true RandomIDs random
* @run main/othervm -Djava.rmi.server.randomIDs=false RandomIDs sequential
--- a/jdk/test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/delegateBeforePermissionCheck/DelegateBeforePermissionCheck.java Mon Dec 24 11:46:38 2012 -0800
@@ -33,9 +33,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build DelegateBeforePermissionCheck
- * @build Foo
+ * @build TestLibrary Foo
* @run main/othervm DelegateBeforePermissionCheck
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/delegateToContextLoader/DelegateToContextLoader.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,7 +29,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build DelegateToContextLoader Dummy
+ * @build TestLibrary Dummy
* @run main/othervm/policy=security.policy/timeout=120 DelegateToContextLoader
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/downloadArrayClass/DownloadArrayClass.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,11 +31,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build Receiver
- * @build DownloadArrayClass
- * @build DownloadArrayClass_Stub
- * @build Foo
+ * @build TestLibrary Receiver DownloadArrayClass_Stub Foo
* @run main/othervm/policy=security.policy DownloadArrayClass
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/getClassAnnotation/NullClass.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,7 +29,6 @@
*
* @library ../../../testlibrary
* @build TestLibrary
- * @build NullClass
* @run main/othervm NullClass
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/getClassLoader/GetClassLoader.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,9 +29,7 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build GetClassLoader
- * @build Foo
+ * @build TestLibrary Foo
* @run main/othervm/policy=security.policy GetClassLoader
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/loadProxyClasses/LoadProxyClasses.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,8 +30,8 @@
* @author Laird Dornin
*
* @library ../../../testlibrary
- * @build TestLibrary FnnClass FnnUnmarshal LoadProxyClasses NonpublicInterface
- * @build NonpublicInterface1 PublicInterface PublicInterface1
+ * @build TestLibrary FnnClass FnnUnmarshal NonpublicInterface
+ * NonpublicInterface1 PublicInterface PublicInterface1
* @run main/othervm/policy=security.policy LoadProxyClasses
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/noSecurityManager/NoSecurityManager.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,7 @@
* been used for the RMI class loader instance.
* @author Peter Jones
*
- * @build NoSecurityManager Dummy LocalDummy
+ * @build Dummy LocalDummy
* @run main/othervm/timeout=120 NoSecurityManager
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/spi/ContextInsulation.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,11 +30,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build ContextInsulation
- * @build ServiceConfiguration
- * @build TestProvider
- * @build TestProvider2
+ * @build TestLibrary ServiceConfiguration TestProvider TestProvider2
* @run main/othervm/policy=security.policy ContextInsulation
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/spi/DefaultProperty.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,10 +29,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build DefaultProperty
- * @build ServiceConfiguration
- * @build Foo
+ * @build TestLibrary ServiceConfiguration Foo
* @run main/othervm/policy=security.policy DefaultProperty
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/spi/Installed.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/spi/Installed.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,11 +29,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build Installed
- * @build ServiceConfiguration
- * @build TestProvider
- * @build TestProvider2
+ * @build TestLibrary ServiceConfiguration TestProvider TestProvider2
* @run main/othervm/policy=security.policy Installed
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/spi/InvalidProperty.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,9 +29,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build InvalidProperty
- * @build ServiceConfiguration
+ * @build TestLibrary ServiceConfiguration
* @run main/othervm/policy=security.policy InvalidProperty
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/spi/Property.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/spi/Property.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,10 +29,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build Property
- * @build ServiceConfiguration
- * @build TestProvider
+ * @build TestLibrary ServiceConfiguration TestProvider
* @run main/othervm/policy=security.policy Property
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/useCodebaseOnly/UseCodebaseOnly.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,12 +31,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build Receiver
- * @build UseCodebaseOnly
- * @build UseCodebaseOnly_Stub
- * @build Foo
- * @build Bar
+ * @build TestLibrary Receiver UseCodebaseOnly_Stub Foo Bar
* @run main/othervm/policy=security.policy UseCodebaseOnly
*/
--- a/jdk/test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMIClassLoader/useGetURLs/UseGetURLs.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,8 +30,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build UseGetURLs Dummy
+ * @build TestLibrary Dummy
* @run main/othervm/policy=security.policy/timeout=120 UseGetURLs
*/
--- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/UseCustomSocketFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,11 +28,7 @@
* @author Ann Wollrath
*
* @library ../../../../testlibrary
- * @build Echo
- * @build EchoImpl
- * @build EchoImpl_Stub
- * @build UseCustomSocketFactory
- * @build TestLibrary
+ * @build TestLibrary Echo EchoImpl EchoImpl_Stub
* @run main/othervm/policy=security.policy/timeout=360 UseCustomSocketFactory
*/
--- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/registry/UseCustomSocketFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,12 +29,7 @@
* @author Laird Dornin; code borrowed from Ann Wollrath
*
* @library ../../../../testlibrary
- * @build Hello
- * @build HelloImpl
- * @build HelloImpl_Stub
- * @build TestLibrary
- * @build UseCustomSocketFactory
- * @build Compress
+ * @build TestLibrary Compress Hello HelloImpl HelloImpl_Stub
* @run main/othervm/policy=security.policy/timeout=240 UseCustomSocketFactory
*/
--- a/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RMISocketFactory/useSocketFactory/unicast/UseCustomSocketFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,11 +29,7 @@
* @author Ann Wollrath
*
* @library ../../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build Echo
- * @build EchoImpl
- * @build EchoImpl_Stub
- * @build UseCustomSocketFactory
+ * @build TestLibrary RMID JavaVM Echo EchoImpl EchoImpl_Stub
* @run main/othervm/policy=security.policy/timeout=120 UseCustomSocketFactory
*/
--- a/jdk/test/java/rmi/server/RemoteObject/notExtending/NotExtending.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RemoteObject/notExtending/NotExtending.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,9 +29,7 @@
* (specifically: stubs) that contain the instance's RemoteRef.
* @author Peter Jones
*
- * @build NotExtending
- * @build NotExtending_Stub
- * @build NotExtending_Skel
+ * @build NotExtending_Stub NotExtending_Skel
* @run main/othervm/timeout=240 NotExtending
*/
--- a/jdk/test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RemoteObject/verifyRemoteEquals/VerifyRemoteEquals.java Mon Dec 24 11:46:38 2012 -0800
@@ -21,16 +21,16 @@
* questions.
*/
-/**
+/*
* @test
* @bug 4251010
* @summary equals does not works on stub objects created with
* custom socket AndFactory
- * @library ../../../testlibrary
+ * @author Laird Dornin
*
- * @build VerifyRemoteEquals
+ * @library ../../../testlibrary
+ * @build TestLibrary
* @run main/othervm/timeout=40 VerifyRemoteEquals
- * @author Laird Dornin
*/
import java.io.*;
--- a/jdk/test/java/rmi/server/RemoteServer/AddrInUse.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/RemoteServer/AddrInUse.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,8 +26,6 @@
* @summary retryServerSocket should not retry on BindException
* @author Ann Wollrath
*
- * @library ../../testlibrary
- * @build AddrInUse
* @run main/othervm AddrInUse
*/
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/changeHostName/ChangeHostName.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,8 +31,7 @@
*
* @author Ann Wollrath
*
- * @build ChangeHostName
- * @build ChangeHostName_Stub
+ * @build ChangeHostName ChangeHostName_Stub
* @run main/othervm ChangeHostName
*/
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/exportObject/GcDuringExport.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,6 +30,7 @@
* @bug 6597112
* @summary GC'ing objects whilst being exported to RMI should not cause exceptions
* @author Neil Richards <neil.richards@ngmr.net>, <neil_richards@uk.ibm.com>
+ * @run main GcDuringExport
*/
import java.rmi.Remote;
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/keepAliveDuringCall/KeepAliveDuringCall.java Mon Dec 24 11:46:38 2012 -0800
@@ -32,14 +32,8 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build JavaVM
- * @build KeepAliveDuringCall
- * @build KeepAliveDuringCall_Stub
- * @build ShutdownMonitor
- * @build Shutdown
- * @build ShutdownImpl
- * @build ShutdownImpl_Stub
+ * @build TestLibrary JavaVM KeepAliveDuringCall_Stub
+ * ShutdownMonitor Shutdown ShutdownImpl ShutdownImpl_Stub
* @run main/othervm KeepAliveDuringCall
*/
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,8 +31,7 @@
* IOException (see fix for bugid 4017232).
* @author Peter Jones
*
- * @build MarshalAfterUnexport
- * @build MarshalAfterUnexport_Stub
+ * @build MarshalAfterUnexport MarshalAfterUnexport_Stub
* @run main/othervm MarshalAfterUnexport
*/
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/marshalAfterUnexport/MarshalAfterUnexport2.java Mon Dec 24 11:46:38 2012 -0800
@@ -33,8 +33,7 @@
* @author Peter Jones
* @author Ann Wollrath
*
- * @build MarshalAfterUnexport2
- * @build MarshalAfterUnexport2_Stub
+ * @build MarshalAfterUnexport2 MarshalAfterUnexport2_Stub
* @run main/othervm MarshalAfterUnexport2
*/
--- a/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/UnicastRemoteObject/unexportObject/UnexportLeak.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,10 +29,7 @@
* @author Ann Wollrath
*
* @library ../../../testlibrary
- * @build UnexportLeak
- * @build UnexportLeak_Stub
- * @build TestLibrary
- * @build Ping
+ * @build TestLibrary UnexportLeak_Stub Ping
* @run main/othervm UnexportLeak
*/
--- a/jdk/test/java/rmi/server/Unmarshal/PrimitiveClasses.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/Unmarshal/PrimitiveClasses.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,7 @@
* @bug 4442373
* @summary Verify that RMI can successfully unmarshal Class objects for
* primitive types.
+ * @run main PrimitiveClasses
*/
import java.rmi.MarshalledObject;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshal.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 1999, 2008, 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.rmi.Remote;
+import java.rmi.RemoteException;
+ /*
+ * Interface with methods to exercise RMI parameter marshalling
+ * and unmarshalling.
+ */
+ interface CheckUnmarshal extends java.rmi.Remote {
+ public PoisonPill getPoisonPill() throws RemoteException;
+ public Object ping() throws RemoteException;
+ public void passRuntimeExceptionParameter(
+ RuntimeExceptionParameter rep)
+ throws RemoteException;
+ }
--- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshalOnStopThread.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,10 +31,8 @@
* @author Laird Dornin
*
* @library ../../../testlibrary
- * @build TestLibrary RMID JavaVM StreamPipe
- * @build CheckUnmarshall PoisonPill RuntimeExceptionParameter
- * @build CheckUnmarshalOnStopThread
- * @build CheckUnmarshalOnStopThread_Stub
+ * @build TestLibrary CheckUnmarshal CheckUnmarshalOnStopThread_Stub
+ * PoisonPill RuntimeExceptionParameter
* @run main/othervm/timeout=480 CheckUnmarshalOnStopThread
*/
--- a/jdk/test/java/rmi/server/Unmarshal/checkUnmarshalOnStopThread/CheckUnmarshall.java Thu Dec 20 10:22:19 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1999, 2008, 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.rmi.Remote;
-import java.rmi.RemoteException;
- /*
- * Interface with methods to exercise RMI parameter marshalling
- * and unmarshalling.
- */
- interface CheckUnmarshal extends java.rmi.Remote {
- public PoisonPill getPoisonPill() throws RemoteException;
- public Object ping() throws RemoteException;
- public void passRuntimeExceptionParameter(
- RuntimeExceptionParameter rep)
- throws RemoteException;
- }
--- a/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/Unreferenced/finiteGCLatency/FiniteGCLatency.java Mon Dec 24 11:46:38 2012 -0800
@@ -35,9 +35,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build FiniteGCLatency
- * @build FiniteGCLatency_Stub
- * @build TestLibrary
+ * @build TestLibrary FiniteGCLatency_Stub
* @run main/othervm/timeout=120 FiniteGCLatency
*/
--- a/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/Unreferenced/leaseCheckInterval/LeaseCheckInterval.java Mon Dec 24 11:46:38 2012 -0800
@@ -37,11 +37,7 @@
* @author Peter Jones
*
* @library ../../../testlibrary
- * @build TestLibrary
- * @build JavaVM
- * @build LeaseCheckInterval
- * @build LeaseCheckInterval_Stub
- * @build SelfTerminator
+ * @build TestLibrary JavaVM LeaseCheckInterval_Stub SelfTerminator
* @run main/othervm LeaseCheckInterval
*/
--- a/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/Unreferenced/marshalledObjectGet/MarshalledObjectGet.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,8 +30,6 @@
* invoked.
* @author Peter Jones
*
- * @library ../../../testlibrary
- * @build MarshalledObjectGet
* @build MarshalledObjectGet_Stub
* @run main/othervm/timeout=120 MarshalledObjectGet
*/
--- a/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/Unreferenced/unreferencedContext/UnreferencedContext.java Mon Dec 24 11:46:38 2012 -0800
@@ -39,9 +39,7 @@
* @author Laird Dornin
*
* @library ../../../testlibrary
- * @build UnreferencedContext
- * @build UnreferencedContext_Stub
- * @build TestLibrary
+ * @build TestLibrary UnreferencedContext_Stub
* @run main/othervm/timeout=120 UnreferencedContext
*/
--- a/jdk/test/java/rmi/server/clientStackTrace/ClientStackTrace.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/clientStackTrace/ClientStackTrace.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,7 +28,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build ClientStackTrace MyRemoteObject_Stub TestLibrary TestParams
+ * @build TestLibrary ClientStackTrace MyRemoteObject_Stub
* @run main/othervm/policy=security.policy/timeout=120 ClientStackTrace
*/
--- a/jdk/test/java/rmi/server/getRemoteClass/GetRemoteClass.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/getRemoteClass/GetRemoteClass.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,7 +28,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build GetRemoteClass TestLibrary TestParams
+ * @build TestLibrary
* @run main/othervm GetRemoteClass
*/
--- a/jdk/test/java/rmi/server/serverStackTrace/ServerStackTrace.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/serverStackTrace/ServerStackTrace.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,8 +29,7 @@
* serialized with the Throwable from the server.
* @author Peter Jones
*
- * @build ServerStackTrace
- * @build ServerStackTrace_Stub
+ * @build ServerStackTrace ServerStackTrace_Stub
* @run main/othervm ServerStackTrace
*/
--- a/jdk/test/java/rmi/server/serverStackTrace/SuppressStackTraces.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/serverStackTrace/SuppressStackTraces.java Mon Dec 24 11:46:38 2012 -0800
@@ -36,10 +36,7 @@
* for reasons of performance or confidentiality requirements.
* @author Peter Jones
*
- * @build SuppressStackTraces
- * @build Impl2_Stub
- * @build Impl1_Stub
- * @build Impl1_Skel
+ * @build SuppressStackTraces Impl2_Stub Impl1_Stub Impl1_Skel
* @run main/othervm SuppressStackTraces
*/
--- a/jdk/test/java/rmi/server/useCustomRef/UseCustomRef.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/server/useCustomRef/UseCustomRef.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,11 +31,7 @@
* 4180392
*
* @library ../../testlibrary
- * @build UseCustomRef
- * @build Ping
- * @build UseCustomRef_Stub
- * @build UseCustomRef_Skel
- * @build TestLibrary
+ * @build TestLibrary Ping UseCustomRef_Stub UseCustomRef_Skel
* @run main/othervm/policy=security.policy/secure=java.rmi.RMISecurityManager/timeout=120 UseCustomRef
*
* This test was failing to run because the synthetic access
--- a/jdk/test/java/rmi/testlibrary/TestLibrary.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/testlibrary/TestLibrary.java Mon Dec 24 11:46:38 2012 -0800
@@ -54,6 +54,7 @@
import java.rmi.server.UnicastRemoteObject;
import java.util.Enumeration;
import java.util.Properties;
+
import sun.rmi.registry.RegistryImpl;
import sun.rmi.server.UnicastServerRef;
import sun.rmi.transport.Endpoint;
@@ -92,6 +93,7 @@
public final static int INHERITEDCHANNELNOTSERVERSOCKET_ACTIVATION_PORT = 64003;
public final static int INHERITEDCHANNELNOTSERVERSOCKET_REGISTRY_PORT = 64004;
public final static int READTEST_REGISTRY_PORT = 64005;
+ private final static int MAX_SERVER_SOCKET_TRIES = 10;
static void mesg(Object mesg) {
System.err.println("TEST_LIBRARY: " + mesg.toString());
@@ -125,36 +127,15 @@
bomb(null, e);
}
- /**
- * Property accessors
- */
- private static boolean getBoolean(String name) {
- return (new Boolean(getProperty(name, "false")).booleanValue());
- }
- private static Integer getInteger(String name) {
- int val = 0;
- Integer value = null;
-
- String propVal = getProperty(name, null);
- if (propVal == null) {
- return null;
- }
-
- try {
- value = new Integer(Integer.parseInt(propVal));
- } catch (NumberFormatException nfe) {
- }
- return value;
- }
public static String getProperty(String property, String defaultVal) {
final String prop = property;
final String def = defaultVal;
- return ((String) java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction() {
- public Object run() {
+ return java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<String>() {
+ public String run() {
return System.getProperty(prop, def);
}
- }));
+ });
}
/**
@@ -169,9 +150,9 @@
public static void setProperty(String property, String value) {
final String prop = property;
final String val = value;
- java.security.AccessController.doPrivileged
- (new java.security.PrivilegedAction() {
- public Object run() {
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Void>() {
+ public Void run() {
System.setProperty(prop, val);
return null;
}
@@ -188,7 +169,7 @@
out.println("-------------------Test environment----------" +
"---------");
- for(Enumeration keys = System.getProperties().keys();
+ for(Enumeration<?> keys = System.getProperties().keys();
keys.hasMoreElements();) {
String property = (String) keys.nextElement();
@@ -252,7 +233,7 @@
/*
* Obtain the URL for the codebase.
*/
- URL codebaseURL = dstDir.toURL();
+ URL codebaseURL = dstDir.toURI().toURL();
/*
* Specify where we will copy the class definition from, if
@@ -407,26 +388,46 @@
*/
public static int getUnusedRandomPort() {
int numTries = 0;
- int unusedRandomPort = FIXED_PORT_MIN;
- Exception ex = null;
+ IOException ex = null;
- while (numTries++ < 10) {
+ while (numTries++ < MAX_SERVER_SOCKET_TRIES) {
+ int unusedRandomPort = -1;
ex = null; //reset
try (ServerSocket ss = new ServerSocket(0)) {
unusedRandomPort = ss.getLocalPort();
- } catch (Exception e) {
+ } catch (IOException e) {
ex = e;
+ // temporarily print stack trace here until we find out why
+ // tests are failing.
+ System.err.println("TestLibrary.getUnusedRandomPort() caught "
+ + "exception on iteration " + numTries
+ + (numTries==MAX_SERVER_SOCKET_TRIES ? " (the final try)."
+ : "."));
+ ex.printStackTrace();
}
- if (!isReservedPort(unusedRandomPort)) {
- return unusedRandomPort;
+ if (unusedRandomPort >= 0) {
+ if (isReservedPort(unusedRandomPort)) {
+ System.out.println("INFO: On try # " + numTries
+ + (numTries==MAX_SERVER_SOCKET_TRIES ? ", the final try, ": ",")
+ + " ServerSocket(0) returned the reserved port "
+ + unusedRandomPort
+ + " in TestLibrary.getUnusedRandomPort() ");
+ } else {
+ return unusedRandomPort;
+ }
}
}
// If we're here, then either an exception was thrown or the port is
// a reserved port.
- throw new RuntimeException("Error getting unused random port.", ex);
+ if (ex==null) {
+ throw new RuntimeException("Error getting unused random port. The"
+ +" last port returned by ServerSocket(0) was a reserved port");
+ } else {
+ throw new RuntimeException("Error getting unused random port.", ex);
+ }
}
/**
--- a/jdk/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/acceptLoop/CloseServerSocketOnTermination.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,7 +31,6 @@
* exception for which it doesn't even consult the RMIFailureHandler.
* @author Peter Jones
*
- * @build CloseServerSocketOnTermination
* @run main/othervm CloseServerSocketOnTermination
*/
--- a/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/checkFQDN/CheckFQDN.java Mon Dec 24 11:46:38 2012 -0800
@@ -33,8 +33,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build CheckFQDN CheckFQDNClient CheckFQDN_Stub TellServerName
- * @build TestLibrary
+ * @build TestLibrary CheckFQDNClient CheckFQDN_Stub TellServerName
* @run main/othervm/timeout=120 CheckFQDN
*/
--- a/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,8 +28,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build CheckLeaseLeak CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak
- * @build TestLibrary
+ * @build TestLibrary CheckLeaseLeak_Stub LeaseLeakClient LeaseLeak
* @run main/othervm/timeout=240 CheckLeaseLeak
*
*/
--- a/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/closeServerSocket/CloseServerSocket.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,7 +31,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build CloseServerSocket TestLibrary
+ * @build TestLibrary
* @run main/othervm CloseServerSocket
*/
--- a/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/dgcDeadLock/DGCDeadLock.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,11 +28,7 @@
* @author Laird Dornin
*
* @library ../../testlibrary
- * @build DGCDeadLock
- * @build Test
- * @build TestImpl
- * @build TestImpl_Stub
- * @build TestLibrary
+ * @build TestLibrary Test TestImpl TestImpl_Stub
* @run main/othervm/policy=security.policy/timeout=360 DGCDeadLock
*/
--- a/jdk/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/handshakeFailure/HandshakeFailure.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,7 +31,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build HandshakeFailure TestLibrary
+ * @build TestLibrary
* @run main/othervm HandshakeFailure
*/
--- a/jdk/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/handshakeTimeout/HandshakeTimeout.java Mon Dec 24 11:46:38 2012 -0800
@@ -34,7 +34,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build HandshakeTimeout TestLibrary
+ * @build TestLibrary
* @run main/othervm HandshakeTimeout
*/
--- a/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/httpSocket/HttpSocketTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,7 @@
* @author Dana Burns
*
* @library ../../testlibrary
- * @build HttpSocketTest HttpSocketTest_Stub TestLibrary
+ * @build TestLibrary HttpSocketTest HttpSocketTest_Stub
* @run main/othervm/policy=security.policy HttpSocketTest
*/
--- a/jdk/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/rapidExportUnexport/RapidExportUnexport.java Mon Dec 24 11:46:38 2012 -0800
@@ -32,7 +32,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build TestLibrary RapidExportUnexport
+ * @build TestLibrary
* @run main/othervm RapidExportUnexport
*/
--- a/jdk/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/readTimeout/ReadTimeoutTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,12 +27,9 @@
* @summary Incoming connections should be subject to timeout
* @author Adrian Colley
*
- * @library ../../testlibrary
- * @build TestIface
- * @build TestImpl
- * @build TestImpl_Stub
- * @build ReadTimeoutTest
- * @run main/othervm/policy=security.policy/timeout=60 -Dsun.rmi.transport.tcp.readTimeout=5000 ReadTimeoutTest
+ * @build TestIface TestImpl TestImpl_Stub
+ * @run main/othervm/policy=security.policy/timeout=60
+ * -Dsun.rmi.transport.tcp.readTimeout=5000 ReadTimeoutTest
*/
/* This test sets a very short read timeout, exports an object, and then
--- a/jdk/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/reuseDefaultPort/ReuseDefaultPort.java Mon Dec 24 11:46:38 2012 -0800
@@ -34,7 +34,7 @@
* @author Peter Jones
*
* @library ../../testlibrary
- * @build ReuseDefaultPort TestLibrary
+ * @build TestLibrary
* @run main/othervm ReuseDefaultPort
*/
--- a/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/rmi/transport/runtimeThreadInheritanceLeak/RuntimeThreadInheritanceLeak.java Mon Dec 24 11:46:38 2012 -0800
@@ -38,7 +38,6 @@
* subsystems also not holding on to the loader in their daemon threads.]
* @author Peter Jones
*
- * @build RuntimeThreadInheritanceLeak
* @build RuntimeThreadInheritanceLeak_Stub
* @run main/othervm RuntimeThreadInheritanceLeak
*/
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh Mon Dec 24 11:46:38 2012 -0800
@@ -87,7 +87,7 @@
${TESTSRC}${FILESEP}provider${FILESEP}HashProvider.java
# run the test
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
-classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" \
-Djava.awt.headless=true \
ClassLoaderDeadlock
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock.sh Mon Dec 24 11:46:38 2012 -0800
@@ -62,5 +62,5 @@
JAVA="${TESTJAVA}${FILESEP}bin${FILESEP}java"
-${JAVA} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock
+${JAVA} ${TESTVMOPTS} -cp "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}Deadlock.jar" Deadlock
--- a/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/security/Security/ClassLoaderDeadlock/Deadlock2.sh Mon Dec 24 11:46:38 2012 -0800
@@ -100,8 +100,8 @@
rm Deadlock2*.class
# create serialized object and run the test
-${TESTJAVA}${FILESEP}bin${FILESEP}java CreateSerialized
-${TESTJAVA}${FILESEP}bin${FILESEP}java -Djava.ext.dirs=${TESTCLASSES}${FILESEP}testlib Deadlock2
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} CreateSerialized
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} -Djava.ext.dirs=${TESTCLASSES}${FILESEP}testlib Deadlock2
STATUS=$?
# clean up
--- a/jdk/test/java/security/Security/signedfirst/Dyn.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/security/Security/signedfirst/Dyn.sh Mon Dec 24 11:46:38 2012 -0800
@@ -83,7 +83,7 @@
${TESTSRC}${FILESEP}DynSignedProvFirst.java
# run the test
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
-classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}exp.jar" \
DynSignedProvFirst
--- a/jdk/test/java/security/Security/signedfirst/Static.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/security/Security/signedfirst/Static.sh Mon Dec 24 11:46:38 2012 -0800
@@ -84,7 +84,7 @@
# run the test
cd ${TESTSRC}${FILESEP}
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
-classpath "${TESTCLASSES}${PATHSEP}${TESTSRC}${FILESEP}exp.jar" \
-Djava.security.properties=file:${TESTSRC}${FILESEP}Static.props \
StaticSignedProvFirst
--- a/jdk/test/java/security/cert/CertificateFactory/slowstream.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/security/cert/CertificateFactory/slowstream.sh Mon Dec 24 11:46:38 2012 -0800
@@ -46,5 +46,5 @@
esac
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}SlowStream.java
-${TESTJAVA}${FS}bin${FS}java -Dtest.src=${TESTSRC} SlowStreamWriter | \
- ${TESTJAVA}${FS}bin${FS}java SlowStreamReader
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=${TESTSRC} SlowStreamWriter | \
+ ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} SlowStreamReader
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.*;
+import sun.util.locale.provider.TimeZoneNameUtility;
+
+public class GenericTimeZoneNamesTest {
+ private static final String[] PT = {
+ "America/Los_Angeles", "US/Pacific", "PST"
+ };
+
+ private static int errors = 0;
+
+ public static void main(String[] args) {
+ for (String tag : args) {
+ Locale locale = Locale.forLanguageTag(tag);
+ for (String tzid : PT) {
+ test(tzid, TimeZone.LONG, locale, "Pacific Time");
+ test(tzid, TimeZone.SHORT, locale, "PT");
+ }
+ }
+
+ if (errors != 0) {
+ throw new RuntimeException("test failed");
+ }
+ }
+
+ private static void test(String tzid, int style, Locale locale, String expected) {
+ // No public API to get generic time zone names (JDK 8)
+ String got = TimeZoneNameUtility.retrieveGenericDisplayName(tzid, style, locale);
+ if (!expected.equals(got)) {
+ System.err.printf("test: tzid=%s, locale=%s, style=%d, got=\"%s\", expected=\"%s\"%n",
+ tzid, locale, style, got, expected);
+ errors++;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Calendar/GenericTimeZoneNamesTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,47 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# 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 8003267
+# @summary Unit test for generic time zone names support
+# @compile -XDignore.symbol.file GenericTimeZoneNamesTest.java
+# @run shell GenericTimeZoneNamesTest.sh
+
+# This test is locale data-dependent and assumes that both JRE and CLDR
+# have the same geneic time zone names in English.
+
+STATUS=0
+echo "Locale providers: default"
+# TODO: The purpose of ja-JP is to make sure the fallback for generic
+# names works. Remove ja-JP when adding generic names to localized
+# resources.
+if ! ${TESTJAVA}/bin/java -esa -cp "${TESTCLASSES}" GenericTimeZoneNamesTest en-US ja-JP; then
+ STATUS=1
+fi
+
+echo "Locale providers: CLDR"
+if ! ${TESTJAVA}/bin/java -esa -cp "${TESTCLASSES}" -Djava.locale.providers=CLDR GenericTimeZoneNamesTest en-US; then
+ STATUS=1
+fi
+exit ${STATUS}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Calendar/NarrowNamesTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.*;
+import static java.util.GregorianCalendar.*;
+
+public class NarrowNamesTest {
+ private static final Locale US = Locale.US;
+ private static final Locale JAJPJP = new Locale("ja", "JP", "JP");
+ private static final Locale THTH = new Locale("th", "TH");
+
+ private static final String RESET_INDEX = "RESET_INDEX";
+
+ private static int errors = 0;
+
+ // This test is locale data-dependent.
+ public static void main(String[] args) {
+ test(US, ERA, "B",
+ ERA, BC, YEAR, 1);
+ test(US, ERA, "A",
+ ERA, AD, YEAR, 2012);
+ test(US, DAY_OF_WEEK, "S",
+ YEAR, 2012, MONTH, DECEMBER, DAY_OF_MONTH, 23);
+ test(US, AM_PM, "a",
+ HOUR_OF_DAY, 10);
+ test(US, AM_PM, "p",
+ HOUR_OF_DAY, 23);
+ test(JAJPJP, DAY_OF_WEEK, "\u65e5",
+ YEAR, 24, MONTH, DECEMBER, DAY_OF_MONTH, 23);
+ test(THTH, MONTH, NARROW_STANDALONE, "\u0e18.\u0e04.",
+ YEAR, 2555, MONTH, DECEMBER, DAY_OF_MONTH, 5);
+ test(THTH, DAY_OF_WEEK, "\u0e1e",
+ YEAR, 2555, MONTH, DECEMBER, DAY_OF_MONTH, 5);
+
+ testMap(US, DAY_OF_WEEK, ALL_STYLES, // shouldn't include any narrow names
+ "", // 1-based indexing for DAY_OF_WEEK
+ "Sunday", // Sunday
+ "Monday", // Monday
+ "Tuesday", // Tuesday
+ "Wednesday", // Wednesday
+ "Thursday", // Thursday
+ "Friday", // Friday
+ "Saturday", // Saturday
+ RESET_INDEX,
+ "", // 1-based indexing for DAY_OF_WEEK
+ "Sun", // abb Sunday
+ "Mon", // abb Monday
+ "Tue", // abb Tuesday
+ "Wed", // abb Wednesday
+ "Thu", // abb Thursday
+ "Fri", // abb Friday
+ "Sat" // abb Saturday
+ );
+ testMap(US, DAY_OF_WEEK, NARROW_FORMAT); // expect null
+ testMap(US, AM_PM, ALL_STYLES,
+ "AM", "PM",
+ RESET_INDEX,
+ "a", "p");
+ testMap(JAJPJP, DAY_OF_WEEK, NARROW_STANDALONE); // expect null
+ testMap(JAJPJP, DAY_OF_WEEK, NARROW_FORMAT,
+ "", // 1-based indexing for DAY_OF_WEEK
+ "\u65e5",
+ "\u6708",
+ "\u706b",
+ "\u6c34",
+ "\u6728",
+ "\u91d1",
+ "\u571f");
+ testMap(THTH, MONTH, NARROW_FORMAT); // expect null
+ testMap(THTH, MONTH, NARROW_STANDALONE,
+ "\u0e21.\u0e04.",
+ "\u0e01.\u0e1e.",
+ "\u0e21\u0e35.\u0e04.",
+ "\u0e40\u0e21.\u0e22.",
+ "\u0e1e.\u0e04.",
+ "\u0e21\u0e34.\u0e22.",
+ "\u0e01.\u0e04.",
+ "\u0e2a.\u0e04.",
+ "\u0e01.\u0e22.",
+ "\u0e15.\u0e04.",
+ "\u0e1e.\u0e22.",
+ "\u0e18.\u0e04.");
+
+ if (errors != 0) {
+ throw new RuntimeException("test failed");
+ }
+ }
+
+ private static void test(Locale locale, int field, String expected, int... data) {
+ test(locale, field, NARROW_FORMAT, expected, data);
+ }
+
+ private static void test(Locale locale, int field, int style, String expected, int... fieldValuePairs) {
+ Calendar cal = Calendar.getInstance(locale);
+ cal.clear();
+ for (int i = 0; i < fieldValuePairs.length;) {
+ int f = fieldValuePairs[i++];
+ int v = fieldValuePairs[i++];
+ cal.set(f, v);
+ }
+ String got = cal.getDisplayName(field, style, locale);
+ if (!expected.equals(got)) {
+ System.err.printf("test: locale=%s, field=%d, value=%d, style=%d, got=\"%s\", expected=\"%s\"%n",
+ locale, field, cal.get(field), style, got, expected);
+ errors++;
+ }
+ }
+
+ private static void testMap(Locale locale, int field, int style, String... expected) {
+ Map<String, Integer> expectedMap = null;
+ if (expected.length > 0) {
+ expectedMap = new TreeMap<>(LengthBasedComparator.INSTANCE);
+ int index = 0;
+ for (int i = 0; i < expected.length; i++) {
+ if (expected[i].isEmpty()) {
+ index++;
+ continue;
+ }
+ if (expected[i] == RESET_INDEX) {
+ index = 0;
+ continue;
+ }
+ expectedMap.put(expected[i], index++);
+ }
+ }
+ Calendar cal = Calendar.getInstance(locale);
+ Map<String, Integer> got = cal.getDisplayNames(field, style, locale);
+ if (!(expectedMap == null && got == null)
+ && !expectedMap.equals(got)) {
+ System.err.printf("testMap: locale=%s, field=%d, style=%d, expected=%s, got=%s%n",
+ locale, field, style, expectedMap, got);
+ errors++;
+ }
+ }
+
+ /**
+ * Comparator implementation for TreeMap which iterates keys from longest
+ * to shortest.
+ */
+ private static class LengthBasedComparator implements Comparator<String> {
+ private static final LengthBasedComparator INSTANCE = new LengthBasedComparator();
+
+ private LengthBasedComparator() {
+ }
+
+ @Override
+ public int compare(String o1, String o2) {
+ int n = o2.length() - o1.length();
+ return (n == 0) ? o1.compareTo(o2) : n;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/Calendar/NarrowNamesTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# 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 8000983
+# @summary Unit test for narrow names support
+# @build NarrowNamesTest
+# @run shell NarrowNamesTest.sh
+
+# This test is locale data-dependent and assumes that both JRE and CLDR
+# have the same narrow names.
+
+STATUS=0
+for P in "JRE,SPI" "CLDR"
+do
+ echo "Locale providers: $P"
+ if ! ${TESTJAVA}/bin/java -esa -cp "${TESTCLASSES}" -Djava.locale.providers="${P}" NarrowNamesTest; then
+ STATUS=1
+ fi
+done
+exit ${STATUS}
--- a/jdk/test/java/util/Currency/PropertiesTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/Currency/PropertiesTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -70,7 +70,7 @@
run() {
echo ''
- sh -xc "${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} $*" 2>&1
+ sh -xc "${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} $*" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
@@ -113,7 +113,7 @@
# run
echo ''
-sh -xc "${WRITABLEJDK}${FS}bin${FS}java -cp ${TESTCLASSES} PropertiesTest -d dump3"
+sh -xc "${WRITABLEJDK}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} PropertiesTest -d dump3"
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# Cleanup
--- a/jdk/test/java/util/Locale/LocaleCategory.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/Locale/LocaleCategory.sh Mon Dec 24 11:46:38 2012 -0800
@@ -69,7 +69,7 @@
# test user.xxx.display user.xxx.format properties
# run
-RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
+RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
echo ${RUNCMD}
${RUNCMD}
@@ -85,7 +85,7 @@
# test user.xxx properties overriding user.xxx.display/format
# run
-RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
+RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Duser.language=en -Duser.language.display=ja -Duser.language.format=zh LocaleCategory"
echo ${RUNCMD}
${RUNCMD}
--- a/jdk/test/java/util/Locale/LocaleProviders.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/Locale/LocaleProviders.sh Mon Dec 24 11:46:38 2012 -0800
@@ -96,12 +96,12 @@
${TESTJAVA}${FS}bin${FS}jar cvf ${SPIDIR}${FS}tznp.jar -C ${SPIDIR}${FS}dest .
# get the platform default locales
-PLATDEF=`${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
+PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale display`
DEFLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
DEFCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
echo "DEFLANG=${DEFLANG}"
echo "DEFCTRY=${DEFCTRY}"
-PLATDEF=`${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale format`
+PLATDEF=`${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} LocaleProviders getPlatformLocale format`
DEFFMTLANG=`echo ${PLATDEF} | sed -e "s/,.*//"`
DEFFMTCTRY=`echo ${PLATDEF} | sed -e "s/.*,//"`
echo "DEFFMTLANG=${DEFFMTLANG}"
@@ -109,7 +109,7 @@
runTest()
{
- RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${TESTCLASSES} -Djava.locale.providers=$PREFLIST LocaleProviders $METHODNAME $PARAM1 $PARAM2 $PARAM3"
+ RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${TESTCLASSES} -Djava.locale.providers=$PREFLIST LocaleProviders $METHODNAME $PARAM1 $PARAM2 $PARAM3"
echo ${RUNCMD}
${RUNCMD}
result=$?
--- a/jdk/test/java/util/PluggableLocale/ExecTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/ExecTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -119,9 +119,9 @@
# run
if [ "$3" = "true" ]
then
- RUNCMD="${TESTJAVA}${FS}bin${FS}java -Djava.ext.dirs=${EXTDIRS} $2 "
+ RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Djava.ext.dirs=${EXTDIRS} $2 "
else
- RUNCMD="${TESTJAVA}${FS}bin${FS}java -classpath ${CLASSPATHARG} $2 "
+ RUNCMD="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath ${CLASSPATHARG} $2 "
fi
echo ${RUNCMD}
--- a/jdk/test/java/util/PluggableLocale/GenericTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/GenericTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -41,6 +41,7 @@
com.bar.CurrencyNameProviderImpl2 currencyNP2 = new com.bar.CurrencyNameProviderImpl2();
com.bar.LocaleNameProviderImpl localeNP = new com.bar.LocaleNameProviderImpl();
com.bar.TimeZoneNameProviderImpl tzNP = new com.bar.TimeZoneNameProviderImpl();
+ com.bar.GenericTimeZoneNameProviderImpl tzGenNP = new com.bar.GenericTimeZoneNameProviderImpl();
com.bar.CalendarDataProviderImpl calDataP = new com.bar.CalendarDataProviderImpl();
com.bar.CalendarNameProviderImpl calNameP = new com.bar.CalendarNameProviderImpl();
@@ -73,6 +74,7 @@
expected.addAll(Arrays.asList(currencyNP2.getAvailableLocales()));
expected.addAll(Arrays.asList(localeNP.getAvailableLocales()));
expected.addAll(Arrays.asList(tzNP.getAvailableLocales()));
+ expected.addAll(Arrays.asList(tzGenNP.getAvailableLocales()));
expected.addAll(Arrays.asList(calDataP.getAvailableLocales()));
expected.addAll(Arrays.asList(calNameP.getAvailableLocales()));
if (!result.equals(expected)) {
--- a/jdk/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/TimeZoneNameProviderTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -40,6 +40,7 @@
TimeZoneNameProviderTest() {
test1();
test2();
+ test3();
aliasTest();
}
@@ -92,6 +93,7 @@
final String pattern = "z";
final Locale OSAKA = new Locale("ja", "JP", "osaka");
final Locale KYOTO = new Locale("ja", "JP", "kyoto");
+ final Locale GENERIC = new Locale("ja", "JP", "generic");
final String[] TIMEZONES = {
"GMT", "America/Los_Angeles", "SystemV/PST8",
@@ -157,6 +159,29 @@
}
}
+ void test3() {
+ final String[] TZNAMES = {
+ LATIME, PST, PST8PDT, US_PACIFIC,
+ TOKYOTIME, JST, JAPAN,
+ };
+ for (String tzname : TZNAMES) {
+ TimeZone tz = TimeZone.getTimeZone(tzname);
+ for (int style : new int[] { TimeZone.LONG, TimeZone.SHORT }) {
+ String osakaStd = tz.getDisplayName(false, style, OSAKA);
+ if (osakaStd != null) {
+ // No API for getting generic time zone names
+ String generic = TimeZoneNameUtility.retrieveGenericDisplayName(tzname,
+ style, GENERIC);
+ String expected = "Generic " + osakaStd;
+ if (!expected.equals(generic)) {
+ throw new RuntimeException("Wrong generic name: got=\"" + generic
+ + "\", expected=\"" + expected + "\"");
+ }
+ }
+ }
+ }
+ }
+
final String LATIME = "America/Los_Angeles";
final String PST = "PST";
final String PST8PDT = "PST8PDT";
--- a/jdk/test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/TimeZoneNameProviderTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -23,6 +23,6 @@
#!/bin/sh
#
# @test
-# @bug 4052440
+# @bug 4052440 8003267
# @summary TimeZoneNameProvider tests
# @run shell ExecTest.sh bar TimeZoneNameProviderTest true
Binary file jdk/test/java/util/PluggableLocale/barprovider.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/java/util/PluggableLocale/providersrc/GenericTimeZoneNameProviderImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+/*
+ *
+ */
+
+package com.bar;
+
+import java.util.*;
+import java.util.spi.*;
+
+import com.foobar.Utils;
+
+/**
+ * Implementation class for getGenericTimeZoneName which returns "Generic "+<standard name in OSAKA>.
+ */
+public class GenericTimeZoneNameProviderImpl extends TimeZoneNameProviderImpl {
+ static final Locale jaJPGeneric = new Locale("ja", "JP", "generic");
+ static final Locale OSAKA = new Locale("ja", "JP", "osaka");
+
+ static Locale[] avail = {
+ jaJPGeneric
+ };
+
+ @Override
+ public Locale[] getAvailableLocales() {
+ return avail;
+ }
+
+ @Override
+ public String getGenericDisplayName(String id, int style, Locale locale) {
+ if (!jaJPGeneric.equals(locale)) {
+ return null;
+ }
+ String std = super.getDisplayName(id, false, style, OSAKA);
+ return (std != null) ? "Generic " + std : null;
+ }
+}
--- a/jdk/test/java/util/PluggableLocale/providersrc/Makefile Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/providersrc/Makefile Mon Dec 24 11:46:38 2012 -0800
@@ -38,6 +38,7 @@
CurrencyNameProviderImpl.java \
CurrencyNameProviderImpl2.java \
TimeZoneNameProviderImpl.java \
+ GenericTimeZoneNameProviderImpl.java \
LocaleNameProviderImpl.java \
CalendarDataProviderImpl.java \
CalendarNameProviderImpl.java \
--- a/jdk/test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/PluggableLocale/providersrc/java.util.spi.TimeZoneNameProvider Mon Dec 24 11:46:38 2012 -0800
@@ -5,3 +5,4 @@
# implementation class
#
com.bar.TimeZoneNameProviderImpl
+com.bar.GenericTimeZoneNameProviderImpl
--- a/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/ResourceBundle/Bug6299235Test.sh Mon Dec 24 11:46:38 2012 -0800
@@ -75,7 +75,7 @@
cd ${TESTSRC}
-${TESTJAVA}/bin/java -cp ${TESTCLASSES} -Djava.ext.dirs=${NEW_EXT_DIR} Bug6299235Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${TESTCLASSES} -Djava.ext.dirs=${NEW_EXT_DIR} Bug6299235Test
if [ $? -ne 0 ]
then
--- a/jdk/test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/ResourceBundle/Control/MissingResourceCauseTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -50,7 +50,7 @@
: ${TESTCLASS:=.}
: ${TESTSRC:=.}
-${TESTJAVA}/bin/java -esa -cp ${TESTCLASS}${DEL}${TESTSRC} MissingResourceCauseTest
+${TESTJAVA}/bin/java ${TESTVMOPTS} -esa -cp ${TESTCLASS}${DEL}${TESTSRC} MissingResourceCauseTest
STATUS=$?
chmod 666 $UNREADABLE
rm -f $UNREADABLE
--- a/jdk/test/java/util/ServiceLoader/basic.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/ServiceLoader/basic.sh Mon Dec 24 11:46:38 2012 -0800
@@ -94,7 +94,7 @@
cp="$1"; shift
if [ -z "$cp" ]; then cp="$TESTCLASSES"; else cp="$TESTCLASSES$SEP$cp"; fi
vmargs="$1"; shift
- sh -xc "'$JAVA' -cp $cp $vmargs $T $*" 2>&1
+ sh -xc "'$JAVA' ${TESTVMOPTS} -cp $cp $vmargs $T $*" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
--- a/jdk/test/java/util/TimeZone/OldIDMappingTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/TimeZone/OldIDMappingTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -40,7 +40,7 @@
if [ x"$I" != x ]; then
D="-Dsun.timezone.ids.oldmapping=${I}"
fi
- if ! ${JAVA} ${D} -cp ${TESTCLASSES} OldIDMappingTest -new; then
+ if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -new; then
STATUS=1
fi
done
@@ -51,7 +51,7 @@
if [ "x$I" != x ]; then
D="-Dsun.timezone.ids.oldmapping=${I}"
fi
- if ! ${JAVA} ${D} -cp ${TESTCLASSES} OldIDMappingTest -old; then
+ if ! ${JAVA} ${D} ${TESTVMOPTS} -cp ${TESTCLASSES} OldIDMappingTest -old; then
STATUS=1
fi
done
--- a/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/TimeZone/TimeZoneDatePermissionCheck.sh Mon Dec 24 11:46:38 2012 -0800
@@ -53,6 +53,6 @@
# run it with the security manager on, plus accesscontroller debugging
# will go into infinite recursion trying to get enough permissions for
# printing Date of failing certificate unless fix is applied.
-${TESTJAVA}/bin/java -Djava.security.manager \
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.security.manager \
-Djava.security.debug=access,failure,policy \
-cp ${TESTCLASSES}/timezonedatetest.jar TimeZoneDatePermissionCheck
--- a/jdk/test/java/util/logging/CheckLockLocationTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/logging/CheckLockLocationTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,6 @@
* @run main/othervm CheckLockLocationTest
*/
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.AccessDeniedException;
import java.nio.file.FileSystemException;
@@ -42,17 +41,22 @@
private static final String NOT_A_DIR = "not-a-dir";
private static final String WRITABLE_DIR = "writable-dir";
private static final String NON_EXISTENT_DIR = "non-existent-dir";
+ private static boolean runNonWritableDirTest;
public static void main(String... args) throws IOException {
// we'll base all file creation attempts on the system temp directory,
// %t and also try specifying non-existent directories and plain files
// that should be directories, and non-writable directories,
// to exercise all code paths of checking the lock location
+ // Note that on platforms like Windows that don't support
+ // setWritable() on a directory, we'll skip the non-writable
+ // directory test if setWritable(false) returns false.
+ //
File writableDir = setup();
// we now have three files/directories to work with:
// writableDir
// notAdir
- // nonWritableDir
+ // nonWritableDir (may not be possible on some platforms)
// nonExistentDir (which doesn't exist)
runTests(writableDir);
}
@@ -79,15 +83,18 @@
}
// Test 2: creating FileHandler in non-writable directory should fail
- try {
- new FileHandler("%t/" + NON_WRITABLE_DIR + "/log.log");
- throw new RuntimeException("Test failed: should not have been able"
- + " to create FileHandler for " + "%t/" + NON_WRITABLE_DIR
- + "/log.log in non-writable directory.");
- } catch (IOException ex) {
- // check for the right exception
- if (!(ex instanceof AccessDeniedException)) {
- throw new RuntimeException("Test failed: Expected exception was not an AccessDeniedException", ex);
+ if (runNonWritableDirTest) {
+ try {
+ new FileHandler("%t/" + NON_WRITABLE_DIR + "/log.log");
+ throw new RuntimeException("Test failed: should not have been able"
+ + " to create FileHandler for " + "%t/" + NON_WRITABLE_DIR
+ + "/log.log in non-writable directory.");
+ } catch (AccessDeniedException ex) {
+ // the right exception was thrown, so continue.
+ } catch (IOException ex) {
+ throw new RuntimeException(
+ "Test failed: Expected exception was not an "
+ + "AccessDeniedException", ex);
}
}
@@ -97,11 +104,11 @@
throw new RuntimeException("Test failed: should not have been able"
+ " to create FileHandler for " + "%t/" + NOT_A_DIR
+ "/log.log in non-directory.");
+ } catch (FileSystemException ex) {
+ // the right exception was thrown, so continue.
} catch (IOException ex) {
- // check for the right exception
- if (!(ex instanceof FileSystemException && ex.getMessage().contains("Not a directory"))) {
- throw new RuntimeException("Test failed: Expected exception was not a FileSystemException", ex);
- }
+ throw new RuntimeException("Test failed: exception thrown was not a "
+ + "FileSystemException", ex);
}
// Test 4: make sure we can't create a FileHandler in a non-existent dir
@@ -110,11 +117,11 @@
throw new RuntimeException("Test failed: should not have been able"
+ " to create FileHandler for " + "%t/" + NON_EXISTENT_DIR
+ "/log.log in a non-existent directory.");
+ } catch (NoSuchFileException ex) {
+ // the right exception was thrown, so continue.
} catch (IOException ex) {
- // check for the right exception
- if (!(ex instanceof NoSuchFileException)) {
- throw new RuntimeException("Test failed: Expected exception was not a NoSuchFileException", ex);
- }
+ throw new RuntimeException("Test failed: Expected exception "
+ + "was not a NoSuchFileException", ex);
}
}
@@ -162,10 +169,14 @@
nonWritableDir.deleteOnExit();
// make it non-writable
- if (!nonWritableDir.setWritable(false)) {
- throw new RuntimeException("Test setup failed: unable to make"
+ if (nonWritableDir.setWritable(false)) {
+ runNonWritableDirTest = true;
+ } else {
+ runNonWritableDirTest = false;
+ System.out.println( "Test Setup WARNING: unable to make"
+ " working directory " + nonWritableDir.getAbsolutePath()
- + " non-writable.");
+ + " non-writable on platform " + System.getProperty("os.name"));
+
}
// make sure non-existent directory really doesn't exist
@@ -199,12 +210,14 @@
/*
* Recursively delete all files starting at specified file
*/
- private static void delete(File f) throws IOException {
+ private static void delete(File f) {
if (f != null && f.isDirectory()) {
for (File c : f.listFiles())
delete(c);
}
if (!f.delete())
- throw new FileNotFoundException("Failed to delete file: " + f);
- }
+ System.err.println(
+ "WARNING: unable to delete/cleanup writable test directory: "
+ + f );
+ }
}
--- a/jdk/test/java/util/prefs/CheckUserPrefsStorage.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/prefs/CheckUserPrefsStorage.sh Mon Dec 24 11:46:38 2012 -0800
@@ -50,14 +50,14 @@
esac
# run CheckUserPrefFirst - creates and stores a user pref
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefFirst
result=$?
if [ "$result" -ne "0" ]; then
exit 1
fi
# run CheckUserPrefLater - Looks for the stored pref
-${TESTJAVA}${FS}bin${FS}java -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -cp ${TESTCLASSES} -Djava.util.prefs.userRoot=. CheckUserPrefLater
result=$?
if [ "$result" -ne "0" ]; then
exit 1
--- a/jdk/test/java/util/prefs/PrefsSpi.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/prefs/PrefsSpi.sh Mon Dec 24 11:46:38 2012 -0800
@@ -87,17 +87,17 @@
case "`uname`" in Windows*|CYGWIN* ) CPS=';';; *) CPS=':';; esac
-Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
-Djava.util.prefs.PreferencesFactory=StubPreferencesFactory \
-Djava.util.prefs.userRoot=. \
PrefsSpi "StubPreferences"
-Sys "$java" "-cp" "$TESTCLASSES" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES" \
-Djava.util.prefs.userRoot=. \
PrefsSpi "java.util.prefs.*"
-Sys "$java" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES${CPS}extDir/PrefsSpi.jar" \
-Djava.util.prefs.userRoot=. \
PrefsSpi "StubPreferences"
-Sys "$java" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \
+Sys "$java" "${TESTVMOPTS}" "-cp" "$TESTCLASSES" "-Djava.ext.dirs=extDir" \
-Djava.util.prefs.userRoot=. \
PrefsSpi "StubPreferences"
--- a/jdk/test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/spi/ResourceBundleControlProvider/UserDefaultControlTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -21,4 +21,5 @@
# questions.
#
-${TESTJAVA}/bin/java -Djava.ext.dirs=${TESTSRC} -cp ${TESTCLASSES} UserDefaultControlTest
\ No newline at end of file
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.ext.dirs=${TESTSRC} -cp ${TESTCLASSES} UserDefaultControlTest
+
--- a/jdk/test/java/util/zip/3GBZipFiles.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/zip/3GBZipFiles.sh Mon Dec 24 11:46:38 2012 -0800
@@ -1,4 +1,3 @@
-#
# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
@@ -83,7 +82,7 @@
huge-*) filesize_="$hugeSize" ;;
tiny-*) filesize_="$tinySize" ;;
esac
- sys "$JAVA" "-cp" "$TESTCLASSES" "FileBuilder" \
+ sys "$JAVA" ${TESTVMOPTS} "-cp" "$TESTCLASSES" "FileBuilder" \
"$filetype_" "$filename_" "$filesize_"
}
--- a/jdk/test/java/util/zip/ZipFile/deletetempjar.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/java/util/zip/ZipFile/deletetempjar.sh Mon Dec 24 11:46:38 2012 -0800
@@ -30,7 +30,7 @@
TESTCLASSES=.
fi
-tmpfile=`$TESTJAVA/bin/java -classpath $TESTCLASSES DeleteTempJar`
+tmpfile=`$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES DeleteTempJar`
rc=$?
if [ $rc != 0 ]; then
echo Unexpected failure with exit status $rc
--- a/jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/javax/crypto/SecretKeyFactory/FailOverTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -82,6 +82,7 @@
fi
${TESTJAVA}${FS}bin${FS}java \
+ ${TESTVMOPTS} \
-classpath "${TESTSRC}${FS}P1.jar${PS}${TESTSRC}${FS}P2.jar${PS}." \
FailOverTest
result=$?
--- a/jdk/test/javax/print/applet/AppletPrintLookup.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/javax/print/applet/AppletPrintLookup.sh Mon Dec 24 11:46:38 2012 -0800
@@ -82,7 +82,7 @@
${TESTJAVA}${SEP}bin${SEP}appletviewer ${TESTCLASSES}${SEP}AppletPrintLookup.html &
cd ${TESTCLASSES}
-${TESTJAVA}${SEP}bin${SEP}java YesNo
+${TESTJAVA}${SEP}bin${SEP}java ${TESTVMOPTS} YesNo
if [ $? -ne 0 ]
then
echo "Test fails!"
--- a/jdk/test/javax/rmi/ssl/SocketFactoryTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/javax/rmi/ssl/SocketFactoryTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,8 +26,7 @@
* @bug 4932837 6582235
* @summary Test SslRMI[Client|Server]SocketFactory equals() and hashCode().
* @author Daniel Fuchs
- * @run clean SocketFactoryTest
- * @run build SocketFactoryTest
+ *
* @run main SocketFactoryTest
*/
--- a/jdk/test/javax/script/ProviderTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/javax/script/ProviderTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -45,6 +45,6 @@
echo "Running test ..."
-$JAVA -classpath \
+$JAVA ${TESTVMOPTS} -classpath \
"${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar" \
ProviderTest
--- a/jdk/test/javax/security/auth/Subject/doAs/Test.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/javax/security/auth/Subject/doAs/Test.sh Mon Dec 24 11:46:38 2012 -0800
@@ -71,7 +71,7 @@
cd ${TESTSRC}${FS}
cd $WD
echo $WD
-${TESTJAVA}${FS}bin${FS}java -classpath "${TESTCLASSES}${FS}" \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -classpath "${TESTCLASSES}${FS}" \
-Djava.security.manager \
-Djava.security.policy=${TESTSRC}${FS}policy \
Test
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JInternalFrame/5066752/bug5066752.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 5066752
+ @summary Transparent JDesktopPane impossible because isOpaque() returns true
+ @author mb50250: area=JDesktopPane
+ @library ../../regtesthelpers
+ @build Util
+ @run main bug5066752
+*/
+
+import java.awt.*;
+import javax.swing.*;
+import sun.awt.*;
+
+public class bug5066752
+{
+ private static JFrame frame;
+
+ public static void main(String[] args) throws Exception {
+ SunToolkit tk = (SunToolkit)Toolkit.getDefaultToolkit();
+ Robot r = new Robot();
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ createAndShowGUI();
+ }
+ });
+ tk.realSync();
+
+ r.delay(600);
+
+ Point p = Util.getCenterPoint(frame);
+ Color color = r.getPixelColor((int) p.getX(), (int) p.getY());
+ if (!color.equals(Color.RED)) {
+ throw new Exception("Test failed: JDesktopPane isn't transparent. Expected color is (red color): " + Color.RED + ", actual color is: " + color);
+ }
+ }
+
+ private static void createAndShowGUI() {
+ frame = new JFrame();
+
+ frame.setLayout(new BorderLayout());
+ frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+
+ JPanel panel = new JPanel();
+ panel.setLayout(new BorderLayout());
+ panel.setBackground(Color.RED);
+ frame.add(panel, BorderLayout.CENTER);
+
+ JDesktopPane dp = new JDesktopPane();
+ dp.setOpaque(false);
+ panel.add(dp, BorderLayout.CENTER);
+
+ frame.setBounds(200, 200, 300, 200);
+ frame.setVisible(true);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/RepaintManager/IconifyTest/IconifyTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 4665214
+ * @summary Makes sure that RepaintManager doesn't attempt to repaint
+ * a frame when it is iconified.
+ * @author Scott Violet
+ * @run main IconifyTest
+ */
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+import sun.awt.*;
+
+public class IconifyTest {
+ private static volatile boolean windowIconifiedIsCalled = false;
+ private static volatile boolean frameIsRepainted = false;
+ static JFrame frame;
+ static JButton button;
+
+ public static void main(String[] args) throws Throwable {
+ SunToolkit toolkit = (SunToolkit) SunToolkit.getDefaultToolkit();
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame = new JFrame();
+ button = new JButton("HI");
+ frame.getContentPane().add(button);
+ frame.addWindowListener(new WindowAdapter() {
+ public void windowIconified(WindowEvent e) {
+ windowIconifiedIsCalled = true;
+ RepaintManager rm = RepaintManager.currentManager(null);
+ rm.paintDirtyRegions();
+ button.repaint();
+ if (!rm.getDirtyRegion(button).isEmpty()) {
+ frameIsRepainted = true;
+ }
+ }
+ });
+ frame.pack();
+ frame.setVisible(true);
+ }
+ });
+ toolkit.realSync();
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setExtendedState(Frame.ICONIFIED);
+ }
+ });
+ toolkit.realSync();
+
+ if (!windowIconifiedIsCalled) {
+ throw new Exception("Test failed: window was not iconified.");
+ }
+ if (frameIsRepainted) {
+ throw new Exception("Test failed: frame was repainted when window was iconified.");
+ }
+ }
+}
--- a/jdk/test/lib/security/java.policy/Ext_AllPolicy.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/lib/security/java.policy/Ext_AllPolicy.sh Mon Dec 24 11:46:38 2012 -0800
@@ -77,7 +77,7 @@
${TESTJAVA}${FS}bin${FS}jar -cvf Ext_AllPolicy.jar Ext_AllPolicy.class
rm Ext_AllPolicy.class
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-Djava.security.manager -Djava.ext.dirs="${TESTCLASSES}" Ext_AllPolicy
exit $?
--- a/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/jvmstat/monitor/MonitoredVm/MonitorVmStartTerminate.sh Mon Dec 24 11:46:38 2012 -0800
@@ -41,4 +41,4 @@
JAVA="${TESTJAVA}/bin/java"
CP=${TESTJAVA}${FS}lib${FS}tools.jar${PS}${TESTCLASSES}
-${JAVA} -classpath ${CP} MonitorVmStartTerminate
+${JAVA} ${TESTVMOPTS} -classpath ${CP} MonitorVmStartTerminate
--- a/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/CustomLauncherTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -150,7 +150,7 @@
done
# Start the manager - this should connect to VM
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
TestManager $pid $port true
if [ $? != 0 ]; then
echo "Test failed"
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -43,8 +43,8 @@
rm -f ${outputfile}
# Start VM with given options
- echo "+ $JAVA $1 Test"
- $JAVA $1 TestApplication > ${outputfile}&
+ echo "+ $JAVA ${TESTVMOPTS} $1 Test"
+ $JAVA ${TESTVMOPTS} $1 TestApplication > ${outputfile}&
pid=$!
# Wait for managed VM to startup
@@ -64,7 +64,7 @@
done
# Start the manager - this should connect to VM
- sh -xc "$JAVA -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
+ sh -xc "$JAVA ${TESTVMOPTS} -classpath ${TESTCLASSES}:${TESTJAVA}/lib/tools.jar \
TestManager $pid $port" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
@@ -112,7 +112,7 @@
# Test 4 - sanity check arguments to management-agent.jar
echo ' '
-sh -xc "${JAVA} -javaagent:${AGENT}=com.sun.management.jmxremote.port=7775,\
+sh -xc "${JAVA} ${TESTVMOPTS} -javaagent:${AGENT}=com.sun.management.jmxremote.port=7775,\
com.sun.management.jmxremote.authenticate=false,com.sun.management.jmxremote.ssl=false \
TestApplication -exit" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
--- a/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/PasswordFilePermissionTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -104,18 +104,18 @@
go() {
echo ''
- sh -xc "$JAVA $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
+ sh -xc "$JAVA ${TESTVMOPTS} $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
# Test 1 - password file is secure - VM should start
chmod 700 ${PASSWD}
-sh -xc "$JAVA $mp $pp Null" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Null" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# Test 2 - password file is not secure - VM should fail to start
chmod o+rx ${PASSWD}
-sh -xc "$JAVA $mp $pp Null" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Null" 2>&1
if [ $? = 0 ]; then failures=`expr $failures + 1`; fi
# Reset the file permissions on the generated password file
--- a/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/management/jmxremote/bootstrap/SSLConfigFilePermissionTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -101,18 +101,18 @@
go() {
echo ''
- sh -xc "$JAVA $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
+ sh -xc "$JAVA ${TESTVMOPTS} $1 $2 $3 $4 $5 $6 $7 $8" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
# Test 1 - SSL config file is secure - VM should start
chmod 700 ${SSL}
-sh -xc "$JAVA $mp $pp Dummy" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Dummy" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
# Test 2 - SSL config file is not secure - VM should fail to start
chmod o+rx ${SSL}
-sh -xc "$JAVA $mp $pp Dummy" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} $mp $pp Dummy" 2>&1
if [ $? = 0 ]; then failures=`expr $failures + 1`; fi
# Reset the file permissions on the generated SSL config file
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -61,7 +61,7 @@
}
_app_start(){
- ${TESTJAVA}/bin/java -server $* -cp ${_testclasses} JMXStartStopDoSomething >> ${_logname} 2>&1 &
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} $* -cp ${_testclasses} JMXStartStopDoSomething >> ${_logname} 2>&1 &
npid=`_get_pid`
if [ "${npid}" = "" ]
@@ -103,7 +103,7 @@
}
_testme(){
- ${TESTJAVA}/bin/java -cp ${_testclasses} JMXStartStopTest $*
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} -cp ${_testclasses} JMXStartStopTest $*
}
--- a/jdk/test/sun/misc/Cleaner/exitOnThrow.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/misc/Cleaner/exitOnThrow.sh Mon Dec 24 11:46:38 2012 -0800
@@ -39,7 +39,7 @@
TESTCLASSES=`pwd`
fi
-if $TESTJAVA/bin/java -cp $TESTCLASSES ExitOnThrow; then
+if $TESTJAVA/bin/java ${TESTVMOPTS} -cp $TESTCLASSES ExitOnThrow; then
echo Failed: VM exited normally
exit 1
else
--- a/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/InetAddress/nameservice/dns/cname.sh Mon Dec 24 11:46:38 2012 -0800
@@ -42,7 +42,7 @@
export CLASSPATH
JAVA="${TESTJAVA}/bin/java"
-sh -xc "$JAVA CanonicalName $HOST" 2>&1
+sh -xc "$JAVA ${TESTVMOPTS} CanonicalName $HOST" 2>&1
if [ $? != 0 ]; then
echo "DNS not configured or host doesn't resolve to CNAME record"
exit 0
@@ -52,7 +52,7 @@
go() {
echo ''
- sh -xc "$JAVA $1 Lookup $2" 2>&1
+ sh -xc "$JAVA ${TESTVMOPTS} $1 Lookup $2" 2>&1
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi
}
--- a/jdk/test/sun/net/sdp/sanity.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/sdp/sanity.sh Mon Dec 24 11:46:38 2012 -0800
@@ -57,7 +57,7 @@
export CLASSPATH
# Probe for IP addresses plumbed to IB interfaces
-$JAVA -Djava.net.preferIPv4Stack=true ProbeIB ${IB_LINKS} > ${IB_ADDRS}
+$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true ProbeIB ${IB_LINKS} > ${IB_ADDRS}
# Create sdp.conf
SDPCONF=sdp.conf
@@ -70,4 +70,4 @@
done
# Sanity check
-$JAVA -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
+$JAVA ${TESTVMOPTS} -Djava.net.preferIPv4Stack=true -Dcom.sun.sdp.conf=${SDPCONF} -Dcom.sun.sdp.debug Sanity
--- a/jdk/test/sun/net/www/MarkResetTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/www/MarkResetTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -52,4 +52,4 @@
# in this directory
cp ${TESTSRC}${FS}EncDec.doc .
-${TESTJAVA}${FS}bin${FS}java MarkResetTest
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} MarkResetTest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/net/www/MessageHeaderTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8003948
+ * @run main MessageHeaderTest
+ */
+import java.io.*;
+import sun.net.www.MessageHeader;
+
+public class MessageHeaderTest {
+ public static void main (String[] args) throws Exception {
+ for (int i=0; i<7; i++) {
+ ByteArrayInputStream bis = new ByteArrayInputStream(headers[i].getBytes());
+ MessageHeader h = new MessageHeader(bis);
+ String before = h.toString();
+ before = before.substring(before.indexOf('{'));
+ boolean result = h.filterNTLMResponses("WWW-Authenticate");
+ String after = h.toString();
+ after = after.substring(after.indexOf('{'));
+ if (!expected[i].equals(after)) {
+ throw new RuntimeException(Integer.toString(i) + " expected != after");
+ }
+ if (result != expectedResult[i]) {
+ throw new RuntimeException(Integer.toString(i) + " result != expectedResult");
+ }
+ }
+ }
+
+ static String expected[] = {
+ "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+ "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: }",
+ "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+ "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}",
+ "{null: HTTP/1.1 200 Ok}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM sdsds}{Bar: foo}",
+ "{null: HTTP/1.1 200 Ok}{WWW-Authenticate: Negotiate}{Foo: bar}{Bar: foo}{WWW-Authenticate: NTLM}{Bar: foo}{WWW-Authenticate: Kerberos}",
+ "{null: HTTP/1.1 200 Ok}{Foo: foo}{Bar: }{WWW-Authenticate: NTLM blob}{Bar: foo blob}"
+ };
+
+ static boolean[] expectedResult = {
+ false, false, true, true, true, false, false
+ };
+
+ static String[] headers = {
+ "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds",
+ "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate:",
+ "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nWWW-Authenticate: Negotiate",
+ "HTTP/1.1 200 Ok\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nWWW-Authenticate: Negotiate\r\nWWW-Authenticate: Kerberos",
+ "HTTP/1.1 200 Ok\r\nWWW-Authenticate: Negotiate\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM sdsds\r\nBar: foo\r\nWWW-Authenticate: Kerberos",
+ "HTTP/1.1 200 Ok\r\nWWW-Authenticate: Negotiate\r\nFoo: bar\r\nBar: foo\r\nWWW-Authenticate: NTLM\r\nBar: foo\r\nWWW-Authenticate: Kerberos",
+ "HTTP/1.1 200 Ok\r\nFoo: foo\r\nBar:\r\nWWW-Authenticate: NTLM blob\r\nBar: foo blob"
+ };
+}
--- a/jdk/test/sun/net/www/http/HttpClient/RetryPost.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/www/http/HttpClient/RetryPost.sh Mon Dec 24 11:46:38 2012 -0800
@@ -50,14 +50,14 @@
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}RetryPost.java
# run with no option specified. Should retry POST request.
-${TESTJAVA}${FS}bin${FS}java RetryPost
+${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 -Dsun.net.http.retryPost=false RetryPost noRetry
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dsun.net.http.retryPost=false RetryPost noRetry
result=$?
if [ "$result" -ne "0" ]; then
exit 1
--- a/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/www/protocol/file/DirPermissionDenied.sh Mon Dec 24 11:46:38 2012 -0800
@@ -35,7 +35,7 @@
mkdir -p ${TESTDIR}
chmod 333 ${TESTDIR}
-$TESTJAVA/bin/java -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR}
+$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES DirPermissionDenied ${TESTDIR}
result=$?
# Add back read access for user, otherwise not removable on some systems
--- a/jdk/test/sun/net/www/protocol/jar/B5105410.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/www/protocol/jar/B5105410.sh Mon Dec 24 11:46:38 2012 -0800
@@ -51,5 +51,5 @@
cp ${TESTSRC}${FS}foo2.jar .
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}B5105410.java
-${TESTJAVA}${FS}bin${FS}java B5105410
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} B5105410
--- a/jdk/test/sun/net/www/protocol/jar/getcontenttype.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/www/protocol/jar/getcontenttype.sh Mon Dec 24 11:46:38 2012 -0800
@@ -33,5 +33,5 @@
if [ x"$TESTSRC" = x ]; then TESTSRC=.; fi
# now start the test
-${TESTJAVA}/bin/java -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetContentType
+${TESTJAVA}/bin/java ${TESTVMOPTS} -Djava.ext.dirs=$TESTSRC -cp $TESTCLASSES GetContentType
--- a/jdk/test/sun/net/www/protocol/jar/jarbug/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/net/www/protocol/jar/jarbug/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -71,7 +71,7 @@
#
${TESTJAVA}${FS}bin${FS}javac -d ${DEST} ${TESTSRC}${FS}src${FS}test${FS}*.java
cd ${DEST}
-${TESTJAVA}${FS}bin${FS}java RunAllTests
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} RunAllTests
result=$?
if [ "$result" -ne "0" ]; then
exit 1
--- a/jdk/test/sun/rmi/log/ReliableLog/LogAlignmentTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/log/ReliableLog/LogAlignmentTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -22,8 +22,10 @@
*/
/* @test
- @bug 4094889
- @summary rmid can have a corrupted log
+ * @bug 4094889
+ * @summary rmid can have a corrupted log
+ *
+ * @run main LogAlignmentTest
*/
/* Fault: ReliableLog used RandomAccessFile.skipBytes() to seek past the end
--- a/jdk/test/sun/rmi/log/ReliableLog/SnapshotSize.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/log/ReliableLog/SnapshotSize.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,8 @@
* @bug 4319866
* @summary Verify that ReliableLog.snapshotSize() returns correct snapshot
* file size even if LogHandler doesn't flush.
+ *
+ * @run main SnapshotSize
*/
import java.io.ByteArrayOutputStream;
--- a/jdk/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/rmic/RMIGenerator/RmicDefault.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,7 +28,6 @@
* @library ../../../../java/rmi/testlibrary
*
* @build StreamPipe
- * @build RmicDefault
* @run main RmicDefault
*/
--- a/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/rmic/manifestClassPath/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -114,26 +114,26 @@
Success "$javac" -classpath "jars/A.jar" Main.java MainI.java
Success "$rmic" -classpath "jars/A.jar${PS}." Main
-Success "$java" -classpath "jars/A.jar${PS}." Main
+Success "$java" ${TESTVMOPTS} -classpath "jars/A.jar${PS}." Main
Sys rm -f Main.class MainI.class Main_Stub.class
Success "$javac" -classpath "jars/sub/B.zip" Main.java MainI.java
Success "$rmic" -classpath "jars/sub/B.zip${PS}." Main
-Success "$java" -classpath "jars/sub/B.zip${PS}." Main
+Success "$java" ${TESTVMOPTS} -classpath "jars/sub/B.zip${PS}." Main
#Sys rm -f Main.class MainI.class Main_Stub.class
Sys rm -f Main_Stub.class # javac -extdirs workaround
#Success "$javac" -extdirs "jars" -classpath None Main.java MainI.java
Success "$rmic" -extdirs "jars" -classpath . Main
-Success "$java" -Djava.ext.dirs="jars" -cp . Main
+Success "$java" ${TESTVMOPTS} -Djava.ext.dirs="jars" -cp . Main
Sys rm -f Main_Stub.class
#Success "$javac" -extdirs "jars/sub" -classpath None Main.java MainI.java
Success "$rmic" -extdirs "jars/sub" -classpath . Main
-Success "$java" -Djava.ext.dirs="jars/sub" -cp . Main
+Success "$java" ${TESTVMOPTS} -Djava.ext.dirs="jars/sub" -cp . Main
Cleanup
--- a/jdk/test/sun/rmi/rmic/minimizeWrapperInstances/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/rmic/minimizeWrapperInstances/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -41,13 +41,13 @@
set -ex
${TESTJAVA}/bin/rmic -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
${TESTJAVA}/bin/rmic -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} -vcompat PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
${TESTJAVA}/bin/rmic -Xnew -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
${TESTJAVA}/bin/rmic -Xnew -classpath ${TESTCLASSES:-.} -d ${TESTCLASSES:-.} -vcompat PImpl
-${TESTJAVA}/bin/java -classpath ${TESTCLASSES:-.} Test
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTCLASSES:-.} Test
--- a/jdk/test/sun/rmi/rmic/newrmic/equivalence/run.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/rmic/newrmic/equivalence/run.sh Mon Dec 24 11:46:38 2012 -0800
@@ -26,22 +26,24 @@
# @summary This test verifies that the new implementation of rmic
# generates equivalent classes as the old implementation, for a set
# of sample input classes.
-# @library ../../../../../java/rmi/testlibrary
-# @build TestLibrary
# @author Peter Jones
#
-# @build AgentServerImpl
-# @build AppleImpl
-# @build AppleUserImpl
-# @build ComputeServerImpl
-# @build CountServerImpl
-# @build DayTimeServerImpl
-# @build G1Impl
-# @build MyObjectImpl
-# @build NotActivatableServerImpl
-# @build OrangeEchoImpl
-# @build OrangeImpl
-# @build ServerImpl
+# @library ../../../../../java/rmi/testlibrary
+#
+# @build TestLibrary
+# AgentServerImpl
+# AppleImpl
+# AppleUserImpl
+# ComputeServerImpl
+# CountServerImpl
+# DayTimeServerImpl
+# G1Impl
+# MyObjectImpl
+# NotActivatableServerImpl
+# OrangeEchoImpl
+# OrangeImpl
+# ServerImpl
+#
# @run shell run.sh
if [ "${TESTJAVA}" = "" ]
--- a/jdk/test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/rmic/oldjavacRemoved/sunToolsJavacMain.sh Mon Dec 24 11:46:38 2012 -0800
@@ -37,7 +37,7 @@
set -x
-${TESTJAVA}/bin/java -classpath ${TESTJAVA}/lib/tools.jar sun.tools.javac.Main -d ${TESTCLASSES:-.} ${TESTSRC:-.}/Foo.java
+${TESTJAVA}/bin/java ${TESTVMOPTS} -classpath ${TESTJAVA}/lib/tools.jar sun.tools.javac.Main -d ${TESTCLASSES:-.} ${TESTSRC:-.}/Foo.java
result=$?
if [ $result -eq 0 ]
--- a/jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/runtime/Log/6409194/NoConsoleOutput.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,8 +31,7 @@
* @author Peter Jones
*
* @library ../../../../../java/rmi/testlibrary
- * @build JavaVM
- * @build NoConsoleOutput
+ * @build TestLibrary JavaVM
* @run main/othervm NoConsoleOutput
*/
--- a/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogStreams.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,11 +28,7 @@
* @author Laird Dornin
*
* @library ../../../../../java/rmi/testlibrary
- * @build TestLibrary
- * @build TestParams
- * @build TestFailedException
- * @build CheckLogging
- * @build CheckLogStreams
+ * @build TestLibrary CheckLogging
* @run main/othervm -Dsun.rmi.log.useOld=true CheckLogStreams
*/
--- a/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/runtime/Log/checkLogging/CheckLogging.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,9 +29,6 @@
*
* @library ../../../../../java/rmi/testlibrary
* @build TestLibrary
- * @build TestParams
- * @build TestFailedException
- * @build CheckLogging
* @run main/othervm CheckLogging
*/
--- a/jdk/test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/server/MarshalOutputStream/marshalForeignStub/MarshalForeignStub.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,11 +31,7 @@
* @author Ann Wollrath
*
* @library ../../../../../java/rmi/testlibrary
- * @build TestLibrary
- * @build TestFailedException
- * @build MarshalForeignStub
- * @build Receiver
- * @build MarshalForeignStub_Stub
+ * @build TestLibrary Receiver MarshalForeignStub_Stub
* @run main/othervm/policy=security.policy MarshalForeignStub
*/
--- a/jdk/test/sun/rmi/transport/proxy/EagerHttpFallback.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/transport/proxy/EagerHttpFallback.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,7 @@
* @bug 4290727
* @summary Verify that ConnectException will trigger HTTP fallback if
* sun.rmi.transport.proxy.eagerHttpFallback system property is set.
+ *
* @library ../../../../java/rmi/testlibrary
* @build TestLibrary
* @run main/othervm EagerHttpFallback
--- a/jdk/test/sun/rmi/transport/tcp/DeadCachedConnection.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/transport/tcp/DeadCachedConnection.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,9 +25,7 @@
* @bug 4094891
* @summary unable to retry call if cached connection to server is used
* @library ../../../../java/rmi/testlibrary
- * @build DeadCachedConnection
- * @build JavaVM
- * @build TestLibrary
+ * @build TestLibrary JavaVM
* @run main/othervm DeadCachedConnection
*/
--- a/jdk/test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,11 +27,8 @@
* @summary RMI blocks in HttpAwareServerSocket.accept() if you telnet to it
* @author Adrian Colley
*
- * @library ../../../../../java/rmi/testlibrary/
- * @build TestIface
- * @build TestImpl
- * @build TestImpl_Stub
- * @build BlockAcceptTest
+ * @library ../../../../../java/rmi/testlibrary
+ * @build TestIface TestImpl TestImpl_Stub
* @run main/othervm/policy=security.policy/timeout=60 BlockAcceptTest
*/
--- a/jdk/test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/rmi/transport/tcp/disableMultiplexing/DisableMultiplexing.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,7 +28,6 @@
* on that port, rather than engage in the deprecated "multiplexing protocol".
* @author Peter Jones
*
- * @build DisableMultiplexing
* @build DisableMultiplexing_Stub
* @run main/othervm DisableMultiplexing
*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/sun/security/krb5/auto/KeyPermissions.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8004488
+ * @summary wrong permissions checked in krb5
+ * @compile -XDignore.symbol.file KeyPermissions.java
+ * @run main/othervm KeyPermissions
+ */
+
+import java.security.AccessControlException;
+import java.security.Permission;
+import javax.security.auth.PrivateCredentialPermission;
+import sun.security.jgss.GSSUtil;
+
+public class KeyPermissions extends SecurityManager {
+
+ @Override
+ public void checkPermission(Permission perm) {
+ if (perm instanceof PrivateCredentialPermission) {
+ if (!perm.getName().startsWith("javax.security.auth.kerberos.")) {
+ throw new AccessControlException(
+ "I don't like this", perm);
+ }
+ }
+ }
+
+ public static void main(String[] args) throws Exception {
+ System.setSecurityManager(new KeyPermissions());
+ new OneKDC(null).writeJAASConf();
+ Context s = Context.fromJAAS("server");
+ s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
+ }
+}
+
--- a/jdk/test/sun/security/krb5/auto/KeyTabCompat.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/krb5/auto/KeyTabCompat.java Mon Dec 24 11:46:38 2012 -0800
@@ -24,6 +24,7 @@
/*
* @test
* @bug 6894072
+ * @bug 8004488
* @compile -XDignore.symbol.file KeyTabCompat.java
* @run main/othervm KeyTabCompat
* @summary always refresh keytab
@@ -70,21 +71,8 @@
s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID);
s.status();
- if (s.s().getPrivateCredentials(KerberosKey.class).size() != 1) {
- throw new Exception("There should be one KerberosKey");
+ if (s.s().getPrivateCredentials(KerberosKey.class).size() != 0) {
+ throw new Exception("There should be no KerberosKey");
}
-
- Thread.sleep(2000); // make sure ktab timestamp is different
-
- kdc.addPrincipal(OneKDC.SERVER, "pass2".toCharArray());
- kdc.writeKtab(OneKDC.KTAB);
-
- Context.handshake(c, s);
- s.status();
-
- if (s.s().getPrivateCredentials(KerberosKey.class).size() != 1) {
- throw new Exception("There should be only one KerberosKey");
- }
-
}
}
--- a/jdk/test/sun/security/krb5/runNameEquals.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/krb5/runNameEquals.sh Mon Dec 24 11:46:38 2012 -0800
@@ -81,7 +81,7 @@
if [ "${NATIVE}" = "true" ] ; then
echo "Testing native provider"
- ${TESTJAVA}${FILESEP}bin${FILESEP}java \
+ ${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES} \
-Dsun.security.jgss.native=true \
${TEST}
@@ -92,7 +92,7 @@
fi
echo "Testing java provider"
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES} \
-Djava.security.krb5.realm=R \
-Djava.security.krb5.kdc=127.0.0.1 \
--- a/jdk/test/sun/security/krb5/tools/ktcheck.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/krb5/tools/ktcheck.sh Mon Dec 24 11:46:38 2012 -0800
@@ -58,7 +58,7 @@
EXTRA_OPTIONS="-Djava.security.krb5.conf=${TESTSRC}${FS}onlythree.conf"
KTAB="${TESTJAVA}${FS}bin${FS}ktab -J${EXTRA_OPTIONS} -k $KEYTAB -f"
-CHECK="${TESTJAVA}${FS}bin${FS}java ${EXTRA_OPTIONS} KtabCheck $KEYTAB"
+CHECK="${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ${EXTRA_OPTIONS} KtabCheck $KEYTAB"
echo ${EXTRA_OPTIONS}
--- a/jdk/test/sun/security/mscapi/AccessKeyStore.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/AccessKeyStore.sh Mon Dec 24 11:46:38 2012 -0800
@@ -42,13 +42,13 @@
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\AccessKeyStore.java
echo "Using access.policy..."
- ${TESTJAVA}/bin/java \
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} \
-Djava.security.manager \
-Djava.security.policy==${TESTSRC}\\access.policy \
AccessKeyStore
echo "Using noaccess.policy..."
- ${TESTJAVA}/bin/java \
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} \
-Djava.security.manager \
-Djava.security.policy==${TESTSRC}\\noaccess.policy \
AccessKeyStore -deny
--- a/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/IsSunMSCAPIAvailable.sh Mon Dec 24 11:46:38 2012 -0800
@@ -40,7 +40,7 @@
# execute test program - rely on it to exit if platform unsupported
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\IsSunMSCAPIAvailable.java
- ${TESTJAVA}/bin/java IsSunMSCAPIAvailable
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} IsSunMSCAPIAvailable
exit
;;
--- a/jdk/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/KeyStoreCompatibilityMode.sh Mon Dec 24 11:46:38 2012 -0800
@@ -43,15 +43,15 @@
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\KeyStoreCompatibilityMode.java
# mode implicitly enabled
- ${TESTJAVA}/bin/java KeyStoreCompatibilityMode
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} KeyStoreCompatibilityMode
# mode explicitly enabled
- ${TESTJAVA}/bin/java \
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} \
-Dsun.security.mscapi.keyStoreCompatibilityMode="true" \
KeyStoreCompatibilityMode
# mode explicitly disabled
- ${TESTJAVA}/bin/java \
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} \
-Dsun.security.mscapi.keyStoreCompatibilityMode="false" \
KeyStoreCompatibilityMode -disable
--- a/jdk/test/sun/security/mscapi/PublicKeyInterop.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/PublicKeyInterop.sh Mon Dec 24 11:46:38 2012 -0800
@@ -62,7 +62,7 @@
echo
echo "Running the test..."
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\PublicKeyInterop.java
- ${TESTJAVA}/bin/java PublicKeyInterop
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} PublicKeyInterop
rc=$?
--- a/jdk/test/sun/security/mscapi/RSAEncryptDecrypt.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/RSAEncryptDecrypt.sh Mon Dec 24 11:46:38 2012 -0800
@@ -70,7 +70,7 @@
# unsupported
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\RSAEncryptDecrypt.java
- ${TESTJAVA}/bin/java RSAEncryptDecrypt
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} RSAEncryptDecrypt
exit
;;
--- a/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/ShortRSAKey1024.sh Mon Dec 24 11:46:38 2012 -0800
@@ -89,7 +89,7 @@
echo "Running the test..."
${TESTJAVA}${FS}bin${FS}javac -d . \
${TESTSRC}${FS}ShortRSAKeyWithinTLS.java
- ${TESTJAVA}${FS}bin${FS}java ShortRSAKeyWithinTLS 7106773.$BITS $BITS \
+ ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} ShortRSAKeyWithinTLS 7106773.$BITS $BITS \
TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA
rc=$?
--- a/jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/SignUsingNONEwithRSA.sh Mon Dec 24 11:46:38 2012 -0800
@@ -61,7 +61,7 @@
echo
echo "Running the test..."
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingNONEwithRSA.java
- ${TESTJAVA}/bin/java SignUsingNONEwithRSA
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} SignUsingNONEwithRSA
rc=$?
--- a/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/mscapi/SignUsingSHA2withRSA.sh Mon Dec 24 11:46:38 2012 -0800
@@ -61,7 +61,7 @@
echo
echo "Running the test..."
${TESTJAVA}/bin/javac -d . ${TESTSRC}\\SignUsingSHA2withRSA.java
- ${TESTJAVA}/bin/java SignUsingSHA2withRSA
+ ${TESTJAVA}/bin/java ${TESTVMOPTS} SignUsingSHA2withRSA
rc=$?
--- a/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/KeyStore/Basic.sh Mon Dec 24 11:46:38 2012 -0800
@@ -171,7 +171,7 @@
# run test
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
-DDIR=${TESTSRC}${FS}BasicData \
-DCUSTOM_DB_DIR=${TESTCLASSES} \
--- a/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/KeyStore/ClientAuth.sh Mon Dec 24 11:46:38 2012 -0800
@@ -128,7 +128,7 @@
# run test
echo "Run ClientAuth ..."
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
-DCUSTOM_DB_DIR=${TESTCLASSES} \
@@ -149,7 +149,7 @@
# run test with specified TLS protocol and cipher suite
echo "Run ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA"
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
-DDIR=${TESTSRC}${FS}ClientAuthData${FS} \
-DCUSTOM_DB_DIR=${TESTCLASSES} \
--- a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.sh Mon Dec 24 11:46:38 2012 -0800
@@ -141,7 +141,7 @@
# run test
cd ${TESTSRC}
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-DDIR=${TESTSRC}${FS}BasicData${FS} \
-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
-DCUSTOM_DB_DIR=${TESTCLASSES} \
--- a/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/KeyStore/Solaris.sh Mon Dec 24 11:46:38 2012 -0800
@@ -142,7 +142,7 @@
# run test
cd ${TESTSRC}
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES}${PS}${TESTSRC}${FS}loader.jar \
-DDIR=${TESTSRC}${FS}BasicData${FS} \
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}BasicData${FS}p11-solaris.txt \
--- a/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/Provider/ConfigQuotedString.sh Mon Dec 24 11:46:38 2012 -0800
@@ -99,7 +99,7 @@
# run test
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES} \
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ConfigQuotedString-nss.txt \
-Dtest.src=${TESTSRC} \
--- a/jdk/test/sun/security/pkcs11/Provider/Login.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/Provider/Login.sh Mon Dec 24 11:46:38 2012 -0800
@@ -108,7 +108,7 @@
# run test
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath ${TESTCLASSES} \
-DCUSTOM_DB_DIR=${TESTCLASSES} \
-DCUSTOM_P11_CONFIG=${TESTSRC}${FS}Login-nss.txt \
--- a/jdk/test/sun/security/pkcs11/ec/TestECDSA.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/pkcs11/ec/TestECDSA.java Mon Dec 24 11:46:38 2012 -0800
@@ -179,7 +179,6 @@
// SHA1withECDSA and NONEwithECDSA
Signature s = Signature.getInstance("SHA1withECDSA", provider);
s.initSign(privateKey);
- s.initSign(privateKey);
s.update(data);
byte[] s1 = s.sign();
--- a/jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.sh Mon Dec 24 11:46:38 2012 -0800
@@ -82,7 +82,7 @@
${TESTJAVA}${FILESEP}jre${FILESEP}lib${FILESEP}security${FILESEP}tmp_pol
# run the test program
-${TESTJAVA}${FILESEP}bin${FILESEP}java -Djava.security.manager \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} -Djava.security.manager \
GrantAllPermToExtWhenNoPolicy
# save error status
--- a/jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/provider/PolicyFile/getinstance/getinstance.sh Mon Dec 24 11:46:38 2012 -0800
@@ -92,7 +92,7 @@
${TESTJAVA}${FS}bin${FS}javac -d ${TESTCLASSES}${FS}app \
${TESTSRC}${FS}GetInstance.java
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-Xbootclasspath/a:"${TESTCLASSES}${FS}boot" \
-classpath "${TESTCLASSES}${FS}app" -Djava.security.manager \
-Djava.security.policy=GetInstance.policy \
@@ -106,7 +106,7 @@
echo "Failed on first test"
fi
-${TESTJAVA}${FS}bin${FS}java \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \
-classpath "${TESTCLASSES}${FS}boot${PS}${TESTCLASSES}${FS}app" \
-Djava.security.manager \
-Djava.security.policy=GetInstance.policy \
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/EngineArgs/DebugReportsOneExtraByte.sh Mon Dec 24 11:46:38 2012 -0800
@@ -59,7 +59,7 @@
echo "${STRING}"
echo "========="
-${TESTJAVA}${FS}bin${FS}java -Djavax.net.debug=all \
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Djavax.net.debug=all \
-Dtest.src=${TESTSRC} \
DebugReportsOneExtraByte 2>&1 | \
grep "${STRING}"
--- a/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NotifyHandshakeTest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -82,7 +82,7 @@
# This is the only thing we really care about as far as
# test status goes.
#
-${TESTJAVA}${FILESEP}bin${FILESEP}java \
+${TESTJAVA}${FILESEP}bin${FILESEP}java ${TESTVMOPTS} \
-Dtest.src=${TESTSRC} \
-classpath "com.jar${PATHSEP}edu.jar" \
-Djava.security.manager \
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxy.sh Mon Dec 24 11:46:38 2012 -0800
@@ -52,5 +52,5 @@
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}OriginServer.java \
${TESTSRC}${FS}ProxyTunnelServer.java ${TESTSRC}${FS}PostThruProxy.java
-${TESTJAVA}${FS}bin${FS}java PostThruProxy ${HOSTNAME} ${TESTSRC}
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} PostThruProxy ${HOSTNAME} ${TESTSRC}
exit
--- a/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/ssl/sun/net/www/protocol/https/HttpsURLConnection/PostThruProxyWithAuth.sh Mon Dec 24 11:46:38 2012 -0800
@@ -53,5 +53,5 @@
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}OriginServer.java \
${TESTSRC}${FS}ProxyTunnelServer.java \
${TESTSRC}${FS}PostThruProxyWithAuth.java
-${TESTJAVA}${FS}bin${FS}java PostThruProxyWithAuth ${HOSTNAME} ${TESTSRC}
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} PostThruProxyWithAuth ${HOSTNAME} ${TESTSRC}
exit
--- a/jdk/test/sun/security/tools/jarsigner/emptymanifest.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/tools/jarsigner/emptymanifest.sh Mon Dec 24 11:46:38 2012 -0800
@@ -65,7 +65,7 @@
}
EOF
$JAVAC CrLf.java
-$JAVA CrLf > META-INF${FS}MANIFEST.MF
+$JAVA ${TESTVMOPTS} CrLf > META-INF${FS}MANIFEST.MF
zip $JFILE META-INF${FS}MANIFEST.MF A B
$KT -alias a -dname CN=a -keyalg rsa -genkey -validity 300
--- a/jdk/test/sun/security/tools/jarsigner/ts.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/tools/jarsigner/ts.sh Mon Dec 24 11:46:38 2012 -0800
@@ -87,5 +87,5 @@
$KT -alias tsbad3 -importcert
$JAVAC -d . ${TESTSRC}/TimestampCheck.java
-$JAVA TimestampCheck
+$JAVA ${TESTVMOPTS} TimestampCheck
--- a/jdk/test/sun/security/tools/keytool/printssl.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/tools/keytool/printssl.sh Mon Dec 24 11:46:38 2012 -0800
@@ -53,7 +53,7 @@
esac
${TESTJAVA}${FS}bin${FS}javac -d . ${TESTSRC}${FS}PrintSSL.java || exit 10
-${TESTJAVA}${FS}bin${FS}java -Dtest.src=$TESTSRC PrintSSL | ( read PORT; ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT )
+${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dtest.src=$TESTSRC PrintSSL | ( read PORT; ${TESTJAVA}${FS}bin${FS}keytool -printcert -sslserver localhost:$PORT )
status=$?
rm PrintSSL*.class
--- a/jdk/test/sun/security/tools/keytool/standard.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/tools/keytool/standard.sh Mon Dec 24 11:46:38 2012 -0800
@@ -58,7 +58,7 @@
${TESTJAVA}${FS}bin${FS}javac -d . -XDignore.symbol.file ${TESTSRC}${FS}KeyToolTest.java || exit 10
-echo | ${TESTJAVA}${FS}bin${FS}java -Dfile KeyToolTest
+echo | ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} -Dfile KeyToolTest
status=$?
rm HumanInputStream*.class
--- a/jdk/test/sun/security/validator/certreplace.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/validator/certreplace.sh Mon Dec 24 11:46:38 2012 -0800
@@ -82,4 +82,4 @@
# 5. Build and run test
$JAVAC -d . ${TESTSRC}${FS}CertReplace.java
-$JAVA CertReplace certreplace.jks certreplace.certs
+$JAVA ${TESTVMOPTS} CertReplace certreplace.jks certreplace.certs
--- a/jdk/test/sun/security/validator/samedn.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/security/validator/samedn.sh Mon Dec 24 11:46:38 2012 -0800
@@ -78,5 +78,5 @@
# Check both, one of them might be dropped out of map in old codes.
$JAVAC -d . ${TESTSRC}${FS}CertReplace.java
-$JAVA CertReplace samedn.jks samedn1.certs || exit 1
-$JAVA CertReplace samedn.jks samedn2.certs || exit 2
+$JAVA ${TESTVMOPTS} CertReplace samedn.jks samedn1.certs || exit 1
+$JAVA ${TESTVMOPTS} CertReplace samedn.jks samedn2.certs || exit 2
--- a/jdk/test/sun/text/resources/LocaleData Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/text/resources/LocaleData Mon Dec 24 11:46:38 2012 -0800
@@ -7074,3 +7074,586 @@
# bug 7189611
CurrencyNames/es_VE/VEF=Bs.F.
+
+# rfe 8000983 (narrow names support)
+FormatData//DayNarrows/0=S
+FormatData//DayNarrows/1=M
+FormatData//DayNarrows/2=T
+FormatData//DayNarrows/3=W
+FormatData//DayNarrows/4=T
+FormatData//DayNarrows/5=F
+FormatData//DayNarrows/6=S
+FormatData//narrow.AmPmMarkers/0=a
+FormatData//narrow.AmPmMarkers/1=p
+FormatData//narrow.Eras/0=B
+FormatData//narrow.Eras/1=A
+FormatData//buddhist.narrow.Eras/0=BC
+FormatData//buddhist.narrow.Eras/1=B.E.
+FormatData//japanese.narrow.Eras/0=
+FormatData//japanese.narrow.Eras/1=M
+FormatData//japanese.narrow.Eras/2=T
+FormatData//japanese.narrow.Eras/3=S
+FormatData//japanese.narrow.Eras/4=H
+
+FormatData/ar/DayNarrows/0=\u062d
+FormatData/ar/DayNarrows/1=\u0646
+FormatData/ar/DayNarrows/2=\u062b
+FormatData/ar/DayNarrows/3=\u0631
+FormatData/ar/DayNarrows/4=\u062e
+FormatData/ar/DayNarrows/5=\u062c
+FormatData/ar/DayNarrows/6=\u0633
+
+FormatData/be/standalone.MonthNarrows/0=\u0441
+FormatData/be/standalone.MonthNarrows/1=\u043b
+FormatData/be/standalone.MonthNarrows/2=\u0441
+FormatData/be/standalone.MonthNarrows/3=\u043a
+FormatData/be/standalone.MonthNarrows/4=\u043c
+FormatData/be/standalone.MonthNarrows/5=\u0447
+FormatData/be/standalone.MonthNarrows/6=\u043b
+FormatData/be/standalone.MonthNarrows/7=\u0436
+FormatData/be/standalone.MonthNarrows/8=\u0432
+FormatData/be/standalone.MonthNarrows/9=\u043a
+FormatData/be/standalone.MonthNarrows/10=\u043b
+FormatData/be/standalone.MonthNarrows/11=\u0441
+FormatData/be/standalone.MonthNarrows/12=
+FormatData/be/DayNarrows/0=\u043d
+FormatData/be/DayNarrows/1=\u043f
+FormatData/be/DayNarrows/2=\u0430
+FormatData/be/DayNarrows/3=\u0441
+FormatData/be/DayNarrows/4=\u0447
+FormatData/be/DayNarrows/5=\u043f
+FormatData/be/DayNarrows/6=\u0441
+
+FormatData/bg/DayNarrows/0=\u043d
+FormatData/bg/DayNarrows/1=\u043f
+FormatData/bg/DayNarrows/2=\u0432
+FormatData/bg/DayNarrows/3=\u0441
+FormatData/bg/DayNarrows/4=\u0447
+FormatData/bg/DayNarrows/5=\u043f
+FormatData/bg/DayNarrows/6=\u0441
+
+FormatData/ca/standalone.MonthNarrows/0=g
+FormatData/ca/standalone.MonthNarrows/1=f
+FormatData/ca/standalone.MonthNarrows/2=m
+FormatData/ca/standalone.MonthNarrows/3=a
+FormatData/ca/standalone.MonthNarrows/4=m
+FormatData/ca/standalone.MonthNarrows/5=j
+FormatData/ca/standalone.MonthNarrows/6=j
+FormatData/ca/standalone.MonthNarrows/7=a
+FormatData/ca/standalone.MonthNarrows/8=s
+FormatData/ca/standalone.MonthNarrows/9=o
+FormatData/ca/standalone.MonthNarrows/10=n
+FormatData/ca/standalone.MonthNarrows/11=d
+FormatData/ca/standalone.MonthNarrows/12=
+FormatData/ca/DayNarrows/0=G
+# Note: "L" is a contribued item in CLDR
+FormatData/ca/DayNarrows/1=L
+FormatData/ca/DayNarrows/2=T
+FormatData/ca/DayNarrows/3=C
+FormatData/ca/DayNarrows/4=J
+FormatData/ca/DayNarrows/5=V
+FormatData/ca/DayNarrows/6=S
+FormatData/ca/standalone.DayNarrows/0=g
+FormatData/ca/standalone.DayNarrows/1=l
+FormatData/ca/standalone.DayNarrows/2=t
+FormatData/ca/standalone.DayNarrows/3=c
+FormatData/ca/standalone.DayNarrows/4=j
+FormatData/ca/standalone.DayNarrows/5=v
+FormatData/ca/standalone.DayNarrows/6=s
+
+FormatData/cs/DayNarrows/0=N
+FormatData/cs/DayNarrows/1=P
+FormatData/cs/DayNarrows/2=\u00da
+FormatData/cs/DayNarrows/3=S
+FormatData/cs/DayNarrows/4=\u010c
+FormatData/cs/DayNarrows/5=P
+FormatData/cs/DayNarrows/6=S
+
+FormatData/da/DayNarrows/0=S
+FormatData/da/DayNarrows/1=M
+FormatData/da/DayNarrows/2=T
+FormatData/da/DayNarrows/3=O
+FormatData/da/DayNarrows/4=T
+FormatData/da/DayNarrows/5=F
+FormatData/da/DayNarrows/6=L
+
+FormatData/de/DayNarrows/0=S
+FormatData/de/DayNarrows/1=M
+FormatData/de/DayNarrows/2=D
+FormatData/de/DayNarrows/3=M
+FormatData/de/DayNarrows/4=D
+FormatData/de/DayNarrows/5=F
+FormatData/de/DayNarrows/6=S
+
+FormatData/el/DayNarrows/0=\u039a
+FormatData/el/DayNarrows/1=\u0394
+FormatData/el/DayNarrows/2=\u03a4
+FormatData/el/DayNarrows/3=\u03a4
+FormatData/el/DayNarrows/4=\u03a0
+FormatData/el/DayNarrows/5=\u03a0
+FormatData/el/DayNarrows/6=\u03a3
+
+FormatData/es/DayNarrows/0=D
+FormatData/es/DayNarrows/1=L
+FormatData/es/DayNarrows/2=M
+FormatData/es/DayNarrows/3=X
+FormatData/es/DayNarrows/4=J
+FormatData/es/DayNarrows/5=V
+FormatData/es/DayNarrows/6=S
+
+FormatData/et/DayNarrows/0=P
+FormatData/et/DayNarrows/1=E
+FormatData/et/DayNarrows/2=T
+FormatData/et/DayNarrows/3=K
+FormatData/et/DayNarrows/4=N
+FormatData/et/DayNarrows/5=R
+FormatData/et/DayNarrows/6=L
+
+FormatData/fi/standalone.MonthNarrows/0=T
+FormatData/fi/standalone.MonthNarrows/1=H
+FormatData/fi/standalone.MonthNarrows/2=M
+FormatData/fi/standalone.MonthNarrows/3=H
+FormatData/fi/standalone.MonthNarrows/4=T
+FormatData/fi/standalone.MonthNarrows/5=K
+FormatData/fi/standalone.MonthNarrows/6=H
+FormatData/fi/standalone.MonthNarrows/7=E
+FormatData/fi/standalone.MonthNarrows/8=S
+FormatData/fi/standalone.MonthNarrows/9=L
+FormatData/fi/standalone.MonthNarrows/10=M
+FormatData/fi/standalone.MonthNarrows/11=J
+FormatData/fi/standalone.MonthNarrows/12=
+FormatData/fi/DayNarrows/0=S
+FormatData/fi/DayNarrows/1=M
+FormatData/fi/DayNarrows/2=T
+FormatData/fi/DayNarrows/3=K
+FormatData/fi/DayNarrows/4=T
+FormatData/fi/DayNarrows/5=P
+FormatData/fi/DayNarrows/6=L
+FormatData/fi/standalone.DayNarrows/0=S
+FormatData/fi/standalone.DayNarrows/1=M
+FormatData/fi/standalone.DayNarrows/2=T
+FormatData/fi/standalone.DayNarrows/3=K
+FormatData/fi/standalone.DayNarrows/4=T
+FormatData/fi/standalone.DayNarrows/5=P
+FormatData/fi/standalone.DayNarrows/6=L
+FormatData/fi/narrow.AmPmMarkers/0=ap.
+FormatData/fi/narrow.AmPmMarkers/1=ip.
+
+FormatData/fr/DayNarrows/0=D
+FormatData/fr/DayNarrows/1=L
+FormatData/fr/DayNarrows/2=M
+FormatData/fr/DayNarrows/3=M
+FormatData/fr/DayNarrows/4=J
+FormatData/fr/DayNarrows/5=V
+FormatData/fr/DayNarrows/6=S
+
+FormatData/hi_IN/DayNarrows/0=\u0930
+FormatData/hi_IN/DayNarrows/1=\u0938\u094b
+FormatData/hi_IN/DayNarrows/2=\u092e\u0902
+FormatData/hi_IN/DayNarrows/3=\u092c\u0941
+FormatData/hi_IN/DayNarrows/4=\u0917\u0941
+FormatData/hi_IN/DayNarrows/5=\u0936\u0941
+FormatData/hi_IN/DayNarrows/6=\u0936
+
+FormatData/hr/standalone.MonthNarrows/0=1.
+FormatData/hr/standalone.MonthNarrows/1=2.
+FormatData/hr/standalone.MonthNarrows/2=3.
+FormatData/hr/standalone.MonthNarrows/3=4.
+FormatData/hr/standalone.MonthNarrows/4=5.
+FormatData/hr/standalone.MonthNarrows/5=6.
+FormatData/hr/standalone.MonthNarrows/6=7.
+FormatData/hr/standalone.MonthNarrows/7=8.
+FormatData/hr/standalone.MonthNarrows/8=9.
+FormatData/hr/standalone.MonthNarrows/9=10.
+FormatData/hr/standalone.MonthNarrows/10=11.
+FormatData/hr/standalone.MonthNarrows/11=12.
+FormatData/hr/standalone.MonthNarrows/12=
+FormatData/hr/DayNarrows/0=N
+FormatData/hr/DayNarrows/1=P
+FormatData/hr/DayNarrows/2=U
+FormatData/hr/DayNarrows/3=S
+FormatData/hr/DayNarrows/4=\u010c
+FormatData/hr/DayNarrows/5=P
+FormatData/hr/DayNarrows/6=S
+FormatData/hr/standalone.DayNarrows/0=n
+FormatData/hr/standalone.DayNarrows/1=p
+FormatData/hr/standalone.DayNarrows/2=u
+FormatData/hr/standalone.DayNarrows/3=s
+FormatData/hr/standalone.DayNarrows/4=\u010d
+FormatData/hr/standalone.DayNarrows/5=p
+FormatData/hr/standalone.DayNarrows/6=s
+
+FormatData/hu/DayNarrows/0=V
+FormatData/hu/DayNarrows/1=H
+FormatData/hu/DayNarrows/2=K
+FormatData/hu/DayNarrows/3=Sz
+FormatData/hu/DayNarrows/4=Cs
+FormatData/hu/DayNarrows/5=P
+FormatData/hu/DayNarrows/6=Sz
+
+FormatData/is/standalone.MonthNarrows/0=j
+FormatData/is/standalone.MonthNarrows/1=f
+FormatData/is/standalone.MonthNarrows/2=m
+FormatData/is/standalone.MonthNarrows/3=a
+FormatData/is/standalone.MonthNarrows/4=m
+FormatData/is/standalone.MonthNarrows/5=j
+FormatData/is/standalone.MonthNarrows/6=j
+FormatData/is/standalone.MonthNarrows/7=\u00e1
+FormatData/is/standalone.MonthNarrows/8=s
+FormatData/is/standalone.MonthNarrows/9=o
+FormatData/is/standalone.MonthNarrows/10=n
+FormatData/is/standalone.MonthNarrows/11=d
+FormatData/is/standalone.MonthNarrows/12=
+FormatData/is/DayNarrows/0=S
+FormatData/is/DayNarrows/1=M
+FormatData/is/DayNarrows/2=\u00de
+FormatData/is/DayNarrows/3=M
+FormatData/is/DayNarrows/4=F
+FormatData/is/DayNarrows/5=F
+FormatData/is/DayNarrows/6=L
+FormatData/is/standalone.DayNarrows/0=s
+FormatData/is/standalone.DayNarrows/1=m
+FormatData/is/standalone.DayNarrows/2=\u00fe
+FormatData/is/standalone.DayNarrows/3=m
+FormatData/is/standalone.DayNarrows/4=f
+FormatData/is/standalone.DayNarrows/5=f
+FormatData/is/standalone.DayNarrows/6=l
+
+FormatData/it/DayNarrows/0=D
+FormatData/it/DayNarrows/1=L
+FormatData/it/DayNarrows/2=M
+FormatData/it/DayNarrows/3=M
+FormatData/it/DayNarrows/4=G
+FormatData/it/DayNarrows/5=V
+FormatData/it/DayNarrows/6=S
+
+FormatData/iw/DayNarrows/0=\u05d0
+FormatData/iw/DayNarrows/1=\u05d1
+FormatData/iw/DayNarrows/2=\u05d2
+FormatData/iw/DayNarrows/3=\u05d3
+FormatData/iw/DayNarrows/4=\u05d4
+FormatData/iw/DayNarrows/5=\u05d5
+FormatData/iw/DayNarrows/6=\u05e9
+FormatData/iw/standalone.DayNarrows/0=\u05d0
+FormatData/iw/standalone.DayNarrows/1=\u05d1
+FormatData/iw/standalone.DayNarrows/2=\u05d2
+FormatData/iw/standalone.DayNarrows/3=\u05d3
+FormatData/iw/standalone.DayNarrows/4=\u05d4
+FormatData/iw/standalone.DayNarrows/5=\u05d5
+FormatData/iw/standalone.DayNarrows/6=\u05e9
+
+FormatData/ja/DayNarrows/0=\u65e5
+FormatData/ja/DayNarrows/1=\u6708
+FormatData/ja/DayNarrows/2=\u706b
+FormatData/ja/DayNarrows/3=\u6c34
+FormatData/ja/DayNarrows/4=\u6728
+FormatData/ja/DayNarrows/5=\u91d1
+FormatData/ja/DayNarrows/6=\u571f
+
+FormatData/ko/DayNarrows/0=\uc77c
+FormatData/ko/DayNarrows/1=\uc6d4
+FormatData/ko/DayNarrows/2=\ud654
+FormatData/ko/DayNarrows/3=\uc218
+FormatData/ko/DayNarrows/4=\ubaa9
+FormatData/ko/DayNarrows/5=\uae08
+FormatData/ko/DayNarrows/6=\ud1a0
+
+FormatData/lt/standalone.MonthNarrows/0=S
+FormatData/lt/standalone.MonthNarrows/1=V
+FormatData/lt/standalone.MonthNarrows/2=K
+FormatData/lt/standalone.MonthNarrows/3=B
+FormatData/lt/standalone.MonthNarrows/4=G
+FormatData/lt/standalone.MonthNarrows/5=B
+FormatData/lt/standalone.MonthNarrows/6=L
+FormatData/lt/standalone.MonthNarrows/7=R
+FormatData/lt/standalone.MonthNarrows/8=R
+FormatData/lt/standalone.MonthNarrows/9=S
+FormatData/lt/standalone.MonthNarrows/10=L
+FormatData/lt/standalone.MonthNarrows/11=G
+FormatData/lt/standalone.MonthNarrows/12=
+
+FormatData/lt/DayNarrows/0=S
+FormatData/lt/DayNarrows/1=P
+FormatData/lt/DayNarrows/2=A
+FormatData/lt/DayNarrows/3=T
+FormatData/lt/DayNarrows/4=K
+FormatData/lt/DayNarrows/5=P
+FormatData/lt/DayNarrows/6=\u0160
+FormatData/lt/standalone.DayNarrows/0=S
+FormatData/lt/standalone.DayNarrows/1=P
+FormatData/lt/standalone.DayNarrows/2=A
+FormatData/lt/standalone.DayNarrows/3=T
+FormatData/lt/standalone.DayNarrows/4=K
+FormatData/lt/standalone.DayNarrows/5=P
+FormatData/lt/standalone.DayNarrows/6=\u0160
+
+FormatData/lv/DayNarrows/0=S
+FormatData/lv/DayNarrows/1=P
+FormatData/lv/DayNarrows/2=O
+FormatData/lv/DayNarrows/3=T
+FormatData/lv/DayNarrows/4=C
+FormatData/lv/DayNarrows/5=P
+FormatData/lv/DayNarrows/6=S
+
+FormatData/mk/DayNarrows/0=\u043d
+FormatData/mk/DayNarrows/1=\u043f
+FormatData/mk/DayNarrows/2=\u0432
+FormatData/mk/DayNarrows/3=\u0441
+FormatData/mk/DayNarrows/4=\u0447
+FormatData/mk/DayNarrows/5=\u043f
+FormatData/mk/DayNarrows/6=\u0441
+
+FormatData/ms/standalone.MonthNarrows/0=J
+FormatData/ms/standalone.MonthNarrows/1=F
+FormatData/ms/standalone.MonthNarrows/2=M
+FormatData/ms/standalone.MonthNarrows/3=A
+FormatData/ms/standalone.MonthNarrows/4=M
+FormatData/ms/standalone.MonthNarrows/5=J
+FormatData/ms/standalone.MonthNarrows/6=J
+FormatData/ms/standalone.MonthNarrows/7=O
+FormatData/ms/standalone.MonthNarrows/8=S
+FormatData/ms/standalone.MonthNarrows/9=O
+FormatData/ms/standalone.MonthNarrows/10=N
+FormatData/ms/standalone.MonthNarrows/11=D
+FormatData/ms/standalone.MonthNarrows/12=
+FormatData/ms/DayNarrows/0=A
+FormatData/ms/DayNarrows/1=I
+FormatData/ms/DayNarrows/2=S
+FormatData/ms/DayNarrows/3=R
+FormatData/ms/DayNarrows/4=K
+FormatData/ms/DayNarrows/5=J
+FormatData/ms/DayNarrows/6=S
+FormatData/ms/standalone.DayNarrows/0=A
+FormatData/ms/standalone.DayNarrows/1=I
+FormatData/ms/standalone.DayNarrows/2=S
+FormatData/ms/standalone.DayNarrows/3=R
+FormatData/ms/standalone.DayNarrows/4=K
+FormatData/ms/standalone.DayNarrows/5=J
+FormatData/ms/standalone.DayNarrows/6=S
+
+FormatData/mt/DayNarrows/0=\u0126
+FormatData/mt/DayNarrows/1=T
+FormatData/mt/DayNarrows/2=T
+FormatData/mt/DayNarrows/3=E
+FormatData/mt/DayNarrows/4=\u0126
+FormatData/mt/DayNarrows/5=\u0120
+FormatData/mt/DayNarrows/6=S
+
+FormatData/nl/DayNarrows/0=Z
+FormatData/nl/DayNarrows/1=M
+FormatData/nl/DayNarrows/2=D
+FormatData/nl/DayNarrows/3=W
+FormatData/nl/DayNarrows/4=D
+FormatData/nl/DayNarrows/5=V
+FormatData/nl/DayNarrows/6=Z
+
+FormatData/pl/DayNarrows/0=N
+FormatData/pl/DayNarrows/1=P
+FormatData/pl/DayNarrows/2=W
+FormatData/pl/DayNarrows/3=\u015a
+FormatData/pl/DayNarrows/4=C
+FormatData/pl/DayNarrows/5=P
+FormatData/pl/DayNarrows/6=S
+
+FormatData/pt/DayNarrows/0=D
+FormatData/pt/DayNarrows/1=S
+FormatData/pt/DayNarrows/2=T
+FormatData/pt/DayNarrows/3=Q
+FormatData/pt/DayNarrows/4=Q
+FormatData/pt/DayNarrows/5=S
+FormatData/pt/DayNarrows/6=S
+
+FormatData/ro/standalone.MonthNarrows/0=I
+FormatData/ro/standalone.MonthNarrows/1=F
+FormatData/ro/standalone.MonthNarrows/2=M
+FormatData/ro/standalone.MonthNarrows/3=A
+FormatData/ro/standalone.MonthNarrows/4=M
+FormatData/ro/standalone.MonthNarrows/5=I
+FormatData/ro/standalone.MonthNarrows/6=I
+FormatData/ro/standalone.MonthNarrows/7=A
+FormatData/ro/standalone.MonthNarrows/8=S
+FormatData/ro/standalone.MonthNarrows/9=O
+FormatData/ro/standalone.MonthNarrows/10=N
+FormatData/ro/standalone.MonthNarrows/11=D
+FormatData/ro/standalone.MonthNarrows/12=
+# commented out DayNarrows due to mostly undefined
+#FormatData/ro/DayNarrows/0=D
+#FormatData/ro/DayNarrows/1=
+#FormatData/ro/DayNarrows/2=
+#FormatData/ro/DayNarrows/3=
+#FormatData/ro/DayNarrows/4=
+#FormatData/ro/DayNarrows/5=
+#FormatData/ro/DayNarrows/6=
+FormatData/ro/standalone.DayNarrows/0=D
+FormatData/ro/standalone.DayNarrows/1=L
+FormatData/ro/standalone.DayNarrows/2=M
+FormatData/ro/standalone.DayNarrows/3=M
+FormatData/ro/standalone.DayNarrows/4=J
+FormatData/ro/standalone.DayNarrows/5=V
+FormatData/ro/standalone.DayNarrows/6=S
+
+FormatData/ru/DayNarrows/0=\u0412
+FormatData/ru/DayNarrows/1=\u041f\u043d
+FormatData/ru/DayNarrows/2=\u0412\u0442
+FormatData/ru/DayNarrows/3=\u0421
+FormatData/ru/DayNarrows/4=\u0427
+FormatData/ru/DayNarrows/5=\u041f
+# Note: "sat" is an contributed item in CLDR.
+FormatData/ru/DayNarrows/6=\u0421
+
+FormatData/ru/standalone.DayNarrows/0=\u0412
+FormatData/ru/standalone.DayNarrows/1=\u041f
+FormatData/ru/standalone.DayNarrows/2=\u0412
+FormatData/ru/standalone.DayNarrows/3=\u0421
+FormatData/ru/standalone.DayNarrows/4=\u0427
+FormatData/ru/standalone.DayNarrows/5=\u041f
+FormatData/ru/standalone.DayNarrows/6=\u0421
+
+FormatData/sk/DayNarrows/0=N
+FormatData/sk/DayNarrows/1=P
+FormatData/sk/DayNarrows/2=U
+FormatData/sk/DayNarrows/3=S
+FormatData/sk/DayNarrows/4=\u0160
+FormatData/sk/DayNarrows/5=P
+FormatData/sk/DayNarrows/6=S
+
+FormatData/sl/DayNarrows/0=n
+FormatData/sl/DayNarrows/1=p
+FormatData/sl/DayNarrows/2=t
+FormatData/sl/DayNarrows/3=s
+FormatData/sl/DayNarrows/4=\u010d
+FormatData/sl/DayNarrows/5=p
+FormatData/sl/DayNarrows/6=s
+
+FormatData/sq/DayNarrows/0=D
+FormatData/sq/DayNarrows/1=H
+FormatData/sq/DayNarrows/2=M
+FormatData/sq/DayNarrows/3=M
+FormatData/sq/DayNarrows/4=E
+FormatData/sq/DayNarrows/5=P
+FormatData/sq/DayNarrows/6=S
+
+FormatData/sr/DayNarrows/0=\u043d
+FormatData/sr/DayNarrows/1=\u043f
+FormatData/sr/DayNarrows/2=\u0443
+FormatData/sr/DayNarrows/3=\u0441
+FormatData/sr/DayNarrows/4=\u0447
+FormatData/sr/DayNarrows/5=\u043f
+FormatData/sr/DayNarrows/6=\u0441
+FormatData/sr/short.Eras/0=\u043f. \u043d. \u0435.
+FormatData/sr/short.Eras/1=\u043d. \u0435.
+FormatData/sr/narrow.Eras/0=\u043f.\u043d.\u0435.
+FormatData/sr/narrow.Eras/1=\u043d.\u0435.
+
+FormatData/sv/standalone.MonthNarrows/0=J
+FormatData/sv/standalone.MonthNarrows/1=F
+FormatData/sv/standalone.MonthNarrows/2=M
+FormatData/sv/standalone.MonthNarrows/3=A
+FormatData/sv/standalone.MonthNarrows/4=M
+FormatData/sv/standalone.MonthNarrows/5=J
+FormatData/sv/standalone.MonthNarrows/6=J
+FormatData/sv/standalone.MonthNarrows/7=A
+FormatData/sv/standalone.MonthNarrows/8=S
+FormatData/sv/standalone.MonthNarrows/9=O
+FormatData/sv/standalone.MonthNarrows/10=N
+FormatData/sv/standalone.MonthNarrows/11=D
+FormatData/sv/standalone.MonthNarrows/12=
+FormatData/sv/DayNarrows/0=S
+FormatData/sv/DayNarrows/1=M
+FormatData/sv/DayNarrows/2=T
+FormatData/sv/DayNarrows/3=O
+FormatData/sv/DayNarrows/4=T
+FormatData/sv/DayNarrows/5=F
+FormatData/sv/DayNarrows/6=L
+FormatData/sv/standalone.DayNarrows/0=S
+FormatData/sv/standalone.DayNarrows/1=M
+FormatData/sv/standalone.DayNarrows/2=T
+FormatData/sv/standalone.DayNarrows/3=O
+FormatData/sv/standalone.DayNarrows/4=T
+FormatData/sv/standalone.DayNarrows/5=F
+FormatData/sv/standalone.DayNarrows/6=L
+FormatData/sv/narrow.Eras/0=f.Kr.
+FormatData/sv/narrow.Eras/1=e.Kr.
+FormatData/sv/narrow.AmPmMarkers/0=f
+FormatData/sv/narrow.AmPmMarkers/1=e
+
+FormatData/th/standalone.MonthNarrows/0=\u0e21.\u0e04.
+FormatData/th/standalone.MonthNarrows/1=\u0e01.\u0e1e.
+FormatData/th/standalone.MonthNarrows/2=\u0e21\u0e35.\u0e04.
+FormatData/th/standalone.MonthNarrows/3=\u0e40\u0e21.\u0e22.
+FormatData/th/standalone.MonthNarrows/4=\u0e1e.\u0e04.
+FormatData/th/standalone.MonthNarrows/5=\u0e21\u0e34.\u0e22.
+FormatData/th/standalone.MonthNarrows/6=\u0e01.\u0e04.
+FormatData/th/standalone.MonthNarrows/7=\u0e2a.\u0e04.
+FormatData/th/standalone.MonthNarrows/8=\u0e01.\u0e22.
+FormatData/th/standalone.MonthNarrows/9=\u0e15.\u0e04.
+FormatData/th/standalone.MonthNarrows/10=\u0e1e.\u0e22.
+FormatData/th/standalone.MonthNarrows/11=\u0e18.\u0e04.
+FormatData/th/standalone.MonthNarrows/12=
+FormatData/th/DayNarrows/0=\u0e2d
+FormatData/th/DayNarrows/1=\u0e08
+FormatData/th/DayNarrows/2=\u0e2d
+FormatData/th/DayNarrows/3=\u0e1e
+FormatData/th/DayNarrows/4=\u0e1e
+FormatData/th/DayNarrows/5=\u0e28
+FormatData/th/DayNarrows/6=\u0e2a
+FormatData/th/narrow.Eras/0=\u0e01\u0e48\u0e2d\u0e19 \u0e04.\u0e28.
+FormatData/th/narrow.Eras/1=\u0e04.\u0e28.
+
+FormatData/tr/standalone.MonthNarrows/0=O
+FormatData/tr/standalone.MonthNarrows/1=\u015e
+FormatData/tr/standalone.MonthNarrows/2=M
+FormatData/tr/standalone.MonthNarrows/3=N
+FormatData/tr/standalone.MonthNarrows/4=M
+FormatData/tr/standalone.MonthNarrows/5=H
+FormatData/tr/standalone.MonthNarrows/6=T
+FormatData/tr/standalone.MonthNarrows/7=A
+FormatData/tr/standalone.MonthNarrows/8=E
+FormatData/tr/standalone.MonthNarrows/9=E
+FormatData/tr/standalone.MonthNarrows/10=K
+FormatData/tr/standalone.MonthNarrows/11=A
+FormatData/tr/standalone.MonthNarrows/12=
+FormatData/tr/DayNarrows/0=P
+FormatData/tr/DayNarrows/1=P
+FormatData/tr/DayNarrows/2=S
+FormatData/tr/DayNarrows/3=\u00c7
+FormatData/tr/DayNarrows/4=P
+FormatData/tr/DayNarrows/5=C
+FormatData/tr/DayNarrows/6=C
+
+FormatData/uk/DayNarrows/0=\u041d
+FormatData/uk/DayNarrows/1=\u041f
+FormatData/uk/DayNarrows/2=\u0412
+FormatData/uk/DayNarrows/3=\u0421
+FormatData/uk/DayNarrows/4=\u0427
+FormatData/uk/DayNarrows/5=\u041f
+FormatData/uk/DayNarrows/6=\u0421
+
+FormatData/vi/DayNarrows/0=CN
+FormatData/vi/DayNarrows/1=T2
+FormatData/vi/DayNarrows/2=T3
+FormatData/vi/DayNarrows/3=T4
+FormatData/vi/DayNarrows/4=T5
+FormatData/vi/DayNarrows/5=T6
+FormatData/vi/DayNarrows/6=T7
+
+FormatData/zh/standalone.MonthNarrows/0=1\u6708
+FormatData/zh/standalone.MonthNarrows/1=2\u6708
+FormatData/zh/standalone.MonthNarrows/2=3\u6708
+FormatData/zh/standalone.MonthNarrows/3=4\u6708
+FormatData/zh/standalone.MonthNarrows/4=5\u6708
+FormatData/zh/standalone.MonthNarrows/5=6\u6708
+FormatData/zh/standalone.MonthNarrows/6=7\u6708
+FormatData/zh/standalone.MonthNarrows/7=8\u6708
+FormatData/zh/standalone.MonthNarrows/8=9\u6708
+FormatData/zh/standalone.MonthNarrows/9=10\u6708
+FormatData/zh/standalone.MonthNarrows/10=11\u6708
+FormatData/zh/standalone.MonthNarrows/11=12\u6708
+FormatData/zh/standalone.MonthNarrows/12=
+FormatData/zh/DayNarrows/0=\u65e5
+FormatData/zh/DayNarrows/1=\u4e00
+FormatData/zh/DayNarrows/2=\u4e8c
+FormatData/zh/DayNarrows/3=\u4e09
+FormatData/zh/DayNarrows/4=\u56db
+FormatData/zh/DayNarrows/5=\u4e94
+FormatData/zh/DayNarrows/6=\u516d
--- a/jdk/test/sun/text/resources/LocaleDataTest.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/sun/text/resources/LocaleDataTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -34,7 +34,7 @@
* 6509039 6609737 6610748 6645271 6507067 6873931 6450945 6645268 6646611
* 6645405 6650730 6910489 6573250 6870908 6585666 6716626 6914413 6916787
* 6919624 6998391 7019267 7020960 7025837 7020583 7036905 7066203 7101495
- * 7003124 7085757 7028073 7171028 7189611
+ * 7003124 7085757 7028073 7171028 7189611 8000983
* @summary Verify locale data
*
*/
--- a/jdk/test/tools/launcher/6842838/Test6842838.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/tools/launcher/6842838/Test6842838.sh Mon Dec 24 11:46:38 2012 -0800
@@ -68,8 +68,8 @@
fi
BADFILE=newbadjar.jar
-${JAVA_EXE} -version
-${JAVA_EXE} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
+${JAVA_EXE} ${TESTVMOPTS} -version
+${JAVA_EXE} ${TESTVMOPTS} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
LD_PRELOAD=${LIBUMEM} ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
grep "Invalid or corrupt jarfile" test.out
--- a/jdk/test/tools/launcher/Arrrghs.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/tools/launcher/Arrrghs.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,7 +27,7 @@
* 6894719 6968053 7151434 7146424
* @summary Argument parsing validation.
* @compile -XDignore.symbol.file Arrrghs.java
- * @run main Arrrghs
+ * @run main/othervm Arrrghs
*/
import java.io.BufferedReader;
@@ -204,8 +204,7 @@
// exiting the process prematurely can terminate the stderr.
scratchpad.add(javaCmd + " -version " + inArgs);
File batFile = new File("atest.bat");
- java.nio.file.Files.deleteIfExists(batFile.toPath());
- createFile(batFile, scratchpad);
+ createAFile(batFile, scratchpad);
TestResult tr = doExec(batFile.getName());
--- a/jdk/test/tools/launcher/MultipleJRE.sh Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/tools/launcher/MultipleJRE.sh Mon Dec 24 11:46:38 2012 -0800
@@ -49,8 +49,8 @@
exit 1
fi
-JAVAEXE="$TESTJAVA/bin/java"
-JAVA="$TESTJAVA/bin/java -classpath $TESTCLASSES"
+JAVAEXE="$TESTJAVA/bin/java ${TESTVMOPTS}"
+JAVA="$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES"
JAR="$TESTJAVA/bin/jar"
OS=`uname -s`;
--- a/jdk/test/tools/launcher/TestHelper.java Thu Dec 20 10:22:19 2012 +0100
+++ b/jdk/test/tools/launcher/TestHelper.java Mon Dec 24 11:46:38 2012 -0800
@@ -358,6 +358,51 @@
Files.copy(src.toPath(), dst.toPath(), COPY_ATTRIBUTES, REPLACE_EXISTING);
}
+ /**
+ * Attempt to create a file at the given location. If an IOException
+ * occurs then back off for a moment and try again. When a number of
+ * attempts fail, give up and throw an exception.
+ */
+ void createAFile(File aFile, List<String> contents) throws IOException {
+ IOException cause = null;
+ for (int attempts = 0; attempts < 10; attempts++) {
+ try {
+ Files.write(aFile.getAbsoluteFile().toPath(), contents,
+ Charset.defaultCharset(), CREATE, TRUNCATE_EXISTING, WRITE);
+ if (cause != null) {
+ /*
+ * report attempts and errors that were encountered
+ * for diagnostic purposes
+ */
+ System.err.println("Created batch file " +
+ aFile + " in " + (attempts + 1) +
+ " attempts");
+ System.err.println("Errors encountered: " + cause);
+ cause.printStackTrace();
+ }
+ return;
+ } catch (IOException ioe) {
+ if (cause != null) {
+ // chain the exceptions so they all get reported for diagnostics
+ cause.addSuppressed(ioe);
+ } else {
+ cause = ioe;
+ }
+ }
+
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException ie) {
+ if (cause != null) {
+ // cause should alway be non-null here
+ ie.addSuppressed(cause);
+ }
+ throw new RuntimeException("Interrupted while creating batch file", ie);
+ }
+ }
+ throw new RuntimeException("Unable to create batch file", cause);
+ }
+
static void createFile(File outFile, List<String> content) throws IOException {
Files.write(outFile.getAbsoluteFile().toPath(), content,
Charset.defaultCharset(), CREATE_NEW);
--- a/langtools/.hgtags Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/.hgtags Mon Dec 24 11:46:38 2012 -0800
@@ -189,3 +189,4 @@
5f2faba89cac665e365c05074064ffc934a495eb jdk8-b65
20230f8b0eef92a57043735fc2ca00fea7e510a0 jdk8-b66
303b09787a69136cd2019f9edfed3f308572e9fc jdk8-b67
+014a6a11dfe5ddc23ec8c76bb42ac998dbf49acb jdk8-b68
--- a/langtools/src/share/classes/com/sun/tools/classfile/Opcode.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/classfile/Opcode.java Mon Dec 24 11:46:38 2012 -0800
@@ -448,10 +448,10 @@
}
- private static Opcode[] stdOpcodes = new Opcode[256];
- private static Opcode[] wideOpcodes = new Opcode[256];
- private static Opcode[] nonPrivOpcodes = new Opcode[256];
- private static Opcode[] privOpcodes = new Opcode[256];
+ private static final Opcode[] stdOpcodes = new Opcode[256];
+ private static final Opcode[] wideOpcodes = new Opcode[256];
+ private static final Opcode[] nonPrivOpcodes = new Opcode[256];
+ private static final Opcode[] privOpcodes = new Opcode[256];
static {
for (Opcode o: values())
getOpcodeBlock(o.opcode >> 8)[o.opcode & 0xff] = o;
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFileFactory.java Mon Dec 24 11:46:38 2012 -0800
@@ -46,7 +46,7 @@
* @since 1.8
*/
abstract class DocFileFactory {
- private static Map<Configuration, DocFileFactory> factories =
+ private static final Map<Configuration, DocFileFactory> factories =
new WeakHashMap<Configuration, DocFileFactory>();
/**
--- a/langtools/src/share/classes/com/sun/tools/javac/Server.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/Server.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -49,7 +49,7 @@
private final OutputStream out;
private final boolean isSocket;
private static final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
- private static Logger logger = Logger.getLogger("com.sun.tools.javac");
+ private static final Logger logger = Logger.getLogger("com.sun.tools.javac");
static class CwdFileManager extends ForwardingJavaFileManager<JavaFileManager> {
String cwd;
CwdFileManager(JavaFileManager fileManager) {
@@ -69,7 +69,7 @@
// }
}
// static CwdFileManager fm = new CwdFileManager(tool.getStandardFileManager());
- static StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
+ static final StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
static {
// Use the same file manager for all compilations. This will
// cache jar files in the standard file manager. Use
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Annotations.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Annotations.java Mon Dec 24 11:46:38 2012 -0800
@@ -74,12 +74,12 @@
*/
private List<Attribute.Compound> attributes = NOT_STARTED;
/*
- * The Symbol this Annotatios belong to
+ * The Symbol this Annotations belong to
*/
- private final Symbol s;
+ private final Symbol sym;
- public Annotations(Symbol s) {
- this.s = s;
+ public Annotations(Symbol sym) {
+ this.sym = sym;
}
public List<Attribute.Compound> getAttributes() {
@@ -102,7 +102,7 @@
}
public void setAttributesWithCompletion(final Annotate.AnnotateRepeatedContext ctx) {
- Assert.check(pendingCompletion() || (!isStarted() && s.kind == PCK));
+ Assert.check(pendingCompletion() || (!isStarted() && sym.kind == PCK));
Map<Symbol.TypeSymbol, ListBuffer<Attribute.Compound>> annotated = ctx.annotated;
boolean atLeastOneRepeated = false;
@@ -111,7 +111,7 @@
if (lb.size() == 1) {
buf = buf.prepend(lb.first());
} else { // repeated
- buf = buf.prepend(new Placeholder(lb.toList(), s));
+ buf = buf.prepend(new Placeholder(lb.toList(), sym));
atLeastOneRepeated = true;
}
}
@@ -141,7 +141,7 @@
@Override
public String toString() {
- return "repeated annotation pass of: " + s + " in: " + s.owner;
+ return "repeated annotation pass of: " + sym + " in: " + sym.owner;
}
@Override
@@ -253,7 +253,7 @@
// Process repeated annotations
Attribute.Compound validRepeated =
- ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor());
+ ctx.processRepeatedAnnotations(placeholder.getPlaceholderFor(), sym);
if (validRepeated != null) {
// Check that the container isn't manually
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java Mon Dec 24 11:46:38 2012 -0800
@@ -307,7 +307,7 @@
}
// Cache of modifier sets.
- private static Map<Long, Set<Modifier>> modifierSets =
+ private static final Map<Long, Set<Modifier>> modifierSets =
new java.util.concurrent.ConcurrentHashMap<Long, Set<Modifier>>(64);
public static boolean isStatic(Symbol symbol) {
@@ -356,7 +356,7 @@
VARARGS("varargs"),
PACKAGE("package");
- String name;
+ private final String name;
Flag(String name) {
this.name = name;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java Mon Dec 24 11:46:38 2012 -0800
@@ -110,7 +110,7 @@
INSTANCE_INIT("kindname.instance.init"),
PACKAGE("kindname.package");
- private String name;
+ private final String name;
KindName(String name) {
this.name = name;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,11 +28,14 @@
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
+import javax.lang.model.element.Modifier;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Options;
import com.sun.tools.javac.util.Pair;
+
import static com.sun.tools.javac.code.Flags.*;
@@ -95,7 +98,8 @@
private final EnumSet<LintCategory> values;
private final EnumSet<LintCategory> suppressedValues;
- private static Map<String, LintCategory> map = new HashMap<String,LintCategory>();
+ private static final Map<String, LintCategory> map =
+ new java.util.concurrent.ConcurrentHashMap<String, LintCategory>(20);
protected Lint(Context context) {
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java Mon Dec 24 11:46:38 2012 -0800
@@ -87,7 +87,7 @@
public final String name;
- private static Map<String,Source> tab = new HashMap<String,Source>();
+ private static final Map<String,Source> tab = new HashMap<String,Source>();
static {
for (Source s : values()) {
tab.put(s.name, s);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java Mon Dec 24 11:46:38 2012 -0800
@@ -166,7 +166,7 @@
static final int MAXIMUM_TARGET_TYPE_VALUE = 0x22;
private final int targetTypeValue;
- private Set<TargetAttribute> flags;
+ private final Set<TargetAttribute> flags;
TargetType(int targetTypeValue, TargetAttribute... attributes) {
if (targetTypeValue < Byte.MIN_VALUE
@@ -233,10 +233,10 @@
return this.targetTypeValue;
}
- private static TargetType[] targets = null;
+ private static final TargetType[] targets;
- private static TargetType[] buildTargets() {
- TargetType[] targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1];
+ static {
+ targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1];
TargetType[] alltargets = values();
for (TargetType target : alltargets) {
if (target.targetTypeValue >= 0)
@@ -246,13 +246,9 @@
if (targets[i] == null)
targets[i] = UNKNOWN;
}
- return targets;
}
public static boolean isValidTargetTypeValue(int tag) {
- if (targets == null)
- targets = buildTargets();
-
if (((byte)tag) == ((byte)UNKNOWN.targetTypeValue))
return true;
@@ -260,9 +256,6 @@
}
public static TargetType fromTargetTypeValue(int tag) {
- if (targets == null)
- targets = buildTargets();
-
if (((byte)tag) == ((byte)UNKNOWN.targetTypeValue))
return UNKNOWN;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java Mon Dec 24 11:46:38 2012 -0800
@@ -135,9 +135,11 @@
/** This field will only be used for tags related with numeric types for
* optimization reasons.
*/
- private int order = 0;
+ private final int order;
- private TypeTag() {}
+ private TypeTag() {
+ this(0);
+ }
private TypeTag(int order) {
this.order = order;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java Mon Dec 24 11:46:38 2012 -0800
@@ -2849,7 +2849,7 @@
}
return tvars1;
}
- static private Mapping newInstanceFun = new Mapping("newInstanceFun") {
+ private static final Mapping newInstanceFun = new Mapping("newInstanceFun") {
public Type apply(Type t) { return new TypeVar(t.tsym, t.getUpperBound(), t.getLowerBound()); }
};
// </editor-fold>
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java Mon Dec 24 11:46:38 2012 -0800
@@ -26,7 +26,6 @@
package com.sun.tools.javac.comp;
import java.util.Map;
-
import com.sun.tools.javac.util.*;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.code.*;
@@ -171,8 +170,8 @@
* @param repeatingAnnotations a List of repeating annotations
* @return a new Attribute.Compound that is the container for the repeatingAnnotations
*/
- public Attribute.Compound processRepeatedAnnotations(List<Attribute.Compound> repeatingAnnotations) {
- return Annotate.this.processRepeatedAnnotations(repeatingAnnotations, this);
+ public Attribute.Compound processRepeatedAnnotations(List<Attribute.Compound> repeatingAnnotations, Symbol sym) {
+ return Annotate.this.processRepeatedAnnotations(repeatingAnnotations, this, sym);
}
/**
@@ -339,10 +338,11 @@
* annotation are invalid. This method reports errors/warnings.
*/
private Attribute.Compound processRepeatedAnnotations(List<Attribute.Compound> annotations,
- AnnotateRepeatedContext ctx) {
+ AnnotateRepeatedContext ctx,
+ Symbol on) {
Attribute.Compound firstOccurrence = annotations.head;
List<Attribute> repeated = List.nil();
- Type origAnnoType;
+ Type origAnnoType = null;
Type arrayOfOrigAnnoType = null;
Type targetContainerType = null;
MethodSymbol containerValueSymbol = null;
@@ -390,6 +390,13 @@
new Attribute.Array(arrayOfOrigAnnoType, repeated));
annoTree = m.Annotation(new Attribute.Compound(targetContainerType,
List.of(p)));
+
+ if (!chk.annotationApplicable(annoTree, on))
+ log.error(annoTree.pos(), "invalid.containedby.annotation.incompatible.target", targetContainerType, origAnnoType);
+
+ if (!chk.validateAnnotationDeferErrors(annoTree))
+ log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType);
+
Attribute.Compound c = enterAnnotation(annoTree,
targetContainerType,
ctx.env);
@@ -410,7 +417,7 @@
// annotation's declaration, or null if it has none
Attribute.Compound ca = origAnnoDecl.attribute(syms.containedByType.tsym);
if (ca == null) { // has no ContainedBy annotation
- log.error(pos, "duplicate.annotation.missing.container", origAnnoType);
+ log.error(pos, "duplicate.annotation.missing.container", origAnnoType, syms.containedByType);
return null;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java Mon Dec 24 11:46:38 2012 -0800
@@ -1833,13 +1833,15 @@
for (Scope.Entry e1 = t1.tsym.members().elems; e1 != null; e1 = e1.sibling) {
Symbol s1 = e1.sym;
Type st1 = null;
- if (s1.kind != MTH || !s1.isInheritedIn(site.tsym, types)) continue;
+ if (s1.kind != MTH || !s1.isInheritedIn(site.tsym, types) ||
+ (s1.flags() & SYNTHETIC) != 0) continue;
Symbol impl = ((MethodSymbol)s1).implementation(site.tsym, types, false);
if (impl != null && (impl.flags() & ABSTRACT) == 0) continue;
for (Scope.Entry e2 = t2.tsym.members().lookup(s1.name); e2.scope != null; e2 = e2.next()) {
Symbol s2 = e2.sym;
if (s1 == s2) continue;
- if (s2.kind != MTH || !s2.isInheritedIn(site.tsym, types)) continue;
+ if (s2.kind != MTH || !s2.isInheritedIn(site.tsym, types) ||
+ (s2.flags() & SYNTHETIC) != 0) continue;
if (st1 == null) st1 = types.memberType(t1, s1);
Type st2 = types.memberType(t2, s2);
if (types.overrideEquivalent(st1, st2)) {
@@ -2890,39 +2892,54 @@
}
/** Check an annotation value.
+ *
+ * @param a The annotation tree to check
+ * @return true if this annotation tree is valid, otherwise false
*/
- public void validateAnnotation(JCAnnotation a) {
- // collect an inventory of the members (sorted alphabetically)
- Set<MethodSymbol> members = new TreeSet<MethodSymbol>(new Comparator<Symbol>() {
- public int compare(Symbol t, Symbol t1) {
- return t.name.compareTo(t1.name);
- }
- });
+ public boolean validateAnnotationDeferErrors(JCAnnotation a) {
+ boolean res = false;
+ final Log.DiagnosticHandler diagHandler = new Log.DiscardDiagnosticHandler(log);
+ try {
+ res = validateAnnotation(a);
+ } finally {
+ log.popDiagnosticHandler(diagHandler);
+ }
+ return res;
+ }
+
+ private boolean validateAnnotation(JCAnnotation a) {
+ boolean isValid = true;
+ // collect an inventory of the annotation elements
+ Set<MethodSymbol> members = new LinkedHashSet<MethodSymbol>();
for (Scope.Entry e = a.annotationType.type.tsym.members().elems;
e != null;
e = e.sibling)
if (e.sym.kind == MTH)
members.add((MethodSymbol) e.sym);
- // count them off as they're annotated
+ // remove the ones that are assigned values
for (JCTree arg : a.args) {
if (!arg.hasTag(ASSIGN)) continue; // recovery
JCAssign assign = (JCAssign) arg;
Symbol m = TreeInfo.symbol(assign.lhs);
if (m == null || m.type.isErroneous()) continue;
- if (!members.remove(m))
+ if (!members.remove(m)) {
+ isValid = false;
log.error(assign.lhs.pos(), "duplicate.annotation.member.value",
m.name, a.type);
+ }
}
// all the remaining ones better have default values
- ListBuffer<Name> missingDefaults = ListBuffer.lb();
+ List<Name> missingDefaults = List.nil();
for (MethodSymbol m : members) {
if (m.defaultValue == null && !m.type.isErroneous()) {
- missingDefaults.append(m.name);
+ missingDefaults = missingDefaults.append(m.name);
}
}
+ missingDefaults = missingDefaults.reverse();
if (missingDefaults.nonEmpty()) {
+ isValid = false;
String key = (missingDefaults.size() > 1)
? "annotation.missing.default.value.1"
: "annotation.missing.default.value";
@@ -2933,21 +2950,23 @@
// repeated values in its value member
if (a.annotationType.type.tsym != syms.annotationTargetType.tsym ||
a.args.tail == null)
- return;
+ return isValid;
- if (!a.args.head.hasTag(ASSIGN)) return; // error recovery
+ if (!a.args.head.hasTag(ASSIGN)) return false; // error recovery
JCAssign assign = (JCAssign) a.args.head;
Symbol m = TreeInfo.symbol(assign.lhs);
- if (m.name != names.value) return;
+ if (m.name != names.value) return false;
JCTree rhs = assign.rhs;
- if (!rhs.hasTag(NEWARRAY)) return;
+ if (!rhs.hasTag(NEWARRAY)) return false;
JCNewArray na = (JCNewArray) rhs;
Set<Symbol> targets = new HashSet<Symbol>();
for (JCTree elem : na.elems) {
if (!targets.add(TreeInfo.symbol(elem))) {
+ isValid = false;
log.error(elem.pos(), "repeated.annotation.target");
}
}
+ return isValid;
}
void checkDeprecatedAnnotation(DiagnosticPosition pos, Symbol s) {
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java Mon Dec 24 11:46:38 2012 -0800
@@ -62,9 +62,9 @@
syms = Symtab.instance(context);
}
- static Integer minusOne = -1;
- static Integer zero = 0;
- static Integer one = 1;
+ static final Integer minusOne = -1;
+ static final Integer zero = 0;
+ static final Integer one = 1;
/** Convert boolean to integer (true = 1, false = 0).
*/
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java Mon Dec 24 11:46:38 2012 -0800
@@ -246,8 +246,8 @@
*/
SPECULATIVE_LOOP("var.might.be.assigned.in.loop", true);
- String errKey;
- boolean isFinal;
+ final String errKey;
+ final boolean isFinal;
FlowKind(String errKey, boolean isFinal) {
this.errKey = errKey;
@@ -295,7 +295,7 @@
}
};
- JCTree.Tag treeTag;
+ final JCTree.Tag treeTag;
private JumpKind(Tag treeTag) {
this.treeTag = treeTag;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java Mon Dec 24 11:46:38 2012 -0800
@@ -156,7 +156,7 @@
OBJECT_INIT("object-init"),
INTERNAL("internal");
- String opt;
+ final String opt;
private VerboseResolutionMode(String opt) {
this.opt = opt;
@@ -3381,8 +3381,8 @@
}
};
- boolean isBoxingRequired;
- boolean isVarargsRequired;
+ final boolean isBoxingRequired;
+ final boolean isVarargsRequired;
MethodResolutionPhase(boolean isBoxingRequired, boolean isVarargsRequired) {
this.isBoxingRequired = isBoxingRequired;
--- a/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/ZipFileIndex.java Mon Dec 24 11:46:38 2012 -0800
@@ -83,7 +83,7 @@
public final static long NOT_MODIFIED = Long.MIN_VALUE;
- private static boolean NON_BATCH_MODE = System.getProperty("nonBatchMode") != null;// TODO: Use -XD compiler switch for this.
+ private static final boolean NON_BATCH_MODE = System.getProperty("nonBatchMode") != null;// TODO: Use -XD compiler switch for this.
private Map<RelativeDirectory, DirectoryEntry> directories =
Collections.<RelativeDirectory, DirectoryEntry>emptyMap();
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Mon Dec 24 11:46:38 2012 -0800
@@ -1360,6 +1360,16 @@
void attachAnnotationDefault(final Symbol sym) {
final MethodSymbol meth = (MethodSymbol)sym; // only on methods
final Attribute value = readAttributeValue();
+
+ // The default value is set later during annotation. It might
+ // be the case that the Symbol sym is annotated _after_ the
+ // repeating instances that depend on this default value,
+ // because of this we set an interim value that tells us this
+ // element (most likely) has a default.
+ //
+ // Set interim value for now, reset just before we do this
+ // properly at annotate time.
+ meth.defaultValue = value;
annotate.normal(new AnnotationDefaultCompleter(meth, value));
}
@@ -1680,6 +1690,9 @@
public void enterAnnotation() {
JavaFileObject previousClassFile = currentClassFile;
try {
+ // Reset the interim value set earlier in
+ // attachAnnotationDefault().
+ sym.defaultValue = null;
currentClassFile = classFile;
sym.defaultValue = deproxy(sym.type.getReturnType(), value);
} finally {
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java Mon Dec 24 11:46:38 2012 -0800
@@ -1545,10 +1545,10 @@
public void compressCatchTable() {
ListBuffer<char[]> compressedCatchInfo = ListBuffer.lb();
List<Integer> handlerPcs = List.nil();
- for (char[] catchEntry : catchInfo.elems) {
+ for (char[] catchEntry : catchInfo) {
handlerPcs = handlerPcs.prepend((int)catchEntry[2]);
}
- for (char[] catchEntry : catchInfo.elems) {
+ for (char[] catchEntry : catchInfo) {
int startpc = catchEntry[0];
int endpc = catchEntry[1];
if (startpc == endpc ||
@@ -1825,7 +1825,7 @@
}
}
- static Type jsrReturnValue = new Type(INT, null);
+ static final Type jsrReturnValue = new Type(INT, null);
/* **************************************************************************
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java Mon Dec 24 11:46:38 2012 -0800
@@ -86,17 +86,15 @@
return instance;
}
- private static Target MIN;
+ private static final Target MIN = values()[0];
public static Target MIN() { return MIN; }
- private static Target MAX;
+ private static final Target MAX = values()[values().length - 1];
public static Target MAX() { return MAX; }
- private static Map<String,Target> tab = new HashMap<String,Target>();
+ private static final Map<String,Target> tab = new HashMap<String,Target>();
static {
for (Target t : values()) {
- if (MIN == null) MIN = t;
- MAX = t;
tab.put(t.name, t);
}
tab.put("5", JDK1_5);
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java Mon Dec 24 11:46:38 2012 -0800
@@ -189,7 +189,7 @@
}
}
- private static CompilePolicy DEFAULT_COMPILE_POLICY = CompilePolicy.BY_TODO;
+ private static final CompilePolicy DEFAULT_COMPILE_POLICY = CompilePolicy.BY_TODO;
protected static enum ImplicitSourcePolicy {
/** Don't generate or process implicitly read source files. */
@@ -543,7 +543,7 @@
public static CompileState max(CompileState a, CompileState b) {
return a.value > b.value ? a : b;
}
- private int value;
+ private final int value;
};
/** Partial map to record which compiler phases have been executed
* for each compilation unit. Used for ATTR and FLOW phases.
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Option.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Option.java Mon Dec 24 11:46:38 2012 -0800
@@ -167,7 +167,6 @@
ENCODING("-encoding", "opt.arg.encoding", "opt.encoding", STANDARD, FILEMANAGER) {
@Override
public boolean process(OptionHelper helper, String option, String operand) {
-// System.err.println("process encoding " + operand);
return super.process(helper, option, operand);
}
@@ -246,9 +245,7 @@
}
},
- A("-A", "opt.arg.key.equals.value", "opt.A", STANDARD, BASIC) {
- { hasSuffix = true; }
-
+ A("-A", "opt.arg.key.equals.value", "opt.A", STANDARD, BASIC, true) {
@Override
public boolean matches(String arg) {
return arg.startsWith("-A");
@@ -293,8 +290,6 @@
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the launcher.
J("-J", "opt.arg.flag", "opt.J", STANDARD, INFO) {
- { hasSuffix = true; }
-
@Override
public boolean process(OptionHelper helper, String option) {
throw new AssertionError
@@ -302,10 +297,6 @@
}
},
- // stop after parsing and attributing.
- // new HiddenOption("-attrparseonly"),
-
- // new Option("-moreinfo", "opt.moreinfo") {
MOREINFO("-moreinfo", null, HIDDEN, BASIC) {
@Override
public boolean process(OptionHelper helper, String option) {
@@ -317,23 +308,6 @@
// treat warnings as errors
WERROR("-Werror", "opt.Werror", STANDARD, BASIC),
-// // use complex inference from context in the position of a method call argument
-// COMPLEXINFERENCE("-complexinference", null, HIDDEN, BASIC),
-
- // generare source stubs
- // new HiddenOption("-stubs"),
-
- // relax some constraints to allow compiling from stubs
- // new HiddenOption("-relax"),
-
- // output source after translating away inner classes
- // new Option("-printflat", "opt.printflat"),
- // new HiddenOption("-printflat"),
-
- // display scope search details
- // new Option("-printsearch", "opt.printsearch"),
- // new HiddenOption("-printsearch"),
-
// prompt after each error
// new Option("-prompt", "opt.prompt"),
PROMPT("-prompt", null, HIDDEN, BASIC),
@@ -342,13 +316,8 @@
DOE("-doe", null, HIDDEN, BASIC),
// output source after type erasure
- // new Option("-s", "opt.s"),
PRINTSOURCE("-printsource", null, HIDDEN, BASIC),
- // output shrouded class files
- // new Option("-scramble", "opt.scramble"),
- // new Option("-scrambleall", "opt.scrambleall"),
-
// display warnings for generic unchecked operations
WARNUNCHECKED("-warnunchecked", null, HIDDEN, BASIC) {
@Override
@@ -408,18 +377,16 @@
* -XDx sets the option x to the value x.
*/
XD("-XD", null, HIDDEN, BASIC) {
- String s;
@Override
public boolean matches(String s) {
- this.s = s;
return s.startsWith(text);
}
@Override
public boolean process(OptionHelper helper, String option) {
- s = s.substring(text.length());
- int eq = s.indexOf('=');
- String key = (eq < 0) ? s : s.substring(0, eq);
- String value = (eq < 0) ? s : s.substring(eq+1);
+ option = option.substring(text.length());
+ int eq = option.indexOf('=');
+ String key = (eq < 0) ? option : option.substring(0, eq);
+ String value = (eq < 0) ? option : option.substring(eq+1);
helper.put(key, value);
return false;
}
@@ -428,8 +395,6 @@
// This option exists only for the purpose of documenting itself.
// It's actually implemented by the CommandLine class.
AT("@", "opt.arg.file", "opt.AT", STANDARD, INFO) {
- { hasSuffix = true; }
-
@Override
public boolean process(OptionHelper helper, String option) {
throw new AssertionError("the @ flag should be caught by CommandLine.");
@@ -445,17 +410,15 @@
* name to a separate list.
*/
SOURCEFILE("sourcefile", null, HIDDEN, INFO) {
- String s;
@Override
public boolean matches(String s) {
- this.s = s;
return s.endsWith(".java") // Java source file
|| SourceVersion.isName(s); // Legal type name
}
@Override
public boolean process(OptionHelper helper, String option) {
- if (s.endsWith(".java") ) {
- File f = new File(s);
+ if (option.endsWith(".java") ) {
+ File f = new File(option);
if (!f.exists()) {
helper.error("err.file.not.found", f);
return true;
@@ -465,9 +428,9 @@
return true;
}
helper.addFile(f);
+ } else {
+ helper.addClassName(option);
}
- else
- helper.addClassName(s);
return false;
}
};
@@ -521,7 +484,7 @@
/** Suffix option (-foo=bar or -foo:bar)
*/
- boolean hasSuffix;
+ final boolean hasSuffix;
/** The kind of choices for this option, if any.
*/
@@ -535,24 +498,30 @@
Option(String text, String descrKey,
OptionKind kind, OptionGroup group) {
- this(text, null, descrKey, kind, group, null, null);
+ this(text, null, descrKey, kind, group, null, null, false);
}
Option(String text, String argsNameKey, String descrKey,
OptionKind kind, OptionGroup group) {
- this(text, argsNameKey, descrKey, kind, group, null, null);
+ this(text, argsNameKey, descrKey, kind, group, null, null, false);
+ }
+
+ Option(String text, String argsNameKey, String descrKey,
+ OptionKind kind, OptionGroup group, boolean doHasSuffix) {
+ this(text, argsNameKey, descrKey, kind, group, null, null, doHasSuffix);
}
Option(String text, String descrKey,
OptionKind kind, OptionGroup group,
ChoiceKind choiceKind, Map<String,Boolean> choices) {
- this(text, null, descrKey, kind, group, choiceKind, choices);
+ this(text, null, descrKey, kind, group, choiceKind, choices, false);
}
Option(String text, String descrKey,
OptionKind kind, OptionGroup group,
ChoiceKind choiceKind, String... choices) {
- this(text, null, descrKey, kind, group, choiceKind, createChoices(choices));
+ this(text, null, descrKey, kind, group, choiceKind,
+ createChoices(choices), false);
}
// where
private static Map<String,Boolean> createChoices(String... choices) {
@@ -564,7 +533,8 @@
private Option(String text, String argsNameKey, String descrKey,
OptionKind kind, OptionGroup group,
- ChoiceKind choiceKind, Map<String,Boolean> choices) {
+ ChoiceKind choiceKind, Map<String,Boolean> choices,
+ boolean doHasSuffix) {
this.text = text;
this.argsNameKey = argsNameKey;
this.descrKey = descrKey;
@@ -573,7 +543,7 @@
this.choiceKind = choiceKind;
this.choices = choices;
char lastChar = text.charAt(text.length()-1);
- hasSuffix = lastChar == ':' || lastChar == '=';
+ this.hasSuffix = doHasSuffix || lastChar == ':' || lastChar == '=';
}
public String getText() {
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java Mon Dec 24 11:46:38 2012 -0800
@@ -44,7 +44,7 @@
*/
public class JavaTokenizer {
- private static boolean scannerDebug = false;
+ private static final boolean scannerDebug = false;
/** Allow hex floating-point literals.
*/
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Dec 24 11:46:38 2012 -0800
@@ -818,9 +818,7 @@
* | "*" | "/" | "%"
*/
JCExpression term2Rest(JCExpression t, int minprec) {
- List<JCExpression[]> savedOd = odStackSupply.elems;
JCExpression[] odStack = newOdStack();
- List<Token[]> savedOp = opStackSupply.elems;
Token[] opStack = newOpStack();
// optimization, was odStack = new Tree[...]; opStack = new Tree[...];
@@ -851,8 +849,8 @@
}
}
- odStackSupply.elems = savedOd; // optimization
- opStackSupply.elems = savedOp; // optimization
+ odStackSupply.add(odStack);
+ opStackSupply.add(opStack);
return t;
}
//where
@@ -906,23 +904,19 @@
/** optimization: To save allocating a new operand/operator stack
* for every binary operation, we use supplys.
*/
- ListBuffer<JCExpression[]> odStackSupply = new ListBuffer<JCExpression[]>();
- ListBuffer<Token[]> opStackSupply = new ListBuffer<Token[]>();
+ ArrayList<JCExpression[]> odStackSupply = new ArrayList<JCExpression[]>();
+ ArrayList<Token[]> opStackSupply = new ArrayList<Token[]>();
private JCExpression[] newOdStack() {
- if (odStackSupply.elems == odStackSupply.last)
- odStackSupply.append(new JCExpression[infixPrecedenceLevels + 1]);
- JCExpression[] odStack = odStackSupply.elems.head;
- odStackSupply.elems = odStackSupply.elems.tail;
- return odStack;
+ if (odStackSupply.isEmpty())
+ return new JCExpression[infixPrecedenceLevels + 1];
+ return odStackSupply.remove(odStackSupply.size() - 1);
}
private Token[] newOpStack() {
- if (opStackSupply.elems == opStackSupply.last)
- opStackSupply.append(new Token[infixPrecedenceLevels + 1]);
- Token[] opStack = opStackSupply.elems.head;
- opStackSupply.elems = opStackSupply.elems.tail;
- return opStack;
+ if (opStackSupply.isEmpty())
+ return new Token[infixPrecedenceLevels + 1];
+ return opStackSupply.remove(opStackSupply.size() - 1);
}
/**
@@ -2001,7 +1995,7 @@
ListBuffer<JCStatement> stats =
variableDeclarators(mods, t, new ListBuffer<JCStatement>());
// A "LocalVariableDeclarationStatement" subsumes the terminating semicolon
- storeEnd(stats.elems.last(), token.endPos);
+ storeEnd(stats.last(), token.endPos);
accept(SEMI);
return stats.toList();
}
@@ -2042,7 +2036,7 @@
ListBuffer<JCStatement> stats =
variableDeclarators(mods, t, new ListBuffer<JCStatement>());
// A "LocalVariableDeclarationStatement" subsumes the terminating semicolon
- storeEnd(stats.elems.last(), token.endPos);
+ storeEnd(stats.last(), token.endPos);
accept(SEMI);
return stats.toList();
} else {
@@ -2577,7 +2571,7 @@
vdefs.append(variableDeclaratorRest(pos, mods, type, name, reqInit, dc));
while (token.kind == COMMA) {
// All but last of multiple declarators subsume a comma
- storeEnd((JCTree)vdefs.elems.last(), token.endPos);
+ storeEnd((JCTree)vdefs.last(), token.endPos);
nextToken();
vdefs.append(variableDeclarator(mods, type, reqInit, dc));
}
@@ -2632,7 +2626,7 @@
defs.append(resource());
while (token.kind == SEMI) {
// All but last of multiple declarators must subsume a semicolon
- storeEnd(defs.elems.last(), token.endPos);
+ storeEnd(defs.last(), token.endPos);
int semiColonPos = token.pos;
nextToken();
if (token.kind == RPAREN) { // Optional trailing semicolon
@@ -2710,7 +2704,7 @@
JCTree.JCCompilationUnit toplevel = F.at(firstToken.pos).TopLevel(packageAnnotations, pid, defs.toList());
if (!consumedToplevelDoc)
attach(toplevel, firstToken.comment(CommentStyle.JAVADOC));
- if (defs.elems.isEmpty())
+ if (defs.isEmpty())
storeEnd(toplevel, S.prevToken().endPos);
if (keepDocComments)
toplevel.docComments = docComments;
--- a/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java Mon Dec 24 11:46:38 2012 -0800
@@ -1336,7 +1336,7 @@
return nodes;
}
- private static TreeScanner treeCleaner = new TreeScanner() {
+ private static final TreeScanner treeCleaner = new TreeScanner() {
public void scan(JCTree node) {
super.scan(node);
if (node != null)
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties Mon Dec 24 11:46:38 2012 -0800
@@ -307,13 +307,17 @@
compiler.err.duplicate.annotation=\
duplicate annotation
+# 0: type
+compiler.err.duplicate.annotation.invalid.repeated=\
+ annotation {0} cannot be repeated\nIt does not define a valid containing annotation.
+
# 0: name, 1: type
compiler.err.duplicate.annotation.member.value=\
duplicate annotation member value {0} in {1}
-# 0: type
+# 0: type, 1: type
compiler.err.duplicate.annotation.missing.container=\
- duplicate annotation, the declaration of {0} does not have a ContainedBy annotation
+ duplicate annotation, the declaration of {0} does not have a valid {1} annotation
# 0: type, 1: type
compiler.err.invalid.container.no.containedby=\
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java Mon Dec 24 11:46:38 2012 -0800
@@ -340,15 +340,17 @@
*/
LETEXPR; // ala scheme
- private Tag noAssignTag;
+ private final Tag noAssignTag;
- private static int numberOfOperators = MOD.ordinal() - POS.ordinal() + 1;
+ private static final int numberOfOperators = MOD.ordinal() - POS.ordinal() + 1;
private Tag(Tag noAssignTag) {
this.noAssignTag = noAssignTag;
}
- private Tag() { }
+ private Tag() {
+ this(null);
+ }
public static int getNumberOfOperators() {
return numberOfOperators;
@@ -1838,8 +1840,8 @@
/** Toplevel # new */
TOPLEVEL(ReferenceMode.NEW, false);
- ReferenceMode mode;
- boolean unbound;
+ final ReferenceMode mode;
+ final boolean unbound;
private ReferenceKind(ReferenceMode mode, boolean unbound) {
this.mode = mode;
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -181,7 +181,7 @@
return false;
}
// where
- private static Set<Option> javacFileManagerOptions =
+ private static final Set<Option> javacFileManagerOptions =
Option.getJavacFileManagerOptions();
public int isSupportedOption(String option) {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/List.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/List.java Mon Dec 24 11:46:38 2012 -0800
@@ -74,7 +74,7 @@
return (List<A>)EMPTY_LIST;
}
- private static List<?> EMPTY_LIST = new List<Object>(null,null) {
+ private static final List<?> EMPTY_LIST = new List<Object>(null,null) {
public List<Object> setTail(List<Object> tail) {
throw new UnsupportedOperationException();
}
@@ -391,7 +391,7 @@
return (List<T>)list;
}
- private static Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
+ private static final Iterator<?> EMPTYITERATOR = new Iterator<Object>() {
public boolean hasNext() {
return false;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,19 +52,20 @@
/** The list of elements of this buffer.
*/
- public List<A> elems;
+ private List<A> elems;
- /** A pointer pointing to the last, sentinel element of `elems'.
+ /** A pointer pointing to the last element of 'elems' containing data,
+ * or null if the list is empty.
*/
- public List<A> last;
+ private List<A> last;
/** The number of element in this buffer.
*/
- public int count;
+ private int count;
/** Has a list been created from this buffer yet?
*/
- public boolean shared;
+ private boolean shared;
/** Create a new initially empty list buffer.
*/
@@ -73,8 +74,8 @@
}
public final void clear() {
- this.elems = new List<A>(null,null);
- this.last = this.elems;
+ this.elems = List.nil();
+ this.last = null;
count = 0;
shared = false;
}
@@ -103,22 +104,23 @@
/** Copy list and sets last.
*/
private void copy() {
- List<A> p = elems = new List<A>(elems.head, elems.tail);
- while (true) {
- List<A> tail = p.tail;
- if (tail == null) break;
- tail = new List<A>(tail.head, tail.tail);
- p.setTail(tail);
- p = tail;
+ if (elems.nonEmpty()) {
+ List<A> orig = elems;
+
+ elems = last = List.<A>of(orig.head);
+
+ while ((orig = orig.tail).nonEmpty()) {
+ last.tail = List.<A>of(orig.head);
+ last = last.tail;
+ }
}
- last = p;
- shared = false;
}
/** Prepend an element to buffer.
*/
public ListBuffer<A> prepend(A x) {
elems = elems.prepend(x);
+ if (last == null) last = elems;
count++;
return this;
}
@@ -128,9 +130,13 @@
public ListBuffer<A> append(A x) {
x.getClass(); // null check
if (shared) copy();
- last.head = x;
- last.setTail(new List<A>(null,null));
- last = last.tail;
+ List<A> newLast = List.<A>of(x);
+ if (last != null) {
+ last.tail = newLast;
+ last = newLast;
+ } else {
+ elems = last = newLast;
+ }
count++;
return this;
}
@@ -192,8 +198,9 @@
*/
public A next() {
A x = elems.head;
- if (elems != last) {
+ if (!elems.isEmpty()) {
elems = elems.tail;
+ if (elems.isEmpty()) last = null;
count--;
}
return x;
@@ -205,10 +212,10 @@
return new Iterator<A>() {
List<A> elems = ListBuffer.this.elems;
public boolean hasNext() {
- return elems != last;
+ return !elems.isEmpty();
}
public A next() {
- if (elems == last)
+ if (elems.isEmpty())
throw new NoSuchElementException();
A elem = elems.head;
elems = elems.tail;
@@ -263,4 +270,8 @@
public A peek() {
return first();
}
+
+ public A last() {
+ return last != null ? last.head : null;
+ }
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@
DeferredDiagnosticKind(String v) { value = v; }
String getKey(String prefix) { return prefix + value; }
- private String value;
+ private final String value;
}
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java Mon Dec 24 11:46:38 2012 -0800
@@ -249,7 +249,7 @@
INTERSECTION("where.description.intersection");
/** resource key for this where clause kind */
- private String key;
+ private final String key;
WhereClauseKind(String key) {
this.key = key;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,13 +27,13 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Names;
-import com.sun.tools.javac.util.Position;
/**
* Represents an annotation type.
@@ -51,12 +51,11 @@
extends ClassDocImpl implements AnnotationTypeDoc {
public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
- public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym,
- String doc, JCClassDecl tree, Position.LineMap lineMap) {
- super(env, sym, doc, tree, lineMap);
+ public AnnotationTypeDocImpl(DocEnv env, ClassSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,9 +27,9 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.util.Position;
/**
* Represents an element of an annotation type.
@@ -50,9 +50,8 @@
super(env, sym);
}
- public AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym,
- String doc, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, doc, tree, lineMap);
+ public AnnotationTypeElementDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,13 +31,14 @@
import java.net.URI;
import java.util.HashSet;
import java.util.Set;
+
import javax.tools.FileObject;
import javax.tools.JavaFileManager.Location;
import javax.tools.StandardJavaFileManager;
import javax.tools.StandardLocation;
import com.sun.javadoc.*;
-
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Scope;
@@ -45,22 +46,17 @@
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
import com.sun.tools.javac.code.Type.ClassType;
-
import com.sun.tools.javac.comp.AttrContext;
import com.sun.tools.javac.comp.Env;
-
import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
import com.sun.tools.javac.tree.JCTree.JCImport;
import com.sun.tools.javac.tree.TreeInfo;
-
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
import com.sun.tools.javac.util.Name;
import com.sun.tools.javac.util.Names;
import com.sun.tools.javac.util.Position;
-
import static com.sun.tools.javac.code.Kinds.*;
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.tree.JCTree.Tag.*;
@@ -100,15 +96,14 @@
* Constructor
*/
public ClassDocImpl(DocEnv env, ClassSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
/**
* Constructor
*/
- public ClassDocImpl(DocEnv env, ClassSymbol sym, String documentation,
- JCClassDecl tree, Position.LineMap lineMap) {
- super(env, sym, documentation, tree, lineMap);
+ public ClassDocImpl(DocEnv env, ClassSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
this.type = (ClassType)sym.type;
this.tsym = sym;
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ConstructorDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ConstructorDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,10 +27,9 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
import com.sun.tools.javac.code.Symbol.MethodSymbol;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.util.Position;
/**
* Represents a constructor of a java class.
@@ -58,9 +57,8 @@
/**
* constructor.
*/
- public ConstructorDocImpl(DocEnv env, MethodSymbol sym,
- String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, docComment, tree, lineMap);
+ public ConstructorDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,18 +27,20 @@
import java.lang.reflect.Modifier;
import java.util.*;
+
import javax.tools.JavaFileManager;
import com.sun.javadoc.*;
-
+import com.sun.source.util.TreePath;
+import com.sun.tools.javac.api.JavacTrees;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type.ClassType;
import com.sun.tools.javac.comp.Check;
+import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.*;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.Names;
-import com.sun.tools.javac.util.Position;
/**
* Holds the environment for a run of javadoc.
@@ -104,6 +106,8 @@
JavaFileManager fileManager;
Context context;
+ WeakHashMap<JCTree, TreePath> treePaths = new WeakHashMap<JCTree, TreePath>();
+
/** Allow documenting from class files? */
boolean docClasses = false;
@@ -540,13 +544,12 @@
/**
* Create the PackageDoc (or a subtype) for a package symbol.
*/
- void makePackageDoc(PackageSymbol pack, String docComment, JCCompilationUnit tree) {
+ void makePackageDoc(PackageSymbol pack, TreePath treePath) {
PackageDocImpl result = packageMap.get(pack);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new PackageDocImpl(this, pack, docComment, tree);
+ result = new PackageDocImpl(this, pack, treePath);
packageMap.put(pack, result);
}
}
@@ -572,17 +575,16 @@
/**
* Create the ClassDoc (or a subtype) for a class symbol.
*/
- protected void makeClassDoc(ClassSymbol clazz, String docComment, JCClassDecl tree, Position.LineMap lineMap) {
+ protected void makeClassDoc(ClassSymbol clazz, TreePath treePath) {
ClassDocImpl result = classMap.get(clazz);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
return;
}
- if (isAnnotationType(tree)) { // flags of clazz may not yet be set
- result = new AnnotationTypeDocImpl(this, clazz, docComment, tree, lineMap);
+ if (isAnnotationType((JCClassDecl) treePath.getLeaf())) { // flags of clazz may not yet be set
+ result = new AnnotationTypeDocImpl(this, clazz, treePath);
} else {
- result = new ClassDocImpl(this, clazz, docComment, tree, lineMap);
+ result = new ClassDocImpl(this, clazz, treePath);
}
classMap.put(clazz, result);
}
@@ -610,13 +612,12 @@
/**
* Create a FieldDoc for a var symbol.
*/
- protected void makeFieldDoc(VarSymbol var, String docComment, JCVariableDecl tree, Position.LineMap lineMap) {
+ protected void makeFieldDoc(VarSymbol var, TreePath treePath) {
FieldDocImpl result = fieldMap.get(var);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new FieldDocImpl(this, var, docComment, tree, lineMap);
+ result = new FieldDocImpl(this, var, treePath);
fieldMap.put(var, result);
}
}
@@ -627,14 +628,12 @@
* Create a MethodDoc for this MethodSymbol.
* Should be called only on symbols representing methods.
*/
- protected void makeMethodDoc(MethodSymbol meth, String docComment,
- JCMethodDecl tree, Position.LineMap lineMap) {
+ protected void makeMethodDoc(MethodSymbol meth, TreePath treePath) {
MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new MethodDocImpl(this, meth, docComment, tree, lineMap);
+ result = new MethodDocImpl(this, meth, treePath);
methodMap.put(meth, result);
}
}
@@ -656,14 +655,12 @@
* Create the ConstructorDoc for a MethodSymbol.
* Should be called only on symbols representing constructors.
*/
- protected void makeConstructorDoc(MethodSymbol meth, String docComment,
- JCMethodDecl tree, Position.LineMap lineMap) {
+ protected void makeConstructorDoc(MethodSymbol meth, TreePath treePath) {
ConstructorDocImpl result = (ConstructorDocImpl)methodMap.get(meth);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
- result = new ConstructorDocImpl(this, meth, docComment, tree, lineMap);
+ result = new ConstructorDocImpl(this, meth, treePath);
methodMap.put(meth, result);
}
}
@@ -685,16 +682,14 @@
* Create the AnnotationTypeElementDoc for a MethodSymbol.
* Should be called only on symbols representing annotation type elements.
*/
- protected void makeAnnotationTypeElementDoc(MethodSymbol meth,
- String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
+ protected void makeAnnotationTypeElementDoc(MethodSymbol meth, TreePath treePath) {
AnnotationTypeElementDocImpl result =
(AnnotationTypeElementDocImpl)methodMap.get(meth);
if (result != null) {
- if (docComment != null) result.setRawCommentText(docComment);
- if (tree != null) result.setTree(tree);
+ if (treePath != null) result.setTreePath(treePath);
} else {
result =
- new AnnotationTypeElementDocImpl(this, meth, docComment, tree, lineMap);
+ new AnnotationTypeElementDocImpl(this, meth, treePath);
methodMap.put(meth, result);
}
}
@@ -730,6 +725,18 @@
// return result;
}
+ TreePath getTreePath(JCCompilationUnit tree) {
+ TreePath p = treePaths.get(tree);
+ if (p == null)
+ treePaths.put(tree, p = new TreePath(tree));
+ return p;
+ }
+
+ TreePath getTreePath(JCCompilationUnit toplevel, JCTree tree) {
+ // don't bother to cache paths for classes and members
+ return new TreePath(getTreePath(toplevel), tree);
+ }
+
/**
* Set the encoding.
*/
--- a/langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -35,6 +35,9 @@
import javax.tools.FileObject;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.util.Position;
/**
@@ -61,6 +64,12 @@
protected final DocEnv env; //### Rename this everywhere to 'docenv' ?
/**
+ * Back pointer to the tree node for this doc item.
+ * May be null if there is no associated tree.
+ */
+ protected TreePath treePath;
+
+ /**
* The complex comment object, lazily initialized.
*/
private Comment comment;
@@ -88,11 +97,21 @@
/**
* Constructor.
*/
- DocImpl(DocEnv env, String documentation) {
- this.documentation = documentation;
+ DocImpl(DocEnv env, TreePath treePath) {
+ this.treePath = treePath;
+ this.documentation = getCommentText(treePath);
this.env = env;
}
+ private static String getCommentText(TreePath p) {
+ if (p == null)
+ return null;
+
+ JCCompilationUnit topLevel = (JCCompilationUnit) p.getCompilationUnit();
+ JCTree tree = (JCTree) p.getLeaf();
+ return topLevel.docComments.getCommentText(tree);
+ }
+
/**
* So subclasses have the option to do lazy initialization of
* "documentation" string.
@@ -213,11 +232,21 @@
* operations like internalization.
*/
public void setRawCommentText(String rawDocumentation) {
+ treePath = null;
documentation = rawDocumentation;
comment = null;
}
/**
+ * Set the full unprocessed text of the comment and tree path.
+ */
+ void setTreePath(TreePath treePath) {
+ this.treePath = treePath;
+ documentation = getCommentText(treePath);
+ comment = null;
+ }
+
+ /**
* return a key for sorting.
*/
CollationKey key() {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -30,13 +30,12 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.ListBuffer;
-import com.sun.tools.javac.util.Position;
/**
* Represents a method or constructor of a java class.
@@ -60,9 +59,8 @@
/**
* Constructor.
*/
- public ExecutableMemberDocImpl(DocEnv env, MethodSymbol sym,
- String rawDocs, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, rawDocs, tree, lineMap);
+ public ExecutableMemberDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
this.sym = sym;
}
@@ -70,7 +68,7 @@
* Constructor.
*/
public ExecutableMemberDocImpl(DocEnv env, MethodSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,6 +25,7 @@
package com.sun.tools.javadoc;
+import com.sun.source.util.TreePath;
import java.lang.reflect.Modifier;
import com.sun.javadoc.*;
@@ -61,9 +62,8 @@
/**
* Constructor.
*/
- public FieldDocImpl(DocEnv env, VarSymbol sym,
- String rawDocs, JCVariableDecl tree, Position.LineMap lineMap) {
- super(env, sym, rawDocs, tree, lineMap);
+ public FieldDocImpl(DocEnv env, VarSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
this.sym = sym;
}
@@ -71,7 +71,7 @@
* Constructor.
*/
public FieldDocImpl(DocEnv env, VarSymbol sym) {
- this(env, sym, null, null, null);
+ this(env, sym, null);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,13 +25,14 @@
package com.sun.tools.javadoc;
+
import javax.tools.JavaFileObject;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.comp.Enter;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
import com.sun.tools.javac.util.List;
@@ -85,8 +86,7 @@
public void visitTopLevel(JCCompilationUnit tree) {
super.visitTopLevel(tree);
if (tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) {
- String comment = TreeInfo.getCommentText(env, tree);
- docenv.makePackageDoc(tree.packge, comment, tree);
+ docenv.makePackageDoc(tree.packge, docenv.getTreePath(tree));
}
}
@@ -95,9 +95,8 @@
super.visitClassDef(tree);
if (tree.sym == null) return;
if (tree.sym.kind == Kinds.TYP || tree.sym.kind == Kinds.ERR) {
- String comment = TreeInfo.getCommentText(env, tree);
ClassSymbol c = tree.sym;
- docenv.makeClassDoc(c, comment, tree, env.toplevel.lineMap);
+ docenv.makeClassDoc(c, docenv.getTreePath(env.toplevel, tree));
}
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java Mon Dec 24 11:46:38 2012 -0800
@@ -25,14 +25,13 @@
package com.sun.tools.javadoc;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Kinds;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.comp.MemberEnter;
import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.tree.TreeInfo;
import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.Position;
/**
* Javadoc's own memberEnter phase does a few things above and beyond that
@@ -73,14 +72,13 @@
super.visitMethodDef(tree);
MethodSymbol meth = tree.sym;
if (meth == null || meth.kind != Kinds.MTH) return;
- String docComment = TreeInfo.getCommentText(env, tree);
- Position.LineMap lineMap = env.toplevel.lineMap;
+ TreePath treePath = docenv.getTreePath(env.toplevel, tree);
if (meth.isConstructor())
- docenv.makeConstructorDoc(meth, docComment, tree, lineMap);
+ docenv.makeConstructorDoc(meth, treePath);
else if (isAnnotationTypeElement(meth))
- docenv.makeAnnotationTypeElementDoc(meth, docComment, tree, lineMap);
+ docenv.makeAnnotationTypeElementDoc(meth, treePath);
else
- docenv.makeMethodDoc(meth, docComment, tree, lineMap);
+ docenv.makeMethodDoc(meth, treePath);
// release resources
tree.body = null;
@@ -92,9 +90,7 @@
if (tree.sym != null &&
tree.sym.kind == Kinds.VAR &&
!isParameter(tree.sym)) {
- String docComment = TreeInfo.getCommentText(env, tree);
- Position.LineMap lineMap = env.toplevel.lineMap;
- docenv.makeFieldDoc(tree.sym, docComment, tree, lineMap);
+ docenv.makeFieldDoc(tree.sym, docenv.getTreePath(env.toplevel, tree));
}
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/MemberDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/MemberDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -27,9 +27,8 @@
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Symbol;
-import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.util.Position;
/**
* Represents a member of a java class: field, constructor, or method.
@@ -57,8 +56,8 @@
/**
* constructor.
*/
- public MemberDocImpl(DocEnv env, Symbol sym, String doc, JCTree tree, Position.LineMap lineMap) {
- super(env, sym, doc, tree, lineMap);
+ public MemberDocImpl(DocEnv env, Symbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -28,12 +28,10 @@
import java.lang.reflect.Modifier;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.*;
import com.sun.tools.javac.code.Symbol.*;
import com.sun.tools.javac.code.Type;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.util.Position;
-
import static com.sun.tools.javac.code.TypeTag.CLASS;
/**
@@ -62,9 +60,8 @@
/**
* constructor.
*/
- public MethodDocImpl(DocEnv env, MethodSymbol sym,
- String docComment, JCMethodDecl tree, Position.LineMap lineMap) {
- super(env, sym, docComment, tree, lineMap);
+ public MethodDocImpl(DocEnv env, MethodSymbol sym, TreePath treePath) {
+ super(env, sym, treePath);
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,6 +31,7 @@
import javax.tools.FileObject;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Attribute;
import com.sun.tools.javac.code.Scope;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
@@ -75,17 +76,16 @@
* Constructor
*/
public PackageDocImpl(DocEnv env, PackageSymbol sym) {
- this(env, sym, null, null);
+ this(env, sym, null);
}
/**
* Constructor
*/
- public PackageDocImpl(DocEnv env, PackageSymbol sym,
- String documentation, JCTree tree) {
- super(env, documentation);
+ public PackageDocImpl(DocEnv env, PackageSymbol sym, TreePath treePath) {
+ super(env, treePath);
this.sym = sym;
- this.tree = (JCCompilationUnit) tree;
+ this.tree = (treePath == null) ? null : (JCCompilationUnit) treePath.getCompilationUnit();
foundDoc = (documentation != null);
}
@@ -93,8 +93,8 @@
this.tree = (JCCompilationUnit) tree;
}
- public void setRawCommentText(String rawDocumentation) {
- super.setRawCommentText(rawDocumentation);
+ public void setTreePath(TreePath treePath) {
+ super.setTreePath(treePath);
checkDoc();
}
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -29,10 +29,12 @@
import java.text.CollationKey;
import com.sun.javadoc.*;
+import com.sun.source.util.TreePath;
import com.sun.tools.javac.code.Attribute;
import com.sun.tools.javac.code.Symbol;
import com.sun.tools.javac.code.Symbol.ClassSymbol;
import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
import com.sun.tools.javac.util.Position;
/**
@@ -66,16 +68,20 @@
// Cache for getModifiers().
private int modifiers = -1;
- protected ProgramElementDocImpl(DocEnv env, Symbol sym,
- String doc, JCTree tree, Position.LineMap lineMap) {
- super(env, doc);
+ protected ProgramElementDocImpl(DocEnv env, Symbol sym, TreePath treePath) {
+ super(env, treePath);
this.sym = sym;
- this.tree = tree;
- this.lineMap = lineMap;
+ if (treePath != null) {
+ tree = (JCTree) treePath.getLeaf();
+ lineMap = ((JCCompilationUnit) treePath.getCompilationUnit()).lineMap;
+ }
}
- void setTree(JCTree tree) {
- this.tree = tree;
+ @Override
+ void setTreePath(TreePath treePath) {
+ super.setTreePath(treePath);
+ this.tree = (JCTree) treePath.getLeaf();
+ this.lineMap = ((JCCompilationUnit) treePath.getCompilationUnit()).lineMap;
}
/**
--- a/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java Mon Dec 24 11:46:38 2012 -0800
@@ -331,7 +331,6 @@
@Override
protected String documentation() {
if (documentation == null) {
- int cnt = options.length();
JavaFileObject overviewPath = getOverviewPath();
if (overviewPath == null) {
// no doc file to be had
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java Mon Dec 24 11:46:38 2012 -0800
@@ -147,7 +147,7 @@
}
}
- static Option[] recognizedOptions = {
+ static final Option[] recognizedOptions = {
new Option(true, "-o") {
void process(JavahTask task, String opt, String arg) {
task.ofile = new File(arg);
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapTask.java Mon Dec 24 11:46:38 2012 -0800
@@ -117,7 +117,7 @@
final String[] aliases;
}
- static Option[] recognizedOptions = {
+ static final Option[] recognizedOptions = {
new Option(false, "-help", "--help", "-?") {
void process(JavapTask task, String opt, String arg) {
--- a/langtools/src/share/classes/javax/lang/model/element/Modifier.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/javax/lang/model/element/Modifier.java Mon Dec 24 11:46:38 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -61,16 +61,10 @@
/** The modifier {@code native} */ NATIVE,
/** The modifier {@code strictfp} */ STRICTFP;
-
- private String lowercase = null; // modifier name in lowercase
-
/**
* Returns this modifier's name in lowercase.
*/
public String toString() {
- if (lowercase == null) {
- lowercase = name().toLowerCase(java.util.Locale.US);
- }
- return lowercase;
+ return name().toLowerCase(java.util.Locale.US);
}
}
--- a/langtools/src/share/classes/javax/lang/model/util/ElementFilter.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/javax/lang/model/util/ElementFilter.java Mon Dec 24 11:46:38 2012 -0800
@@ -66,19 +66,19 @@
public class ElementFilter {
private ElementFilter() {} // Do not instantiate.
- private static Set<ElementKind> CONSTRUCTOR_KIND =
+ private static final Set<ElementKind> CONSTRUCTOR_KIND =
Collections.unmodifiableSet(EnumSet.of(ElementKind.CONSTRUCTOR));
- private static Set<ElementKind> FIELD_KINDS =
+ private static final Set<ElementKind> FIELD_KINDS =
Collections.unmodifiableSet(EnumSet.of(ElementKind.FIELD,
ElementKind.ENUM_CONSTANT));
- private static Set<ElementKind> METHOD_KIND =
+ private static final Set<ElementKind> METHOD_KIND =
Collections.unmodifiableSet(EnumSet.of(ElementKind.METHOD));
- private static Set<ElementKind> PACKAGE_KIND =
+ private static final Set<ElementKind> PACKAGE_KIND =
Collections.unmodifiableSet(EnumSet.of(ElementKind.PACKAGE));
- private static Set<ElementKind> TYPE_KINDS =
+ private static final Set<ElementKind> TYPE_KINDS =
Collections.unmodifiableSet(EnumSet.of(ElementKind.CLASS,
ElementKind.ENUM,
ElementKind.INTERFACE,
--- a/langtools/src/share/classes/javax/tools/StandardLocation.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/src/share/classes/javax/tools/StandardLocation.java Mon Dec 24 11:46:38 2012 -0800
@@ -97,7 +97,7 @@
return locations.get(name);
}
//where
- private static ConcurrentMap<String,Location> locations
+ private static final ConcurrentMap<String,Location> locations
= new ConcurrentHashMap<String,Location>();
public String getName() { return name(); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/T8003967/DetectMutableStaticFields.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,242 @@
+/*
+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8003967
+ * @summary detect and remove all mutable implicit static enum fields in langtools
+ * @run main DetectMutableStaticFields
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileManager;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPoolException;
+import com.sun.tools.classfile.Descriptor;
+import com.sun.tools.classfile.Descriptor.InvalidDescriptor;
+import com.sun.tools.classfile.Field;
+
+import static javax.tools.JavaFileObject.Kind.CLASS;
+import static com.sun.tools.classfile.AccessFlags.ACC_ENUM;
+import static com.sun.tools.classfile.AccessFlags.ACC_FINAL;
+import static com.sun.tools.classfile.AccessFlags.ACC_STATIC;
+
+public class DetectMutableStaticFields {
+
+ private static final String keyResource =
+ "com/sun/tools/javac/tree/JCTree.class";
+
+ private String[] packagesToSeekFor = new String[] {
+ "javax.tools",
+ "javax.lang.model",
+ "com.sun.javadoc",
+ "com.sun.source",
+ "com.sun.tools.classfile",
+ "com.sun.tools.doclets",
+ "com.sun.tools.javac",
+ "com.sun.tools.javadoc",
+ "com.sun.tools.javah",
+ "com.sun.tools.javap",
+ };
+
+ private static final Map<String, List<String>> classFieldsToIgnoreMap = new HashMap<>();
+
+ static {
+ classFieldsToIgnoreMap.
+ put("javax/tools/ToolProvider",
+ Arrays.asList("instance"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javah/JavahTask",
+ Arrays.asList("versionRB"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/classfile/Dependencies$DefaultFilter",
+ Arrays.asList("instance"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javap/JavapTask",
+ Arrays.asList("versionRB"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/doclets/formats/html/HtmlDoclet",
+ Arrays.asList("docletToStart"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/JCDiagnostic",
+ Arrays.asList("fragmentFormatter"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/JavacMessages",
+ Arrays.asList("defaultBundle", "defaultMessages"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/file/ZipFileIndexCache",
+ Arrays.asList("sharedInstance"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/main/JavaCompiler",
+ Arrays.asList("versionRB"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/code/Type",
+ Arrays.asList("moreInfo"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/SharedNameTable",
+ Arrays.asList("freelist"));
+ classFieldsToIgnoreMap.
+ put("com/sun/tools/javac/util/Log",
+ Arrays.asList("useRawMessages"));
+ }
+
+ private List<String> errors = new ArrayList<>();
+
+ public static void main(String[] args) {
+ try {
+ new DetectMutableStaticFields().run();
+ } catch (Exception ex) {
+ throw new AssertionError(
+ "Exception during test execution with cause ",
+ ex.getCause());
+ }
+ }
+
+ private void run()
+ throws
+ IOException,
+ ConstantPoolException,
+ InvalidDescriptor,
+ URISyntaxException {
+
+ URI resource = findResource(keyResource);
+ if (resource == null) {
+ throw new AssertionError("Resource " + keyResource +
+ "not found in the class path");
+ }
+ analyzeResource(resource);
+
+ if (errors.size() > 0) {
+ for (String error: errors) {
+ System.err.println(error);
+ }
+ throw new AssertionError("There are mutable fields, "
+ + "please check output");
+ }
+ }
+
+ URI findResource(String className) throws URISyntaxException {
+ URI uri = getClass().getClassLoader().getResource(className).toURI();
+ if (uri.getScheme().equals("jar")) {
+ String ssp = uri.getRawSchemeSpecificPart();
+ int sep = ssp.lastIndexOf("!");
+ uri = new URI(ssp.substring(0, sep));
+ } else if (uri.getScheme().equals("file")) {
+ uri = new URI(uri.getPath().substring(0,
+ uri.getPath().length() - keyResource.length()));
+ }
+ return uri;
+ }
+
+ boolean shouldAnalyzePackage(String packageName) {
+ for (String aPackage: packagesToSeekFor) {
+ if (packageName.contains(aPackage)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ void analyzeResource(URI resource)
+ throws
+ IOException,
+ ConstantPoolException,
+ InvalidDescriptor {
+ JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
+ StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
+ JavaFileManager.Location location =
+ StandardLocation.locationFor(resource.getPath());
+ fm.setLocation(location, com.sun.tools.javac.util.List.of(
+ new File(resource.getPath())));
+
+ for (JavaFileObject file : fm.list(location, "", EnumSet.of(CLASS), true)) {
+ String className = fm.inferBinaryName(location, file);
+ int index = className.lastIndexOf('.');
+ String pckName = index == -1 ? "" : className.substring(0, index);
+ if (shouldAnalyzePackage(pckName)) {
+ analyzeClassFile(ClassFile.read(file.openInputStream()));
+ }
+ }
+ }
+
+ List<String> currentFieldsToIgnore;
+
+ boolean ignoreField(String field) {
+ if (currentFieldsToIgnore != null) {
+ for (String fieldToIgnore : currentFieldsToIgnore) {
+ if (field.equals(fieldToIgnore)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ void analyzeClassFile(ClassFile classFileToCheck)
+ throws
+ IOException,
+ ConstantPoolException,
+ Descriptor.InvalidDescriptor {
+ boolean enumClass =
+ (classFileToCheck.access_flags.flags & ACC_ENUM) != 0;
+ boolean nonFinalStaticEnumField;
+ boolean nonFinalStaticField;
+
+ currentFieldsToIgnore =
+ classFieldsToIgnoreMap.get(classFileToCheck.getName());
+
+ for (Field field : classFileToCheck.fields) {
+ if (ignoreField(field.getName(classFileToCheck.constant_pool))) {
+ continue;
+ }
+ nonFinalStaticEnumField =
+ (field.access_flags.flags & (ACC_ENUM | ACC_FINAL)) == 0;
+ nonFinalStaticField =
+ (field.access_flags.flags & ACC_STATIC) != 0 &&
+ (field.access_flags.flags & ACC_FINAL) == 0;
+ if (enumClass ? nonFinalStaticEnumField : nonFinalStaticField) {
+ errors.add("There is a mutable field named " +
+ field.getName(classFileToCheck.constant_pool) +
+ ", at class " +
+ classFileToCheck.getName());
+ }
+ }
+ }
+
+}
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java Mon Dec 24 11:46:38 2012 -0800
@@ -20,4 +20,3 @@
@Foo @Foo
public class MissingDefaultCase1 {}
-
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out Mon Dec 24 11:46:38 2012 -0800
@@ -1,2 +1,3 @@
+MissingDefaultCase1.java:21:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
MissingDefaultCase1.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
-1 error
+2 errors
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java Mon Dec 24 11:46:38 2012 -0800
@@ -20,4 +20,3 @@
@Foo @Foo
public class MissingDefaultCase2 {}
-
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out Mon Dec 24 11:46:38 2012 -0800
@@ -1,2 +1,3 @@
+MissingDefaultCase2.java:21:1: compiler.err.duplicate.annotation.invalid.repeated: Foo
MissingDefaultCase2.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
-1 error
+2 errors
--- a/langtools/test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out Mon Dec 24 11:46:38 2012 -0800
@@ -1,3 +1,3 @@
-NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo
-NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo
+NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.ContainedBy
+NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo, java.lang.annotation.ContainedBy
2 errors
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @summary Container annotation is not checked for semantic correctness
+ * @bug 8001114
+ *
+ * @compile/fail/ref=RepeatingTargetNotAllowed.out -XDrawDiagnostics RepeatingTargetNotAllowed.java
+ */
+
+import java.lang.annotation.*;
+
+@ContainedBy(Foos.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@Target(ElementType.ANNOTATION_TYPE)
+@interface Foos {
+ Foo[] value();
+}
+
+public class RepeatingTargetNotAllowed {
+ @Foo @Foo int f = 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/RepeatingTargetNotAllowed.out Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,2 @@
+RepeatingTargetNotAllowed.java:44:5: compiler.err.invalid.containedby.annotation.incompatible.target: Foos, Foo
+1 error
--- a/langtools/test/tools/javac/diags/examples/ContainedByNonDefault.java Thu Dec 20 10:22:19 2012 +0100
+++ b/langtools/test/tools/javac/diags/examples/ContainedByNonDefault.java Mon Dec 24 11:46:38 2012 -0800
@@ -31,6 +31,4 @@
@ContainerFor(Anno.class)
@interface Annos { Anno[] value(); String foo(); }
-@Anno
-@Anno
class ContainedByNonDefault { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/InvalidDuplicateAnnotation.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+// key: compiler.err.duplicate.annotation.invalid.repeated
+// key: compiler.err.invalid.containedby.annotation.elem.nondefault
+//
+// We need an almost valid containing annotation. The easiest way to get
+// one close enough to valid is by forgetting a default.
+
+import java.lang.annotation.*;
+
+@ContainedBy(Annos.class)
+@interface Anno { }
+
+@ContainerFor(Anno.class)
+@interface Annos { Anno[] value(); String foo(); }
+
+@Anno
+@Anno
+class InvalidDuplicateAnnotation { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/8004094/B.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ */
+abstract class A {
+
+ private static String s = null;
+
+ static void test() {
+ new Object() {
+ void m() {
+ Object o = s;
+ }
+ };
+ }
+}
+
+public abstract class B<T> extends A {
+
+ private static Integer i = null;
+
+ static void test() {
+ new Object() {
+ void m() {
+ Object o = i;
+ }
+ };
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/generics/8004094/T8004094.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8004094
+ * @summary Javac compiler error - synthetic method accessor generated with duplicate name
+ *
+ * @compile B.java T8004094.java
+ */
+
+public class T8004094 extends B<Object> { }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/util/list/ListBufferTest.java Mon Dec 24 11:46:38 2012 -0800
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * 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 8004504
+ * @summary Ensure that ListBuffer is working properly
+ */
+
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.ListBuffer;
+import java.util.Iterator;
+import java.util.Objects;
+
+public class ListBufferTest {
+ public static void main(String... args) {
+ testRemove();
+ testCopiedEndsWithList_nil();
+ }
+
+ private static void testCopiedEndsWithList_nil() {
+ ListBuffer<String> lb = new ListBuffer<>();
+
+ lb.add("a");
+ lb.add("b");
+ lb.add("c");
+
+ List<String> l1 = lb.toList();
+
+ assertListEquals(l1, "a", "b", "c");
+ assertEndsWithNil(l1);
+
+ lb.add("d");
+
+ List<String> l2 = lb.toList();
+ assertListEquals(l2, "a", "b", "c", "d");
+ assertEndsWithNil(l2);
+ assertListEquals(l1, "a", "b", "c");
+ }
+
+ private static void testRemove() {
+ ListBuffer<String> lb1 = new ListBuffer<>();
+
+ lb1.add("a");
+ lb1.add("b");
+ lb1.add("c");
+
+ assertListEquals(lb1.toList(), "a", "b", "c");
+ assertEquals(lb1.next(), "a");
+ assertListEquals(lb1.toList(), "b", "c");
+ assertEquals(lb1.next(), "b");
+ assertListEquals(lb1.toList(), "c");
+ assertEquals(lb1.next(), "c");
+ assertListEquals(lb1.toList());
+ assertEquals(lb1.next(), null);
+
+ lb1.add("d");
+
+ assertEquals(lb1.next(), "d");
+ }
+
+ private static void assertEndsWithNil(List<?> list) {
+ while (!list.isEmpty()) {
+ list = list.tail;
+ }
+
+ if (list != List.nil()) throw new IllegalStateException("Not ending with List.nil()");
+ }
+
+ private static <T> void assertListEquals(Iterable<T> list, T... data) {
+ int i = 0;
+ Iterator<T> it = list.iterator();
+
+ while (it.hasNext() && i < data.length) {
+ assertEquals(it.next(), data[i++]);
+ }
+
+ if (it.hasNext()) {
+ throw new IllegalStateException("Too many elements in the list");
+ }
+
+ if (i < data.length) {
+ throw new IllegalStateException("Too few elements in the list");
+ }
+ }
+
+ private static void assertEquals(Object expected, Object actual) {
+ if (!Objects.equals(expected, actual)) {
+ throw new IllegalStateException("Incorrect content. Expected: " + expected + ", actual: " + actual);
+ }
+ }
+}